Skip to content

Resolving references #7

Description

@andreubotella

So @flying-sheep started working on resolving references by writing a two-pass transform approach: one which would walk the tree to keep track of every target of a reference, and then one which would walk the tree making the corresponding changes. I'm not sure anymore that all references can be resolved that way.

So, the different types of targets and references in ReST are:

The thing that makes this hard, perhaps impossible, to resolve in those two passes is substitutions, which in docutils get handled earlier than every other reference. Right now our parser only accepts an image directive inside a substitution definition, but in the general case substitution references can be replaced by any inline content (with the replace directive, for example), which can in turn have auto-numbered footnote references, anonymous hyperlink references or hyperlinks with an embedded URL.

I guess for now we could handle everything in those two passes, but in the future we'll have to move the code for substitutions to its own separate two passes that run before the others.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions