Skip to content

Enrich MarkdownAST with origin of data #2826

@fingolfin

Description

@fingolfin

This now came up in multiple issues: it would be good if we kept track of where the MarkdownAST nodes come from (which file / lines).

This could be done by adding custom node types; or by keeping a global Dict (WeakKeyDic) which maps these nodes to location info. The goal would be to enable better error messages pointing to the precise origin of the problem

I am in particular thinking about tracking the origin of code blocks, so that could mean we replace MarkdownAST.CodeBlock by our own version that tracks the origin.

But also for broken [bla](@ref) links this is important; those could come from a docstring in some .jl file and can be hard to track down (see also #2296)

Tracking docstring origins might also be helpful for dealing with "syntax errors" in those (see #2821)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions