Skip to content

Commit fc5dba8

Browse files
committed
feat($theme-default): support shortcut for sh and yml. (close: #1221)
Also, support lang tip for docker, dockerfile and makefile
1 parent 635e93b commit fc5dba8

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

packages/@vuepress/core/lib/app/style/config.styl

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ $MQMobileNarrow = 419px
1717

1818
// code
1919
$lineNumbersWrapperWidth = 3.5rem
20-
$codeLang = js ts html md vue css sass scss less stylus go java c sh yaml py
20+
$codeLang = js ts html md vue css sass scss less stylus go java c sh yaml py docker dockerfile makefile
2121

2222
@import '~@temp/palette.styl'

packages/@vuepress/markdown/lib/highlight.js

+6
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ module.exports = (str, lang) => {
3030
if (lang === 'py') {
3131
lang = 'python'
3232
}
33+
if (lang === 'sh') {
34+
lang = 'bash'
35+
}
36+
if (lang === 'yml') {
37+
lang = 'yaml'
38+
}
3339
if (!prism.languages[lang]) {
3440
try {
3541
loadLanguages([lang])

0 commit comments

Comments
 (0)