Generate README files from templates. Allow input from functions calls and cli output.
Project description
readme_patcher
Generate README files from templates. Allow input from functions calls and cli output.
cd your-project
vim README_template.rst
poetry add --group dev readme-patcher
poetry shell
readme-patcher # README.rst
Global objects
py_project
{{ py_project.repository }}
github
{{ github.name }}
{{ github.full_name }}
{{ github.description }}
badge
{{ badge.pypi }}
{{ badge.github_workflow('tests' 'Tests') }}
{{ badge.readthedocs }}
Functions
cli: Combined output (stdout and stderr) of command line interfaces (scripts / binaries)
{{ cli('awk --help') }}
func: return values of Python functions
{{ func('os.getcwd') }}
read: read text files
{{ read('code/example.py') | code('python') }}
Filters
code
{{ 'print("example")' | code('python') }}
.. code-block:: python print("example")
literal
{{ func('os.getcwd') | literal }}
:: /home/repos/project
heading
{{ 'heading 1' | heading(1) }}
{{ 'heading 2' | heading(2) }}
{{ 'heading 3' | heading(3) }}
{{ 'heading 4' | heading(4) }}
heading 1 ========= heading 2 --------- heading 3 ^^^^^^^^^ heading 4 """""""""
Examples
{% for command in [
'dns-ipv6-prefix.py',
'extract-pdftext.py',
'find-dupes-by-size.py',
'list-files.py',
'mac-to-eui64.py',
'pdf-compress.py',
'image-into-pdf.py'
]
%}
``{{ command }}``
{{ cli('{} --help'.format(command)) | literal }}
{% endfor %}
Configuration
[[tool.readme_patcher.file]]
src = "README_template.rst"
dest = "README.rst"
variables = { cwd = "func:os.getcwd", fortune = "cli:fortune --help" }
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
readme_patcher-0.6.0.tar.gz
(8.2 kB
view details)
Built Distribution
File details
Details for the file readme_patcher-0.6.0.tar.gz
.
File metadata
- Download URL: readme_patcher-0.6.0.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.0b2 CPython/3.10.4 Linux/5.15.0-41-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a7d3e5e0b198a00c8c1822389b28fd3557249fba476719e0726436f628611cf3 |
|
MD5 | 6440049d665af9ff2e68a965c3d4429a |
|
BLAKE2b-256 | 4d04b5e99f7fad422577b9e38b35cba5336cd3128c2fb0ffbb8cdd18fd8e351d |
File details
Details for the file readme_patcher-0.6.0-py3-none-any.whl
.
File metadata
- Download URL: readme_patcher-0.6.0-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.0b2 CPython/3.10.4 Linux/5.15.0-41-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d20ae129925bd1656a7dda87ddc29a6ee686d642e11e2bca52877159d84c6c8f |
|
MD5 | 6fdcc69170ecaa422b2fca6ea2431ec5 |
|
BLAKE2b-256 | 8cd68debc25a27fa29940c73ba0497f3b02e287d37f02ef04b98f1a2668b4ac0 |