This is for those who want to get up & running quickly.
Docutils requires Python, available from https://www.python.org/. See Dependencies below for details.
Install the latest stable release from PyPi with pip:
pip install docutils
For alternatives and details, see section Installation below.
Use the front-end scripts to convert reStructuredText documents. Try for example:
docutils FAQ.rst FAQ.html
See Usage below for details.
The purpose of the Docutils project is to provide a set of tools for processing plaintext documentation into useful formats, such as HTML, LaTeX, troff (man pages), OpenOffice, and native XML. Support for the following sources has been implemented:
Support for the following sources is planned or provided by third party tools:
To run the code, Python must be installed. (Python is pre-installed with most Linux distributions.)
The type hints added in version 0.22 use Python 3.10 syntax. However, the Python interpreter treats them as annotations unless typing.TYPE_CHECKING is set to True.
InstallationThe Python Packaging User Guide gives details how to use pip for installing.
The simplest way is to install the latest stable release from PyPi:
pip install docutils
To install a pre-relase, append the option --pre.
To install a development version from source:
Open a shell
Go to the directory containing the pyproject.toml file.
Install the package with one of the following commands:
pip install -e . # editable install pip install . # regular install
or do a "manual" install.
Optional steps:
See also the OS-specific installation instructions below and the Docutils version repository documentation.
To install for a specific Python version, use this version in the setup call, e.g.
python3.11 -m pip install docutils
If the python executable isn't on your path, you'll have to specify the complete path, such as /usr/local/bin/python3.11.
To install for different Python versions, repeat step 3 for every required version. The last installed version will be used for the docutils command line application.
Start the "docutils" command line application with:
docutils [options] [<source> [<destination>]]
The default action is to convert a reStructuredText document to HTML5, for example:
docutils test.rst test.html
Read the --help option output for details on options and arguments and Docutils Front-End Tools for the full documentation of the various tools.
For programmatic use of the docutils Python package, read the API Reference Material and the source code. Remaining questions may be answered in the Docutils Project Documentation or the Docutils-users mailing list.
Contributions are welcome!
Project Files & DirectoriesAfter unpacking and installing the Docutils package, the following shell commands will generate HTML for all included documentation:
cd <archive_directory_path> tools/buildhtml.py .
On Windows systems, type:
cd <archive_directory_path> py tools\buildhtml.py ..
The final directory name of the <archive_directory_path> is "docutils" for snapshots. For official releases, the directory may be called "docutils-X.Y.Z", where "X.Y.Z" is the release version.
Some files may generate system messages (warnings and errors). The docs/user/rst/demo.rst file (under the archive directory) contains five intentional errors. (They test the error reporting mechanism!)
Running the Test SuiteThe test suite is documented in Docutils Testing (docs/dev/testing.rst).
To run the entire test suite, open a shell and use the following commands:
cd <archive_directory_path>/test ./alltests.py
Under Windows, type:
cd <archive_directory_path>\test python alltests.py
You should see a long line of periods, one for each test, and then a summary like this:
Ran 1744 tests in 5.859s OK (skipped=1) Elapsed time: 6.235 seconds
The number of tests will grow over time, and the times reported will depend on the computer running the tests. Some test are skipped, if optional dependencies (recommendations) are missing. The difference between the two times represents the time required to set up the tests (import modules, create data structures, etc.).
A copy of the test output is written to the file alltests.out.
If any of the tests fail, please open a bug report or send an email (see Bugs). Please include all relevant output, information about your operating system, Python version, and Docutils version. To see the Docutils version, look at the test output or use
docutils --version
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4