俾格米人视觉列表
vue-lexer的Python项目详细描述
Vue Lexer
用于Pygments(基于jsx-lexer)的vue lexer
安装
$ pip install vue-lexer
与狮身人面像一起使用
要在sphinx中使用,只需为您的code-block
指定vue
:
.. code-block:: vue
<template>
<p>{{ greeting }} World!</p>
</template>
<script>
module.exports = {
data: function () {
return {
greeting: 'Hello'
}
}
}
</script>
<style scoped>
p {
font-size: 2em;
text-align: center;
}
</style>
与mkdocs一起使用
首先,您需要为突出显示创建css:
$ pygmentize -S default -f html -a .codehilite > code/pygments.css
然后,将以下内容添加到您的mkdocs.yml
:
markdown_extensions:-codehiliteextra_css:[pygments.css]
现在,您可以在代码块中使用vue
:
```vue
<template>
<p>{{ greeting }} World!</p>
</template>
<script>
module.exports = {
data: function () {
return {
greeting: 'Hello'
}
}
}
</script>
<style scoped>
p {
font-size: 2em;
text-align: center;
}
</style>
```
示例
示例1:
例2:
例3: