feat(v2): allow custom heading component#1687
Merged
Conversation
Contributor
|
Deploy preview for docusaurus-2 ready! Built with commit 277480e |
Contributor
|
Deploy preview for docusaurus-preview ready! Built with commit 277480e |
Merged
yangshun
approved these changes
Jul 23, 2019
Contributor
yangshun
left a comment
There was a problem hiding this comment.
Would people accidentally cause their headings on blog to break if they only want to modify the headings on docs?
Contributor
Author
|
technically theme classic use the same mdxcomponents. if they want different, swizzle the blog layout to use different comp. anw this pr is better than previous, previously we alrd transform the heading in html 😂 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Rather than hardcoding/ transforming the header automatically in html, we should allow composition style. This will allow user to modify the heading as they like. Example: if they dont want hash icon
previously
docusaurus/packages/docusaurus-mdx-loader/src/rehype/linkHeadings.js
Lines 8 to 56 in 55ef751
For now i make it the same format as before, feel free to tweak in new pr
Have you read the Contributing Guidelines on pull requests?
yes
Test Plan