Skip to content

Consistently handle storage of target/reference labels #10

Open
@chrisjsewell

Description

@chrisjsewell

Most directives allow for a name option for referencing them, then for roles we have e.g. {ref}`text<label>` and the equivalent Markdown syntax like [text](label).

Then we also have the target syntax in myst: (label)= (a reference implementation is currently here: https://github.com/executablebooks/myst-vs-code/blob/83460fc5f14517e8d6c6b7eb5581d814389fbc7c/src/mdPlugins.ts#L32, but perhaps we should move that into this package, they also get a little trick as we also need to "propogate" them down to the next block token, see: https://github.com/chrisjsewell/rst-language-server#transformsreferencespropagatetargets).

Essentially we want to be able to easily "scan" down the markdown-it token stream, and pull out all these targets and references, along with their map (a.k.a. position in the source text) and probably index in the token stream

cc @rowanc1

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions