-
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
Markdown component #222
Comments
I don't think this has to be a component, can simply be a comment-based directive: <!-- include ./sectionA.md --> And then parsed and handled directly inside |
I will look into that tonight if I got the time. |
An attempt in here #227. |
There is already https://www.npmjs.com/package/markdown-it-include
|
@MartinMuzatko my attempt at #227 should be able to load vue templating. Yet, the partials are also being rendered. Maybe we could make it so that vuepress will ignore |
How about the convention in other template languages or SCSS where filenames with a preceding underscore are treated as partials and don't get rendered?
|
@eyleron I am not so sure about this as @yyx990803 and @ulivz haven't got time to advice on this. |
I know this is an old Issue, but it's something I would definitely use. I did want to point out that there are already several syntaxes for this in various markdown flavors. Personally, I'm used to using Mulitmarkdown's file transclusion syntax in a lot of my markdown already:
See also:
A lot of the content I'm including in VuePress sites exists as Markdown already, so the more it can mimic the behavior of other renderers, the better. |
@davemacdo There is a plan for rolling this out. In 1.0.0 |
Thanks. I missed that in my search. I'll take my comment there. |
This would be EXCELLENT! We have several "technical docs" people who want to reuse markdowns as "templates" and not learn Vue. I'm really hoping that this features is added! BTW, thanks a lot of creating Vuepress! |
@rajaraodv |
@ycmjason Awesome!! Is there any way to use it in the current version? Context: I'm showing off how cool vuepress is to folks and one question I'm getting is that the images are too small. I just a hacky solution for the time being. |
In 1.x, you can use <!-- Include content of another page -->
<Content :page-key="..."/>
<!-- markdown slot of the selected page -->
<Content slot-key="..."/> For more details, please head to: https://vuepress.vuejs.org/guide/using-vue.html#content |
@ulivz I wanted to include a markdown file from another markdown file using I came up with a working solution by kind of exposing
This solution works, however I am wondering if there is a better way to achieve this. Any recommendations appreciated. 🙇 |
Is there a better way to achieve this nowadays? For now I'm forced to do:
Cheers. |
Whats the status of this? Is it today possible to import say |
I got it working with This is how I extended markdown in my module.exports = {
.
.
.
extendsMarkdown: (md) => {
// use more markdown-it plugins!
md.use(require('markdown-it-include'))
}
} The key here is that I was using After doing this, go to the parent !!!include(./docs/your-directory/getting-started.md)!!! |
For those also brought here by Google looking for a solution to includes, @deepansh96's solution works, but don't forget to change |
This is breaking on the current version of vuepress@next. The error I'm getting this this: |
this is working for me in a "type": "module" package: import markdownItInclude from "markdown-it-include";
// ...
export default defineUserConfig({
// ...
extendsMarkdown: (md) => {
md.use(markdownItInclude);
}
}); |
Hello,
I think it would be awesome if we could have a markdown vue component that could be used in the markdown pages.
This way we could module our very long markdown into smaller sections.
Thoughts?
E.g.
The text was updated successfully, but these errors were encountered: