handlebars-lang / docs

Documentation for handlebars.js and the handlebars-language
https://handlebarsjs.com
MIT License
36 stars 47 forks source link

Usage snippet in installation/precompilation is broken #124

Closed scriptype closed 1 year ago

scriptype commented 1 year ago

The snippet is empty as can be seen here (https://handlebarsjs.com/installation/precompilation.html#usage):

image

I did some tracing and found the corresponding part in the md:

https://github.com/handlebars-lang/docs/blob/2178bc5de5e0208c84ca01c126865d458708aa1f/src/installation/precompilation.md?plain=1#L47

Which seems to be a custom syntax extension to VuePress' markdown, handled by this plugin here:

https://github.com/handlebars-lang/docs/blob/2178bc5de5e0208c84ca01c126865d458708aa1f/src/.vuepress/plugins/update-handlebars-cli-help.js#L5

But the above part seems to be authored quite some time ago. So, I suspect that one or more of these things might have changed since https://github.com/handlebars-lang/docs/commit/30f68847d88ea0c7f01995565ea3684da47aea01 and gone unnoticed:

Or maybe something else. But I'm not familiar with VuePress or tapping into md parsers, so I just wanted to report the issue and my contemplation on it ¯\(ツ)/¯ Hope this helps!

scriptype commented 1 year ago

It looks like this is caused by using the stderr instead of stdout when the handlebars bin is run:

https://github.com/handlebars-lang/docs/blob/2178bc5de5e0208c84ca01c126865d458708aa1f/src/.vuepress/plugins/update-handlebars-cli-help.js#L39

stderr is empty, so an empty string is printed.

jaylinski commented 1 year ago

Thanks for the debugging, I opened a PR to fix the issue.