Getting started¶
Installation¶
This is published on PyPI. You can install it by using pip or your package manager.
pip install rst2typst
uv add rst2typst
If you want to install latest sources that is not published, please get from GitHub.
Write your document¶
Please write reStructuredText into local file.
(e.g. The file name is document.rst in this page)
==================
rst2typst document
==================
Overview
========
We like reStructuredText!
It is an one of great docutils.
* This has custom writer of docutils.
* This has CLI endpoint named ``rst2typst``.
Usage
=====
Enjoy it!
Note
This document has title, sections, paragraph, and list.
Important
This is library for docutils, not Sphinx.
So it can’t work for directives only for Sphinx even if you want to use.
(e.g. seealso directive)
Convert to Typst code¶
Run installed command rst2typst with arguments that is your document.
In default, it generates Typst code into STDOUT.
$ rst2typst document.rst
#title([rst2typst document])
= Overview
We like reStructuredText!
It is an one of great docutils.
- This has custom writer of docutils.
- This has CLI endpoint named `rst2typst`.
= Usage
Enjoy it!
Note
This code is formatted for example. Actually, it is not cleared Typst code.
If you want to save into filesystem, append positional argument.
$ rst2typst document.rst document.typ
Generate PDF¶
You can run rst2typstpdf to generate PDF from reStructuredText directly.
Tip
Please install this with pdf extra option.
$ rst2typstpdf document.rst document.pdf
To know more information, please see Command line tools.