Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Section links #151

Open
1 of 4 tasks
mefor44 opened this issue Nov 5, 2024 · 3 comments
Open
1 of 4 tasks

[Enhancement] Section links #151

mefor44 opened this issue Nov 5, 2024 · 3 comments
Labels
enhancement Feature requests

Comments

@mefor44
Copy link

mefor44 commented Nov 5, 2024

Which part of Cosma is your request about?

  • command-line interface
  • cosmoscope (HTML file)
  • documentation
  • other

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

@mefor44 mefor44 added the enhancement Feature requests label Nov 5, 2024
@infologie
Copy link
Contributor

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 infologie changed the title [Enhancement] Section links not working [Enhancement] Section links Nov 5, 2024
@infologie
Copy link
Contributor

infologie commented Nov 5, 2024

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
Copy link
Member

Myllaume commented Nov 5, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature requests
Projects
None yet
Development

No branches or pull requests

3 participants