We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
We can transform code blocks in markdown to template like this:
<saber-highlight lang="$language" highlightLines="[1,2]" encodedCode="$encodedCode"> </saber-highlight>
Then use PostHTML to transform it to:
<saber-highlight :content="require('!saber-highlight-loader!noop-module?code=$encodedCode&lang=$language&highlightLines=[1,2]')"> </saber-highlight>
You can also use <saber-highlight> directly to highlight external file:
<saber-highlight>
<saber-highlight src="./sample.js"></saber-highlight>
Which will be transformed to:
<saber-highlight :content="require('!saber-highlight-loader!./sample.js')" ></saber-highlight>
saber-highlight-loader
..
Vue.component('SaberHighlight', { functional: true, props: ['content'] render: h => h('div', { class: 'saber-highlight' }, content) })
The text was updated successfully, but these errors were encountered:
No branches or pull requests
1. Transform template
We can transform code blocks in markdown to template like this:
Then use PostHTML to transform it to:
You can also use
<saber-highlight>
directly to highlight external file:Which will be transformed to:
2. Implement code highlighting in
saber-highlight-loader
...
3. Add a new component
The text was updated successfully, but these errors were encountered: