Codeblock style #2057
Replies: 2 comments
-
Did I miss this? 😓 Sorry... openhab-docs/.vuepress/config.js Line 35 in 1f34da8 With this it will automatically detect keywords in the code and set the appropriate language - including 2 custom languages, dsl and rules; it will also perform some mappings and translations for languages encountered in the docs which are not in highlight.js (or called differently). There should however be a method to bypass those heuristics and force a language (maybe with a '!' suffix). |
Beta Was this translation helpful? Give feedback.
-
Interesting but seems a bit hacky. The primary decision should stay with the author of an article. I remember investing an awful amount of time tuning all code blocks but the rules as shown by @Confectrician still had their problems some times. Whatever you come up with, I'd suggest to not change the Markdown code language part because both the GitHub editor and Desktop editors are able to syntax highlight those accordingly. Would be a shame to loose that feature. Jm2c |
Beta Was this translation helpful? Give feedback.
-
Hey @ghys
We agreed on the following styles for codeblocks in the past:
Code fences are done this way:
things -> java/perl (some syntaxes break the editor colors)
items/rules -> java
rules -> javascript (better sometimes)
sitemaps -> perl
everything else -> text
bash/shell -> shell
Can you point me to a doc or something that explains codeblocks in vuepress and if we should handle them different.
In my view it would be nice to be able to keep them this way.
Beta Was this translation helpful? Give feedback.
All reactions