vuepress icon indicating copy to clipboard operation
vuepress copied to clipboard

Skip template interpolation for configured markdown files

Open hschaefer123 opened this issue 4 years ago • 3 comments

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

hschaefer123 avatar Aug 20 '20 13:08 hschaefer123

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.

billyyyyy3320 avatar Aug 29 '20 15:08 billyyyyy3320

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!

hschaefer123 avatar Aug 29 '20 18:08 hschaefer123

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

jemerald avatar Apr 08 '22 02:04 jemerald