# Pygments higlighter for Rzk
This is a simple [Pygments](https://pygments.org) higlighter for [Rzk](https://github.com/rzk-lang/rzk), which can be used with [`minted` package](https://www.ctan.org/pkg/minted) when writing rzk code in LaTeX or with [MkDocs](https://www.mkdocs.org) 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](https://pip.pypa.io/en/stable/):
```sh
git clone https://github.com/rzk-lang/pygments-rzk.git
cd pygments-rzk # enter repository root
pip install . # install using pip
```
### Use in MkDocs
To be done.
### Use in LaTeX (via `minted`)
In your LaTeX document:
1. Include `minted` package:
```tex
\package{minted}
```
2. Use `minted` environment with `rzk` language, for example:
```tex
\begin{frame}[fragile]
\frametitle{\textsc{Rzk} highlighting in LaTeX with \texttt{minted}}
A basic example:
\tiny
\begin{minted}[linenos,frame=leftline,mathescape]{rzk}
#lang rzk-1
#section path-algebra
#variable A : U
#variables x y z : A
-- path reversal
#define rev uses (A x y)
(p : x = y) -- A path from x to y in A.
: y = x -- The reversal will be defined by path induction on p.
:= idJ(A, x, \y' p' -> y' = x, refl, y, p)
-- path composition by induction on the second path
#define concat
(p : x = y) -- A path from x to y in A.
(q : y = z) -- A path from y to z in A.
: (x = z)
:= idJ(A, y, \z' q' -> (x = z'), p, z, q)
#end path-algebra
\end{minted}
\end{frame}
```
![Rendering rzk code in LaTeX (demo).](images/latex-highlighting-demo.png)
Raw data
{
"_id": null,
"home_page": "https://github.com/rzk-lang/pygments-rzk",
"name": "pygments-rzk",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "pygments rzk lexer",
"author": "Nikolai Kudasov",
"author_email": "nickolay.kudasov@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/e7/71/291f27e418b8cbd20c859282c45967882786ea90710db90573feb22723ce/pygments-rzk-0.1.3.tar.gz",
"platform": null,
"description": "# Pygments higlighter for Rzk\n\nThis is a simple [Pygments](https://pygments.org) higlighter for [Rzk](https://github.com/rzk-lang/rzk), which can be used with [`minted` package](https://www.ctan.org/pkg/minted) when writing rzk code in LaTeX or with [MkDocs](https://www.mkdocs.org) to highlight code in blocks when rendering literate Rzk Markdown files.\n\n## How to use\n\n### Install\n\nClone this repository, and install the highlighter using [`pip` installer](https://pip.pypa.io/en/stable/):\n\n```sh\ngit clone https://github.com/rzk-lang/pygments-rzk.git\ncd pygments-rzk # enter repository root\npip install . # install using pip\n```\n\n### Use in MkDocs\n\nTo be done.\n\n### Use in LaTeX (via `minted`)\n\nIn your LaTeX document:\n\n1. Include `minted` package:\n\n```tex\n\\package{minted}\n```\n\n2. Use `minted` environment with `rzk` language, for example:\n\n```tex\n\\begin{frame}[fragile]\n \\frametitle{\\textsc{Rzk} highlighting in LaTeX with \\texttt{minted}}\n\nA basic example:\n\n\\tiny\n\\begin{minted}[linenos,frame=leftline,mathescape]{rzk}\n#lang rzk-1\n\n#section path-algebra\n\n#variable A : U\n#variables x y z : A\n\n-- path reversal\n#define rev uses (A x y)\n (p : x = y) -- A path from x to y in A.\n : y = x -- The reversal will be defined by path induction on p.\n := idJ(A, x, \\y' p' -> y' = x, refl, y, p)\n\n-- path composition by induction on the second path\n#define concat\n (p : x = y) -- A path from x to y in A.\n (q : y = z) -- A path from y to z in A.\n : (x = z)\n := idJ(A, y, \\z' q' -> (x = z'), p, z, q)\n\n#end path-algebra\n\\end{minted}\n\n\\end{frame}\n```\n\n![Rendering rzk code in LaTeX (demo).](images/latex-highlighting-demo.png)\n",
"bugtrack_url": null,
"license": "BSD 3",
"summary": "Pygments lexer for Rzk language (of proof assistant for synthetic \u221e-categories).",
"version": "0.1.3",
"project_urls": {
"Homepage": "https://github.com/rzk-lang/pygments-rzk"
},
"split_keywords": [
"pygments",
"rzk",
"lexer"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6ae2709129d6f424b32a5d04b288a06d9e4fa3ef73920b32f8baf51f727578de",
"md5": "47dd42e3b935b92c69c4eb66c16a17f7",
"sha256": "f10b24fd5bef1fe814d7732ef592dbc1802d45967fc47254f01f2ae61fca4933"
},
"downloads": -1,
"filename": "pygments_rzk-0.1.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "47dd42e3b935b92c69c4eb66c16a17f7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 4580,
"upload_time": "2023-07-10T21:57:30",
"upload_time_iso_8601": "2023-07-10T21:57:30.462875Z",
"url": "https://files.pythonhosted.org/packages/6a/e2/709129d6f424b32a5d04b288a06d9e4fa3ef73920b32f8baf51f727578de/pygments_rzk-0.1.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e771291f27e418b8cbd20c859282c45967882786ea90710db90573feb22723ce",
"md5": "7aac21149642b8f5fadef15668f6c2b0",
"sha256": "13391cb320e3cefc9b54e1fb5ccf11fc8f825cda90ed9f1526b1722442a3895d"
},
"downloads": -1,
"filename": "pygments-rzk-0.1.3.tar.gz",
"has_sig": false,
"md5_digest": "7aac21149642b8f5fadef15668f6c2b0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 322555,
"upload_time": "2023-07-10T21:57:31",
"upload_time_iso_8601": "2023-07-10T21:57:31.998894Z",
"url": "https://files.pythonhosted.org/packages/e7/71/291f27e418b8cbd20c859282c45967882786ea90710db90573feb22723ce/pygments-rzk-0.1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-07-10 21:57:31",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "rzk-lang",
"github_project": "pygments-rzk",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "pygments-rzk"
}