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.3.tar.gz
(2.9 kB
view hashes)
Built Distribution
Close
Hashes for vue_lexer-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47d6d60237a365ccc1cdc9e6850d444d4f846f908ed3700780188aa2b6065fed |
|
MD5 | bdfdcf0ce4c64cc4bde7b7783fdbfbf3 |
|
BLAKE2b-256 | 4f7cade85ac5ee6339b4d2ca0a9f10aedf4ecea58ffd67dcc7fc29050da6e585 |