artempyanykh / marksman

Write Markdown with code assist and intelligence in the comfort of your favourite editor.
MIT License
2.08k stars 35 forks source link

Support heading IDs #41

Open artempyanykh opened 2 years ago

artempyanykh commented 2 years ago

This is a non-standard feature https://www.markdownguide.org/extended-syntax/#heading-ids However it can be useful! For instance, docusaurus (docusaurus.io) understands custom heading IDs.

reagle commented 2 years ago

In pandoc, any text (not just headings) can be decorated with an ID. For example:

- (200 pts) **[Practical exercises]{id="practical-exercises"}**

Could marksman support this?

artempyanykh commented 2 years ago

@reagle how does this work exactly? Is this [<text>]{id="<id>"} the syntax you need to use to decorate something with an id (basically, wrap it in a link-like thing)?

reagle commented 2 years ago

Hi @artempyanykh.

Pandoc supports two extensions that I use, implicit header references on headings and bracketed spans elsewhere. Neither is in the core CommonMark specification, but bracketed spans are supported in djot, which I hope will become commonplace. I use both extensions and marksman gives warnings of missing targets. I thought there might be a way to turn off these warnings or perhaps it could support these extensions, which brought me to this issue. 😄

artempyanykh commented 2 years ago

@reagle thanks! I like the idea of supporting these extensions. I extracted each into its own issue.