Skip to content

Commit

Permalink
Add man page
Browse files Browse the repository at this point in the history
  • Loading branch information
claui committed Jun 18, 2024
1 parent 40c006d commit 8dd8cc2
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,6 @@ jobs:

- name: Run unit tests
run: poetry run poe tests

- name: Run man page generator
run: poetry run poe doc
10 changes: 8 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,18 @@ act

### Generating project documentation

To generate project documentation and open it in your browser, run:
To generate project documentation, run:

```
```sh
poetry run poe doc
```

To open the generated documentation with `man`, run:

```sh
poetry run poe man
```

## Maintenance

### Refreshing dependencies
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# pyproject-patcher

This package is an attempt to make it a little easier to patch
`pyproject.toml` in place.
This Python package is an attempt to make it a little easier to
patch `pyproject.toml` in place.

It is mainly useful for maintainers of system packages.
If you’re not a maintainer of system packages, or if you don’t know
Expand Down
13 changes: 13 additions & 0 deletions USAGE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
<!-- markdownlint-configure-file { "MD041": { "level": 1 } } -->

# Description

This Python package is an attempt to make it a little easier to
patch `pyproject.toml` in place.

It is mainly useful for maintainers of system packages.
If you’re not a maintainer of system packages, or if you don’t know
what that means, then `pyproject-patcher` is probably not for you.

# Examples

## Recommended import statement

The following examples all assume the following import statement:

```py
from pyproject_patcher import patch_in_place
```
Expand Down
37 changes: 37 additions & 0 deletions doc/sphinx/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'pyproject-patcher'
author = 'Claudia Pellegrino <clau@tiqua.de>'
description = 'Collection of convenience functions to patch `pyproject.toml` in place'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = [
'myst_parser',
'sphinx.ext.autodoc',
'sphinx.ext.napoleon',
]

myst_enable_extensions = [
'deflist',
]

templates_path = []
exclude_patterns = []

# Man page output

man_pages = [(
'index',
project.lower(),
description,
[author],
3,
)]
9 changes: 9 additions & 0 deletions doc/sphinx/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Welcome to pyproject-patcher's documentation!
=============================================

.. toctree::
:maxdepth: 2
:caption: Contents:

.. include:: ../../USAGE.md
:parser: myst_parser.sphinx_
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ html.cmd = "pdoc pyproject_patcher !pyproject_patcher.settings"
html.help = "Browse HTML documentation"
linter.cmd = "pylint --enable-all-extensions pyproject_patcher"
linter.help = "Check for style violations"
man.cmd = "man build/man/pyproject-patcher.3"
man.help = "Open manual page"
tests.cmd = "pytest"
tests.help = "Run test suite"
typecheck.cmd = "mypy"
Expand Down

0 comments on commit 8dd8cc2

Please sign in to comment.