Skip to main content

Sphinx reStructuredText Builder

Sphinx extension to build reST (reStructuredText) files.

This extension is in particular useful to use in combination with the autodoc extension to automatically generate documentation for use by any rst parser (such as the GitHub wiki).

In itself, the extension is fairly straightforward – it takes the parsed reST file from Sphinx and outputs it as reST.

Requirements

  • Sphinx 2.0 or later

  • Python 3.6 or later

Installing

Using pip

pip install sphinx-rst-builder

Manual

git clone https://github.com/davidfritzsche/sphinx-rst-builder.git cd sphinx-rst-builder python setup.py install

If you want to take a look and have a try, you can put the reST builder in an extension subdirectory, and adjust sys.path to tell Sphinx where to look for it:

  • Add the extensions directory to the path in conf.py. E.g.

Usage

  • Set the builder as a extension in conf.py:

  • Run sphinx-build with target rst:

Configuration

The following four configuration variables are defined by sphinxcontrib.restbuilder:

rst_file_suffix

This is the file name suffix for generated reST files. The default is ".rst".

rst_link_suffix

Suffix for generated links to reST files. The default is whatever rst_file_suffix is set to.

rst_file_transform

Function to translate a docname to a filename. By default, returns docname + rst_file_suffix.

rst_link_transform

Function to translate a docname to a (partial) URI. By default, returns docname + rst_link_suffix.

rst_preserve_code_block_flags

Preserve (some) .. code-block:: flags if True. Default is False.

Further Reading

Feedback

The reST builder is in a preliminary state. It’s not (yet) widely used, so any feedback is particularly welcome.

Changelog

sphinx-rst-builder 0.0.3 (18. January 2020)

  • Fix changelog

sphinx-rst-builder 0.0.2 (18. January 2020)

  • Add bumpversion config to repo

  • Add new config value rst_preserve_code_black_flags to retain (some) flage to .. code-block:

  • Preserve .. code-block::. (#2)

  • Drop the overridden relative_uri() method. (#1)

sphinx-rst-builder 0.0.1 (21 June 2019)

restbuilder 0.2 (7 June 2018)

  • Code moved to https://gitub.com/sphinx-contrib/restbuilder

  • Python 3 compatible (Nicola Musatti)

  • Adhere to rst_indent-specified indentation (Matthew Planchard)

  • Fixed issue where links were converted to plaintext (Matthew Planchard)

restbuilder 0.1 (25 August 2013)

restbuilder (no version) (28 April 2012)

BSD-2-Clause License

Copyright (c) 2019 by David Fritzsche and contributors.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Contributors

Freek Dijkstra (macfreek) G. Nicholas d’Andrea (gnidan) Jeffrey Lo (jeffrey_lo) Matthew Planchard (mplanchard) Nicola Musatti (nmusatti) David Fritzsche (davidfritzsche) Fabio Bonelli (bfabio)

Metadata

Release files for sphinx-rst-builder 0.0.3

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

Source distribution (sdist)

Source distribution for sphinx-rst-builder 0.0.3
File Size Uploaded Provenance Actions
sphinx-rst-builder-0.0.3.tar.gz 14.1 kB Without provenance Details for sphinx-rst-builder-0.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sphinx-rst-builder 0.0.3
File Interpreter ABI Platform Actions
sphinx_rst_builder-0.0.3-py3-none-any.whl Python 3 none any Details for sphinx_rst_builder-0.0.3-py3-none-any.whl

Total release size: 26.5 kB

Release files / sphinx-rst-builder-0.0.3.tar.gz

Download URL sphinx-rst-builder-0.0.3.tar.gz
Size 14.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d7bd18f8f94e08b1a2267e862759358cb56bb72f0ac00d1fb81e68dbcf646011
BLAKE2b-256 checksum
How to use checksums
11a2b8feb8183f5ce77905a1dd905f9d2d0b763bc4cdef1431a68642bfeed0d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.1

Release files / sphinx_rst_builder-0.0.3-py3-none-any.whl

Download URL sphinx_rst_builder-0.0.3-py3-none-any.whl
Size 12.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
67d53c54d879b0adbf0b747b05ed09db11061f4dca4e45d721da669165e421bf
BLAKE2b-256 checksum
How to use checksums
188477c8d9edd63f9281b8d766768cf62508f9aeb78e27579dd3b73f7b281bfa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.1

Security for sphinx-rst-builder 0.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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