Open egoist opened 5 years ago
Import code snippet in Vue template, which means it works in Markdown page, Vue page or even HTML page and Pug page, it just works everywhere
Simply use the Vue component:
<import-snippet path="./sample-code.js" highlightLines="[1,3]" />
Use a custom vue-template-compiler module to transform:
to:
<import-snippet :content="require('!import-snippet-loader?{highlightLines:[1,3]}!./sample-code.js')" />
import-snippet-loader is webpack loader which uses saber-markdown to transform the code into <pre><code></code></pre> and returns it.
import-snippet-loader
<pre><code></code></pre>
Yes
There is a $60.00 open bounty on this issue. Add more on Issuehunt. Checkout the Issuehunt explorer to discover more funded issues. Need some help from other developers? Add your repositories on Issuehunt to raise funds.
There is a $60.00 open bounty on this issue. Add more on Issuehunt.
@issuehunt has funded $60.00 to this issue.
Feature request
What problem does this feature solve?
Import code snippet in Vue template, which means it works in Markdown page, Vue page or even HTML page and Pug page, it just works everywhere
What does the proposed API look like?
Simply use the Vue component:
How should this be implemented in your opinion?
Use a custom vue-template-compiler module to transform:
to:
import-snippet-loader
is webpack loader which uses saber-markdown to transform the code into<pre><code></code></pre>
and returns it.Are you willing to work on this yourself?
Yes