A Vue lexer for Pygments
Project description
vue-lexer
A Vue lexer for Pygments (based on jsx-lexer)
Installation
$ pip install vue-lexer
Usage with Sphinx
To use within Sphinx, simply specify vue
for your code-block
:
.. 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>
Usage with mkdocs
First, you need to create the CSS for the highlighting:
$ pygmentize -S default -f html -a .codehilite > code/pygments.css
Then, add the following to your mkdocs.yml
:
markdown_extensions:
- codehilite
extra_css: [pygments.css]
Now, you can use vue
in your code blocks:
```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>
```
Examples
Example 1:
Example 2:
Example 3:
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
vue-lexer-0.0.2.tar.gz
(2.8 kB
view hashes)
Built Distribution
Close
Hashes for vue_lexer-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6445d967c817035e5b6b7c2991d168db7e8e1e77eacee9e6365a6fd046fd1ff7 |
|
MD5 | 6eb0e74fcfb969c8c77e9359a0437a22 |
|
BLAKE2b-256 | 0358ec5f76d80f72bd7d0cab6fd4cbef668dfe16346da3452e5eb2483f768064 |