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

Built-in content.toc plugin #56

Closed
traut opened this issue Jan 28, 2024 · 1 comment
Closed

Built-in content.toc plugin #56

traut opened this issue Jan 28, 2024 · 1 comment
Labels
enhancement New feature or request plugins
Milestone

Comments

@traut
Copy link
Member

traut commented Jan 28, 2024

Design

data.toc plugin renders a Table Of Contents for the document

Specification

  • the plugin has no configuration options
  • API interface (inspired by Hugo TOC config):
    • start_level -- (optional) a positive int attribute. Default value: 1
    • end_level -- (optional) a positive int attribute. Default value: 3
    • ordered -- (optional) a boolean attribute. Default value: false
    • scope -- (optional) a string attribute. Accepted values are: document and section. Default value: document.

Behavior

The plugin accepts a local content with the parsed document tree inside (#17), walks the tree (depending on the scope -- section or document -- the walk is constrained or not) and assembles a table of contents from content.text block with format_as set to title (#15)

This plugin might reuse relative-title-size calculation that the content.text plugin performs if absolute_title_size is not set.

Deliverables

  • new built-in content.toc plugin
  • the unit tests for the plugin
@traut traut added enhancement New feature or request plugins labels Jan 28, 2024
@traut traut added this to the v0.3 milestone Jan 28, 2024
@traut traut changed the title built-in content.toc plugin Built-in content.toc plugin Jan 28, 2024
@dobarx dobarx mentioned this issue Feb 20, 2024
5 tasks
@traut traut modified the milestones: v0.3, v0.4 Feb 21, 2024
@traut
Copy link
Member Author

traut commented Feb 21, 2024

keeping open and moving to v0.4 milestone, since it depends on #98, as agreed in a conversation on slack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request plugins
Projects
None yet
Development

No branches or pull requests

2 participants