8000 Make the built-in typeset plugin compatible with data-toc-label · Issue #5790 · squidfunk/mkdocs-material · GitHub
[go: up one dir, main page]

Skip to content

Make the built-in typeset plugin compatible with data-toc-label #5790

@lampensau

Description

@lampensau

Description

I am using the markdown extension attr_list and data attribute data-toc-label to shorten long headings that make up a document's TOC (h2 - h6). Unfortunately, the data attribute doesn't seem to be compatible with the built-in typeset plugin. As soon as the plugin is active, the data attribute is removed but the TOC representation does not change.

Context

Sadly, I am unable to create a reproduction using insiders, as the current beta is recognized as newer. Unfortunately, as of now, the typeset plugin is only available using insiders > 4.27.0:

ERROR   -  Please upgrade to the latest version.

  When reporting issues, please first upgrade to the latest
  version of Material for MkDocs, as the problem might already
  be fixed in the latest version. This helps reduce duplicate
  efforts and saves us maintainers time.

  Please update from 9.1.21+insiders.4.38.0 to 9.2.0b2.

  pip install --upgrade --force-reinstall mkdocs-material

However, using this minimal mkdocs.yml in combination with the following heading will produce my findings. Disabling the typeset plugin will produce a shortened TOC heading.

site_name: My Docs

theme:
  name: material

plugins:
  - typeset

markdown_extensions:
  - attr_list
## Very long heading that spans across multiple TOC lines { data-toc-label="Short heading that fits the TOC" }

Related links

Use Cases

I have long document headings (h2 - h6) that make up a document's TOC which, if left as is, extend over multiple lines. This makes them harder to grasp when skimming over the TOC. I used to shorten such headings for the TOC and would like to continue to do so when using the built-in typeset plugin.

Visuals

No response

Before submitting

Metadata

Metadata

Assignees

No one assigned

    Labels

    change requestIssue requests a new feature or improvementresolvedIssue is resolved, yet unreleased if open

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0