Skip to main content

Pygments plugin for CindyScript

Project description

PyPi version badge Supported Python versions

Pygments plugin for the CindyScript language used by Cinderella and CindyJS. It can be used to nicely format CindyScript as HTML or in other formats.

Installation

In theory, all you need to do is install Pygments and this package here:

pip install CindyScriptPygments

This will install the latest release of each of these packages. If you don’t want to install the package system-wide, pip offers alternatives like the --user flag for a per-user installation. See pip install --help for details. In that case, you may have to perform additional steps in order to ensure that the pygmentize command line utility is available on the PATH, at least if the Pygments dependency isn’t already installed globally.

Usage

This plugin registers a Pygments lexer for a language named CindyScript, associated with the MIME type text/x-cindyscript. You can use it from the command line like this:

pygmentize -l cindyscript sourcecode.cs

To generate specific file formats, use commands like these:

pygmentize -f html -O full -l cindyscript -o sourcecode.html sourcecode.cs
pygmentize -f tex -O full -l cindyscript -o sourcecode.tex sourcecode.cs
pygmentize -f svg -O full -l cindyscript -o sourcecode.svg sourcecode.cs

The file extension *.cs is not associated with the plugin, since that’s already taken by C# a.k.a. csharp. Most often, CindyScript code is not contained in a file of its own, but instead embedded into a *.cdy file for Cinderella, or a HTML page for CindyJS. For the latter case, you can format the whole document using

pygmentize -l CindyJS-HTML sourcecode.html

This runs the HTML highlighter on the document, which in turn delegates to the JavaScript and CSS highlighters. But script blocks with the attribute type="text/x-cindyscript" are handled by the CindyScript lexer.

There exist several packages which make use of Pygments for syntax highlighting. Notable examples include the minted package for LaTeX or the pygmentize-bundled package for Node.js.

Compatibility

The package aims to be compatible with both Python 2.7 and Python 3. It won’t support Python 3.0 through 3.2 out of the box, since it relies on Unicode literals as introduced by PEP 414 for Python 3.3. The 2to3 fixer might be able to make the code work with those versions of Python.

Contrary to the current implementation of Pygments’ built-in parsers, this package supports unicode symbols outside the basic multilingual plane even on narrow (UTF-16) builds of Python 2.7.

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

CindyScriptPygments-0.2.0.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

CindyScriptPygments-0.2.0-py2.py3-none-any.whl (9.3 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file CindyScriptPygments-0.2.0.tar.gz.

File metadata

File hashes

Hashes for CindyScriptPygments-0.2.0.tar.gz
Algorithm Hash digest
SHA256 bffaa8dd292809366860a81abf4ad3a8d1b9c73388025039a05ffc2a3e97ac1d
MD5 4f6dbd7a3c66e1ccc9cbe48cb8b11555
BLAKE2b-256 50c52875545706579a772e9afa56d9de5af8159ee32a05a34c5d91dac8303884

See more details on using hashes here.

File details

Details for the file CindyScriptPygments-0.2.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for CindyScriptPygments-0.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 183b010d99695b4fb5b5a400eb01316d683332429ab439e617b2e1ec784a8bc4
MD5 71e0bc7ac40c05063646778dc0e60de1
BLAKE2b-256 0bade446da34b52562ec8c99f67793d7cdc9810a73d901ae212c30378aafbb92

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