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

Register heading title to add it back as title attribute #33

Open
pawamoy opened this issue Sep 18, 2023 · 1 comment
Open

Register heading title to add it back as title attribute #33

pawamoy opened this issue Sep 18, 2023 · 1 comment
Labels
fund Issue priority can be boosted

Comments

@pawamoy
Copy link
Member

pawamoy commented Sep 18, 2023

@waylan noticed that links created by autorefs with the [title][id] syntax do not have a title HTML attribute. It would be nice to have a title in any case:

  • for object headings, using the object's complete identifier (dotted-path in Python) as title
  • for text headings, using the actual title

As to how to record these:

  • mkdocstrings' do_heading filter can probably use the passed id
  • when picking up the rest of headings, autorefs could register their contents alongside their slugs and URLs

An alternative would be to reuse the provided identifier in [title][id] as title HTML attribute if it is different than the provided title, but that would only make sense for objects, not regular headings (we don't want to show a tooltip on hover with a heading's slug).

Boost priority

  • Boost priority in our backlog through Polar.sh. Higher pledge, higher priority.
  • Minimum pledge by user/organization is $5, minimum amount for boost is $30.
  • View all issues with pledges.
  • We receive the funds once the issue is completed and confirmed by you.
  • Features with the insiders label are released to sponsors first, and tied to a funding goal.
Fund with Polar
@waylan
Copy link

waylan commented Sep 19, 2023

I was curious how this plugin worked and see that your reference store is of the format dict[str, str]. However, Python Markdown's store is of the format dict[str, tuple[str, str]] as you can see in markdown/blockprocessors.py#L574 (self.parser.md.references[id] = (link, title)). Presumably, if you did the same, you would know what the source of the reference was when creating it and could more easily determine a title at that time. For example, you would know you were creating a reference for a code object and could generate a title when saving to the store. For that matter, you could even store the label of TOC links as titles.

@pawamoy pawamoy added the fund Issue priority can be boosted label Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fund Issue priority can be boosted
Projects
None yet
Development

No branches or pull requests

2 participants