Skip to main content

A Vue lexer for Pygments

Project description

vue-lexer

Build Status

PyPI version

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.4.tar.gz (2.9 kB view details)

Uploaded Source

File details

Details for the file vue-lexer-0.0.4.tar.gz.

File metadata

  • Download URL: vue-lexer-0.0.4.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.4

File hashes

Hashes for vue-lexer-0.0.4.tar.gz
Algorithm Hash digest
SHA256 6046623116bca2e25919225ba3e7fb2009a9d6cfadb905af9792859da8f9da62
MD5 1948d35effdcd13d43e59dfddac0189d
BLAKE2b-256 7ef34c18d5594879158e7e00418ad58d528453785906ce24911f9ffaa210398f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page