executablebooks / sphinx-external-toc

A sphinx extension that allows the site-map to be defined in a single YAML file
https://sphinx-external-toc.readthedocs.io
MIT License
33 stars 18 forks source link

Styling of TOC item labels #42

Open hyanwong opened 3 years ago

hyanwong commented 3 years ago

I would like to be able to target specific TOC labels in the sidebar with styling (e.g. using CSS in the HTML rendering). This would, for example, allow me to visually flag up chapters that are not yet completed

Describe the solution you'd like

I wonder if there could be an option to set the html class name, e.g.

  - file: my_chapter
    options:
      class: unfinished

Describe alternatives you've considered

Another possibility would be to allow e.g. html markup in the "title" field:

  - file: my_chapter
    title: <em>An unfinished chapter</em>
welcome[bot] commented 3 years ago

Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada:

hyanwong commented 3 years ago

Actually, I see that styling within the section header is passed through to the TOC page, e.g.

# _italic chapter_

So perhaps it's just a question of documenting this, and a way to style the chapter title e.g. using colour or raw html?