vuejs / vuepress

📝 Minimalistic Vue-powered static site generator
https://vuepress.vuejs.org
MIT License
22.51k stars 4.76k forks source link

Skip template interpolation for configured markdown files #2580

Open hschaefer123 opened 4 years ago

hschaefer123 commented 4 years ago

Feature request

Be able to skip the template interpolation for configured markdown files.

What problem does this feature solve?

I am currently migrating from mkdocs and i am trying to include existing markdown files from a npm repo into my custom documentation.

Having a markdown file like this

https://www.npmjs.com/package/@sap/approuter

there are parts like

{{ENV_VAR}} and {{{ENV_VAR}}}. If there is such an environment variable it will be replaced, 
otherwise it will be just an empty string.

which leads to errors, because vuepress tries to apply vue templating!

I did not figure out any configuration option to selectively be able, to disable parsing for special files.

I even do not want to fix this inside the copied file, because i will update the docu periodically to get the latest version. Gregor and i did it the same way with mkdocs allowing to bundle multiple SAP docus at one place (see apis):

https://gregorwolf.github.io/SAP-NPM-API-collection/

Another common problem are broken image links. In such case, markdown files will not be rendered correctly. Maybe this can be controlled as a warning instead of hard error to allow quick documentations without further source processing.

What does the proposed API look like?

?

How should this be implemented in your opinion?

A glob like setting would make it easy to restrict folders and files from beeing auto processed inside config.js.

Are you willing to work on this yourself?

I am currently not an active vue developer (just using it for docu reason)!

Regards Holger

billyyyyy3320 commented 4 years ago

Unfortunately, there's no way to disable Vue syntax in VuePress.(If that's what you want)

However, IMHO, such variable or code related content should be written inside a code block:

`{{ENV_VAR}}` and `{{{ENV_VAR}}}`. If there is such an environment variable it will be replaced, 
otherwise it will be just an empty string.
hschaefer123 commented 4 years ago

Hi Billy, i know this, but i want to auto include existing markdown from other projects without any manipulation.

I just want to disable vue template parsing like markdown that is used for github.

An option for this would be great!

jemerald commented 2 years ago

Even enclosing in inline code blocks doesn't work. The following input

test `{{ blah }}`

renders image

with the following error in console image

Related issue: https://github.com/vuejs/vuepress/issues/2377