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

Add table of content generation support #64

Open
2 tasks
alakra opened this issue Dec 14, 2024 · 0 comments
Open
2 tasks

Add table of content generation support #64

alakra opened this issue Dec 14, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@alakra
Copy link
Member

alakra commented Dec 14, 2024

Summary

Generates a data structure that holds a TOC generated from a markdown file.

Details

This feature should provide:

  • adds new field to metadata when passed to a resource's build/3 function
  • adds anchors in generated content of the article to link the TOC to the headers

The data structure should be a nested keyword list:

[
  {"Header 1", "#header_1"},
  {"Header 2", "#header_2", [
    {"Header A", "#header_a"}
  ]}
]

This will always generate a toc key in the metadata. If you don't want it, just ignore it.

  1. The metadata will contain a "toc" key with the TOC datastructure.
  2. The markdown content will inject anchors automatically for every header.

Acceptance Criteria

  • Generates "toc" key in metadata
  • Generates anchors for all headers
@alakra alakra self-assigned this Dec 14, 2024
@alakra alakra added the enhancement New feature or request label Dec 14, 2024
@alakra alakra added this to the v0.3 milestone Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant