-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Feat: Enhance code snippets import continuation of #538 #750
Comments
Cool, thanks for creating this issue. let's work for that after 1.0.0 release. |
Cool, glad you like it. I had some problems on running with local "linked" directory, both with npm and yarn.. Could figure out very well. Could find the file So when it's time to do this, let me know! Thanks! |
@ulivz may I sketch/prototype some examples of usage and expected output? |
Would it be an idea to allow snippets from the file which displays the snippet? This would mean that demo/howto examples could display the code which was used to create the rendered output without duplication. |
Without the terms code fence or fencing or fragment in this thread it was difficult to find, so mentioning it now for other's future searching. Docsify has an implementation of this as seen https://docsify.js.org/#/embed-files?id=embedded-code-fragments and I wanted to ask if anyone was working on this feature here? |
There is already a plugin: #1336 |
Too right. Wish it supported external sources like Docsify though! |
As actually a plugin exist i am closing the issue. We will have a look about implement it in core thank's for your time all |
It seems that plugin is out of maintenance. I mention it here that there's a mistake in the document of that plugin, it should be markdown: {
plugins: ['markdown-it-vuepress-code-snippet-enhanced'],
}, instead of markdown: {
config: md => {
md.use(require('markdown-it-vuepress-code-snippet-enhanced'))
}
}, The latter will render And one more thing, I use this plugin for *.md files, which is been rendered as highlighted plain text. So how can I make it render as true markdown? |
@cloydlau I don't think rending the output as a link is the intended function of this plugin. It is suppose to render a code block. |
Feature request
What problem does this feature solve?
When documenting an existing code project, if we later change some code on that, which is being imported on Vuepress docs, it gets out of sync!
So this Feature Request is extending more functionality on top of #538 (and somewhat similar to #612 but much simpler and more flexibility)
What does the proposed API look like?
Currently we have
Proposition on #538 is
That's great, and may continue to exist.
For making more dynamic approach, we could use "text-markers" (that could have * as wildcard :) )
if possible two more optional arguments (some code ommited for clarity)
How should this be implemented in your opinion?
Pseudo-algorithm to implement it
Are you willing to work on this yourself?**
Yes I am. I will need some guidance with webpack related matters.
I do lots of stuff with VueJS for webapps, with SFC, started renderless components few weeks ago and so on... but webpack related, I don't have significant experience.
Going to clone and yarn link to try out locally, what goes on, try to hack something.
Would love to hear your feedback.
Thanks!
The text was updated successfully, but these errors were encountered: