Skip to content

Commit

Permalink
Generate README.rst and CHANGELOG.rst using the rst builder
Browse files Browse the repository at this point in the history
  • Loading branch information
davidfritzsche committed Jun 21, 2019
1 parent 1779677 commit 057759b
Show file tree
Hide file tree
Showing 4 changed files with 153 additions and 2 deletions.
43 changes: 43 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@

Changelog
*********


sphinx-rst-builder 0.0.1 (21 June 2019)
=======================================

* Renamed from sphinxcontrib.restbuilder to sphinx-rst-builder

* Code location: `https://github.com/davidfritzsche/sphinx-rst-builder <https://github.com/davidfritzsche/sphinx-rst-builder>`_


restbuilder 0.2 (7 June 2018)
=============================

* Code moved to `https://gitub.com/sphinx-contrib/restbuilder <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)
================================

* Code submitted to sphinx-contrib
`https://bitbucket.org/birkenfeld/sphinx-contrib <https://bitbucket.org/birkenfeld/sphinx-contrib>`_

* Released as sphinxcontrib-restbuilder

* Added basic documentation

* Unsupported/unknown tags are not printed, but send to log facility.


restbuilder (no version) (28 April 2012)
========================================

* First release as port of a documentation generator in the NBT package
`https://github.com/twoolie/NBT/commit/eefbd26c422a0e5f3c89e84fabcfb951a11722b0 <https://github.com/twoolie/NBT/commit/eefbd26c422a0e5f3c89e84fabcfb951a11722b0>`_
106 changes: 106 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@

Sphinx reStructuredText Builder
*******************************

`Sphinx <http://sphinx-doc.org/>`_ extension to build reST (`reStructuredText <http://docutils.sourceforge.net/rst.html>`_) 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 <http://sphinx-doc.org/>`_ and outputs it as reST.


Requirements
============

* `Sphinx <http://sphinx-doc.org/>`_ 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 <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.

..
sys.path.append(os.path.abspath(‘exts’))

Usage
=====

* Set the builder as a extension in ``conf.py``:

..
extensions = [‘sphinx_rst_builder’]
* Run sphinx-build with target ``rst``:

..
sphinx-build -b rst -c . build/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``.


Further Reading
===============

* `Sphinx <http://sphinx-doc.org/>`_

* `reStructuredText <http://docutils.sourceforge.net/rst.html>`_


Feedback
========

The reST builder is in a preliminary state. It’s not (yet) widely used, so
any feedback is particularly welcome.
4 changes: 2 additions & 2 deletions generate-readme-and-changelog.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh

sphinx-build -q -b rst -d build/readme docs/readme .
sphinx-build -q -b rst -d build/changelog docs/changelog .
sphinx-build -q -a -E -b rst -d build/readme docs/readme .
sphinx-build -q -a -E -b rst -d build/changelog docs/changelog .
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
name = sphinx-rst-builder
version = 0.0.1
description = Sphinx reStructuredText builder
long_description = file: README.rst, CHANGELOG.rst, LICENSE.rst, CONTRIBUTORS.rst
long_description_content_type = text/x-rst
license = BSD-2-Clause
license_file = LICENSE.rst
maintainer = David Fritzsche
Expand Down

0 comments on commit 057759b

Please sign in to comment.