Skip to main content

A simple Python API for generating RestructuredText.

Project description

cd codecov PyPI version pre-commit black Documentation Status

RstCloth

reStructuredText is a powerful human-centric markup language that is well defined, flexible, with powerful tools that make writing and maintaining text easy and pleasurable. Humans can edit reStructuredText without the aide of complex editing tools, and the resulting source is easy to manipulate and process.

As an alternative and a supplement, RstCloth is a Python API for writing well formed reStructuredText programatically.

Find the project documentation here

Developer notes

Repo is based on thclark/python-library-template:

  • vscode .devcontainer
  • black style
  • sphinx docs with some examples and automatic build
  • pre-commit hooks
  • tox tests
  • github actions ci + cd
  • code coverage

Using VSCode

Check out the repo and use the remote .devcontainer to start developing, with everything installed out of the box.

In other IDEs

Use poetry --extras docs to install the project and get started. You also You need to install pre-commit to get the hooks working. Do:

pip install pre-commit
pre-commit install && pre-commit install -t commit-msg

Once that's done, each time you make a commit, a wide range of checks are made and the project file formats are applied.

Upon failure, the commit will halt. Re-running the commit will automatically fix most issues except:

  • The flake8 checks... hopefully over time Black (which fixes most things automatically already) will negate need for it.
  • You'll have to fix documentation yourself prior to a successful commit (there's no auto fix for that!!).

You can run pre-commit hooks without making a commit, too, like:

pre-commit run black --all-files

or

# -v gives verbose output, useful for figuring out why docs won't build
pre-commit run build-docs -v

Contributing

  • Please raise an issue on the board (or add your $0.02 to an existing issue) so the maintainers know what's happening and can advise / steer you.

  • Create a fork of rstcloth, undertake your changes on a new branch, (see .pre-commit-config.yaml for branch naming conventions).

  • To make life easy for us, use our conventional commits pattern (if you've got pre-commit installed correctly, it'll guide you on your first commit) to make your commits (if not, we'll try to preserve your history, but might have to squashmerge which would lose your contribution history)

  • Adopt a Test Driven Development approach to implementing new features or fixing bugs.

  • Ask the rstcloth maintainers where to make your pull request. We'll create a version branch, according to the roadmap, into which you can make your PR. We'll help review the changes and improve the PR.

  • Once checks have passed, test coverage of the new code is >=95%, documentation is updated and the Review is passed, we'll merge into the version branch.

Release process

Releases are automated using conventional-commits and GitHub Actions.

Documents

Building documents automatically

In the VSCode .devcontainer, the RestructuredText extension should build the docs live for you (right click the .rst file and hit "Open Preview").

On each commit, the documentation will build automatically in a pre-configured environment. The way pre-commit works, you won't be allowed to make the commit unless the documentation builds, this way we avoid getting broken documentation pushed to the main repository on any commit sha, so we can rely on builds working.

Building documents manually

If you did need to build the documentation

Install doxgen. On a mac, that's brew install doxygen; other systems may differ.

Install sphinx and other requirements for building the docs:

poetry install --extras docs

Run the build process:

sphinx-build -b html docs/source docs/build

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

rstcloth-0.5.6.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

rstcloth-0.5.6-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file rstcloth-0.5.6.tar.gz.

File metadata

  • Download URL: rstcloth-0.5.6.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.9.16 Linux/6.2.0-1016-azure

File hashes

Hashes for rstcloth-0.5.6.tar.gz
Algorithm Hash digest
SHA256 d2cdc6f43fc55540880cf03f35ee69b47a03b32af8a585ae800bf191f668c4b7
MD5 6504b274544016937a4bcff1b0dd2807
BLAKE2b-256 01b91b45c858315866fe8a91e5c325bd79c738f0a2aa5f739207547defdff1ab

See more details on using hashes here.

File details

Details for the file rstcloth-0.5.6-py3-none-any.whl.

File metadata

  • Download URL: rstcloth-0.5.6-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.9.16 Linux/6.2.0-1016-azure

File hashes

Hashes for rstcloth-0.5.6-py3-none-any.whl
Algorithm Hash digest
SHA256 c99fe838ab5370f71aa8bc6940fb07ef5f16ca9a630184edac120d5babd76568
MD5 84c46af3a3f582a989391e67ea5559e3
BLAKE2b-256 504476814c465eb5a57e4e32a12f31182abb8c8a487c2a37ca9edb88865cc61a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page