graphlab-fr / cosma

Cosma is a document graph visualization tool. It modelizes interlinked Markdown files and renders them as an interactive network in a web interface.
https://cosma.arthurperret.fr
GNU General Public License v3.0
125 stars 4 forks source link

[Enhancement] Section links #151

Open mefor44 opened 2 days ago

mefor44 commented 2 days ago

Which part of Cosma is your request about?

Describe your request:

I am trying to reference a section (part of markdown with ## Section 2), and haven't find a way to do it that works

infologie commented 2 days ago

It's not that section links don't work, it's just that this feature doesn't exist in Cosma. Unlike Pandoc for example, Cosma doesn't automatically generate identifiers for HTML elements such as titles (or sections), nor does it provide a mechanism to add identifiers to elements. I'll change the title of the issue. I'd like Cosma to eventually parse Markdown as Pandoc's Markdown, and this would be included. I'll discuss this with @Myllaume and keep you updated here if we move on it.

infologie commented 2 days ago

Cosma uses markdown-it to parse Markdown. There is a markdown-it-attrs module that provides a way to add attributes to elements, including identifiers, just as Pandoc does. This module used to be included in Cosma's dependencies, and while it's still mentioned in Cosma's credits, we have removed it at some point. @Myllaume do you remember why we removed it? Can we look into adding it back?

Myllaume commented 2 days ago

This dependency was useful for generating links in records. But I've changed the method, which makes the dependency obsolete. We can look into giving Cosma new syntax tools.