Skip to main content

Converter from docutils AST to Typst source

Project description

Converter from DocTree of docutils to Typst source and PDF.

Overview

rst2typst is Python project that includes docutils custom writer and frontend CLI.

I develop this for two purposes:

  • To generate PDF documentation from reStructuredText rapidly.

  • To work as core of atsphinx-typst that it is Sphinx extension to generate PDF file on Sphinx lifecycle.

I will use this and atsphinx-typst to generate documentation PDF files of my Python projects.

Benchmark

rst2typstpdf is about 53.5x faster than rst2latex+pdflatex when including the installation of TeX Live (1.7 s vs 92.3 s).

For full details, see Benchmark in the documentation.

Usage

Use CLI

You write reStructuredText source to generate for PDF using Typst. (e.g. this filename is document.rst.)

==================
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`` and ``rst2typstpdf``.

Usage
=====

Enjoy it!

You can run these command to convert to Typse code.

rst2typst document.rst document.typ

Generated document.typ has this content (actually this is not formated).

#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` and `rst2typstpdf`.

= Usage

Enjoy it!

Use as library

(TBD)

License

Apache-2.0 license. Please see LICENSE on repository.

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

rst2typst-0.5.0.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

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

rst2typst-0.5.0-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file rst2typst-0.5.0.tar.gz.

File metadata

  • Download URL: rst2typst-0.5.0.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rst2typst-0.5.0.tar.gz
Algorithm Hash digest
SHA256 a4845c1ff4cc62e356c39d22eb847ef1a7aa05f55f5877b4ad5a2459955eedf1
MD5 0c21dbb3fab53577b86d63f850e0074b
BLAKE2b-256 f18bfa22eef10b6f2a73539d078e652df1964ad08a017449bddfe029cd17c944

See more details on using hashes here.

Provenance

The following attestation bundles were made for rst2typst-0.5.0.tar.gz:

Publisher: release.yaml on atsphinx/rst2typst

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rst2typst-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: rst2typst-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 15.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rst2typst-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7d053eecd8974c256fff1d12aa69b543abe329e75e1e5c7118e4adfd5bb074b1
MD5 72b2c662136d6ab37fdfb3f8a2ed3b31
BLAKE2b-256 f8930d8545ff634710ff4034512a8ff3f526f6159986ca667e7935d4cae1ff3d

See more details on using hashes here.

Provenance

The following attestation bundles were made for rst2typst-0.5.0-py3-none-any.whl:

Publisher: release.yaml on atsphinx/rst2typst

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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