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

Open
ycmjason opened this Issue Apr 23, 2018 · 13 comments

Comments

Projects
None yet
7 participants
@ycmjason
Copy link
Contributor

ycmjason commented Apr 23, 2018

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.

# My very long md

This is a freaking long md...

<vp-md src="./sectionA.md"/>

<vp-md src="./sectionB.md"/>

<vp-md src="./sectionC.md"/>
@yyx990803

This comment has been minimized.

Copy link
Member

yyx990803 commented Apr 23, 2018

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 lib/webpack/markdownLoader.js.

@ycmjason

This comment has been minimized.

Copy link
Contributor

ycmjason commented Apr 23, 2018

I will look into that tonight if I got the time.

@ycmjason

This comment has been minimized.

Copy link
Contributor

ycmjason commented Apr 23, 2018

An attempt in here #227.

@MartinMuzatko

This comment has been minimized.

Copy link
Contributor

MartinMuzatko commented Apr 24, 2018

There is already https://www.npmjs.com/package/markdown-it-include
But I see a few problems with this:

  1. no vue templating within those included markdown files.
  2. partials have to be excluded from getting rendered by vuepress
@ycmjason

This comment has been minimized.

Copy link
Contributor

ycmjason commented Apr 24, 2018

@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 .partial.md files and not render them.

@eyleron

This comment has been minimized.

Copy link

eyleron commented Apr 30, 2018

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?

_layout-header.md
@ycmjason

This comment has been minimized.

Copy link
Contributor

ycmjason commented Apr 30, 2018

@eyleron I am not so sure about this as @yyx990803 and @ulivz haven't got time to advice on this.

@davemacdo

This comment has been minimized.

Copy link

davemacdo commented Jun 27, 2018

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:

# Parent Markdown Stuff

{{path/to/included.md}}

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.

@ycmjason

This comment has been minimized.

Copy link
Contributor

ycmjason commented Jun 27, 2018

@davemacdo
Please see this: #227

There is a plan for rolling this out.

#421

In 1.0.0

@davemacdo

This comment has been minimized.

Copy link

davemacdo commented Jun 27, 2018

Thanks. I missed that in my search. I'll take my comment there.

@rajaraodv

This comment has been minimized.

Copy link

rajaraodv commented Sep 10, 2018

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!

@ycmjason

This comment has been minimized.

Copy link
Contributor

ycmjason commented Sep 10, 2018

@rajaraodv
I have got an implementation already. But I will wait until Next version is available then I will make this a plugin.

@rajaraodv

This comment has been minimized.

Copy link

rajaraodv commented Sep 11, 2018

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment