-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Line number overwrite at code block or page level #1909
Comments
Contribution welcome! You can pass the frontmatter setting via the 2nd parameter( vuepress/packages/@vuepress/markdown-loader/index.js Lines 74 to 78 in d858e43
Consuming this |
In the meanwhile I'm using a CSS overwrite targeting |
I'd love to contribute in this feature! ✨ Can I have this assigned? |
Sure @roeeyn |
Hey @kefranabg 👋 I'm working on this issue, but I have some doubts. Where may I reach you? Sorry, I'm kind of newbie, but want to help 😄 |
So, my very summarized question is: what is the correct way of accessing the frontmatter from the lineNumbers plugin? Also, this will only work if the lineNumbers is set to true in the markdown config. Is that ok? Maybe we could set to true the lineNumbers by default (so the plugin adds to the chain) and only overriding it in the frontmatter. I tried following @ulivz suggestion but I was not able to reach the front matter inside the plugin. It only reaches the inside of the overridden render method. vuepress/packages/@vuepress/markdown/index.js Lines 137 to 147 in 770ba72
Any suggestion? |
According to prism's line-numbers plugin, I tried adding a I would love to do block-specific overrides like the following: ``` {.line-numbers}
text with
line numbers
``` |
I considered disabling the built-in highlight plugin (and the others that basically depend on it) in favor of using markdown-it-prism and its plugins directly, but it doesn't appear to be disableable, unfortunately. There is a separate issue for this already: #1860 Edit: Apparently, some/many prism plugins can't be used without a browser jGleitz/markdown-it-prism#1. |
This actually helped and I recommend it. E.g I don't need line numbers in shell. .language-shell.line-numbers-mode
.line-numbers-wrapper
display none |
Feature request
What problem does this feature solve?
While the
markdown.lineNumber
config is useful, sometimes we want to overwrite specific code block or pages. For example line number is useful for demo code especially if we want to highlight specific lines. But in other case like typescript definition, we might want to hide the line numbers.What does the proposed API look like?
Maybe use Front Matter?
How should this be implemented in your opinion?
Are you willing to work on this yourself?
The text was updated successfully, but these errors were encountered: