Skip to main content

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).

Metadata

Release files for pygments-rzk 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pygments-rzk 0.1.6
File Size Uploaded
pygments_rzk-0.1.6.tar.gz 9.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pygments-rzk 0.1.6
File Interpreter ABI Platform
pygments_rzk-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 17.9 kB

Release files / pygments_rzk-0.1.6.tar.gz

Download URL pygments_rzk-0.1.6.tar.gz
Size 9.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f4a0c4e4db782955149414d919060512728572c5888eea755c04c2289ee2600a
BLAKE2b-256 checksum
How to use checksums
41873003f8464dae748b64d05d61a34a1cf9834c6d43c4ec8f634decde51749d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / pygments_rzk-0.1.6-py3-none-any.whl

Download URL pygments_rzk-0.1.6-py3-none-any.whl
Size 8.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f1252278b2e069d2c725487bf165d5560b1270a0c7521871d8774ba7a444b59a
BLAKE2b-256 checksum
How to use checksums
742fcd8c6e4dc02b7a6e8cb71101955c44a48ea58613dea3b519447daba69d15
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page