Skip to content

Commit

Permalink
feat($theme-default): support shortcut for sh and yml. (close: #1221)
Browse files Browse the repository at this point in the history
Also, support lang tip for docker, dockerfile and makefile
  • Loading branch information
ulivz committed Jan 24, 2019
1 parent 635e93b commit fc5dba8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/@vuepress/core/lib/app/style/config.styl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ $MQMobileNarrow = 419px

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

@import '~@temp/palette.styl'
6 changes: 6 additions & 0 deletions packages/@vuepress/markdown/lib/highlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ module.exports = (str, lang) => {
if (lang === 'py') {
lang = 'python'
}
if (lang === 'sh') {
lang = 'bash'
}
if (lang === 'yml') {
lang = 'yaml'
}
if (!prism.languages[lang]) {
try {
loadLanguages([lang])
Expand Down

0 comments on commit fc5dba8

Please sign in to comment.