Skip to main content

Pygments lexer for Rzk language (of proof assistant for synthetic ∞-categories).

Project description

Pygments higlighter for Rzk

This is a simple Pygments higlighter for Rzk, which can be used with minted package when writing rzk code in LaTeX or with MkDocs to highlight code in blocks when rendering literate Rzk Markdown files.

How to use

Install

Clone this repository, and install the highlighter using pip installer:

git clone https://github.com/rzk-lang/pygments-rzk.git
cd pygments-rzk   # enter repository root
pip install .     # install using pip

Use in MkDocs

Once pygments-rzk is installed in the same Python environment as MkDocs, Pygments will recognise rzk fenced code blocks automatically. The only thing your MkDocs project needs is a Markdown extension that routes code blocks through Pygments — the built-in codehilite extension is enough:

# mkdocs.yml
site_name: My Rzk docs

markdown_extensions:
  - codehilite

Then write Rzk in fenced blocks tagged rzk (see demo/mkdocs/docs/index.md for a full example):

```rzk
#lang rzk-1
...
```

A runnable demo lives in demo/mkdocs/cd demo/mkdocs && mkdocs serve.

Rendering rzk code in MkDocs (demo).

Use in Command Line (Terminal)

You can simply pass text to pygmentize -l rzk, e.g.:

cat demo/demo.rzk | pygmentize -l rzk

Rendering rzk code in the command line (demo).

Use in LaTeX (via minted)

In your LaTeX document:

  1. Include minted package:
\package{minted}
  1. Use minted environment with rzk language, for example (see demo/demo.tex for full example):
\begin{minted}[linenos,frame=leftline,mathescape]{rzk}
...
\end{minted}

Rendering rzk code in LaTeX (demo).

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

pygments_rzk-0.1.6.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pygments_rzk-0.1.6-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file pygments_rzk-0.1.6.tar.gz.

File metadata

  • Download URL: pygments_rzk-0.1.6.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for pygments_rzk-0.1.6.tar.gz
Algorithm Hash digest
SHA256 f4a0c4e4db782955149414d919060512728572c5888eea755c04c2289ee2600a
MD5 e642ed845500ea5853e0e9d8fc8ead58
BLAKE2b-256 41873003f8464dae748b64d05d61a34a1cf9834c6d43c4ec8f634decde51749d

See more details on using hashes here.

File details

Details for the file pygments_rzk-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: pygments_rzk-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for pygments_rzk-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 f1252278b2e069d2c725487bf165d5560b1270a0c7521871d8774ba7a444b59a
MD5 064ea14dfe2dacb61d5f8ea1ffc6b4f1
BLAKE2b-256 742fcd8c6e4dc02b7a6e8cb71101955c44a48ea58613dea3b519447daba69d15

See more details on using hashes here.

Supported by

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