Comments (3)
there's no way to manually specify a header's ID.
This plugin allows existing IDs:
Line 23 in 22582b7
if I want to update a header's text, I must then go and update many of the links into that section.
This sounds like a different problem than your solution? With {#id}
s, when you change them, you must also update all links?
we can support the same
Title {#id}
syntax asgatsby-remark-autolink-headers
and others
I’m not a giant fan of this syntax, as it interferes with MDX 2 expressions, and isn’t supported by CommonMark or GitHub (in fact, it breaks linking on GH). Why do you want manual IDs? How often do you use them?
You could implement them as a syntax extension as well: https://github.com/micromark/micromark#case-variables.
from rehype-slug.
Hmm that's true. I may just take that logic and export elsewhere in a different rehype
plugin
This sounds like a different problem than your solution? With {#id}s, when you change them, you must also update all links?
This is true, but with an important caveat: I tend to have an alright grasp of the section when I update the headers' text, but not a perfect grasp on what the headed section should be called in terms of a heading tag. Because of this, the manual IDs tend to help rather frequently with understanding the sections, being able to change the headings without having to change the section links. (because for each heading I add a link to the blog that I tend to link out for specific purposes)
You could implement them as a syntax extension as well: https://github.com/micromark/micromark#case-variables.
I admittedly missed this. Seems like the better implementation route to go towards. The Unified ecosystem is so big - it's awesome!
from rehype-slug.
This problem is something several people touch on, so I’d like to be involved in finding a proper solution.
I don’t think that’s here. But do ping me wherever you’re having the discussion!
from rehype-slug.
Related Issues (11)
- Broken anchors when header contains accents HOT 10
- Handle titles starting with numbers HOT 4
- Add option for adding a prefix HOT 3
- add a new option to treat no-break spaces as whitespace (and yield dashes in their place) HOT 2
- Why not support a pluggable `option.slug` function (or `options.slugger` implementation)? HOT 9
- Option to capitalize slugs HOT 5
- Typescript typings for this plugin HOT 3
- Types introduced in v4 aren't exposed via the package.json
- Add support for 'German' umlaute HOT 2
- Customize which headings are included HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rehype-slug.