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 IDs and anchors to headings #84

Open
hagenburger opened this issue Oct 10, 2018 · 0 comments
Open

Add IDs and anchors to headings #84

hagenburger opened this issue Oct 10, 2018 · 0 comments
Assignees
Labels
enhancement New feature or request plugin
Milestone

Comments

@hagenburger
Copy link
Owner

hagenburger commented Oct 10, 2018

Write a plugin that adds IDs and anchors to headings.

Example

Input:

# Lorem ipsum

Output:

<h1><a href="#lorem-ipsum"><span id="lorem-ipsum"></span></a>Lorem ipsum</h1>

Background

  • The extra <span> allows manipulating the scroll position (for example when there’s a fixed navigation, this avoids that the headline is hidden behind it)
  • The <a> should be visible on hover and display a #, link icon or anchor icon (depending on the theme)
  • This might need to have an additional hook which gets called in renderInline()
@hagenburger hagenburger added enhancement New feature or request plugin labels Oct 10, 2018
@hagenburger hagenburger added this to the v1.0.0 milestone Oct 10, 2018
@hagenburger hagenburger self-assigned this Oct 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request plugin
Projects
None yet
Development

No branches or pull requests

1 participant