Skip to content
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

Feature: import code snippet with a Vue component #83

Open
egoist opened this issue Apr 29, 2019 · 1 comment
Open

Feature: import code snippet with a Vue component #83

egoist opened this issue Apr 29, 2019 · 1 comment
Labels
💵 Funded on Issuehunt This issue has been funded on Issuehunt type: feature
Projects

Comments

@egoist
Copy link
Collaborator

egoist commented Apr 29, 2019

Issuehunt badges

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:

<import-snippet path="./sample-code.js" highlightLines="[1,3]" />

How should this be implemented in your opinion?

Use a custom vue-template-compiler module to transform:

<import-snippet path="./sample-code.js" highlightLines="[1,3]" />

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.

Are you willing to work on this yourself?

Yes

There is a $60.00 open bounty on this issue. Add more on Issuehunt.

@issuehunt-oss issuehunt-oss bot added the 💵 Funded on Issuehunt This issue has been funded on Issuehunt label May 1, 2019
@IssueHuntBot
Copy link

@IssueHunt has funded $60.00 to this issue.


@egoist egoist added this to In progress in Roadmap May 2, 2019
@egoist egoist moved this from In progress to Investigation in Roadmap May 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💵 Funded on Issuehunt This issue has been funded on Issuehunt type: feature
Projects
Roadmap
  
Investigation
Development

No branches or pull requests

2 participants