Add option to keep capitalization in generated heading IDs
complete
Jean-Philippe Côté
Heading IDs (the part after the # sign) are currently forced to lowercase. This is a bit odd since the part before the # sign is not. I would like to propose a configuration that preserves case in generated heading IDs. This would be very helpful in cases where the IDs in the docs are actual method and property names.
It should be straightforward since github-slugger (the module used to generate heading IDs) has a method called slug() with a parameter to preserve case or not.
Joshua Chen
complete
Joshua Chen
You can do so by giving an explicit heading ID: https://docusaurus.io/docs/next/markdown-features/headings#explicit-ids And I've added a
--maintain-case
option (https://github.com/facebook/docusaurus/pull/5740) to help doing soJean-Philippe Côté
Joshua Chen: Awesome! I added the explicit IDs but, by itself, this does not work. So, I guess I need to specify the
--maintain-case
option somewhere. Can I put this option in the themeConfig
section of docusaurus.config.js
?Jean-Philippe Côté
It just kicked in! I guess something was stuck in the cache. Thank you so much for your quick turnaround on this. Cheers!