readwright 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- readwright-0.3.0/.github/workflows/ci.yml +22 -0
- readwright-0.3.0/.github/workflows/release.yml +41 -0
- readwright-0.3.0/.gitignore +219 -0
- readwright-0.3.0/.pre-commit-config.yaml +34 -0
- readwright-0.3.0/.pre-commit-hooks.yaml +14 -0
- readwright-0.3.0/.python-version +1 -0
- readwright-0.3.0/LICENSE +21 -0
- readwright-0.3.0/PKG-INFO +188 -0
- readwright-0.3.0/README.md +162 -0
- readwright-0.3.0/README.md.j2 +137 -0
- readwright-0.3.0/action.yml +31 -0
- readwright-0.3.0/examples/README.md +15 -0
- readwright-0.3.0/examples/config-only/README.md +52 -0
- readwright-0.3.0/examples/config-only/docs/screenshots/CREDITS.md +5 -0
- readwright-0.3.0/examples/config-only/docs/screenshots/captions.yaml +2 -0
- readwright-0.3.0/examples/config-only/docs/screenshots/dashboard.jpg +0 -0
- readwright-0.3.0/examples/config-only/docs/screenshots/editor-dark.jpg +0 -0
- readwright-0.3.0/examples/config-only/docs/screenshots/editor-light.jpg +0 -0
- readwright-0.3.0/examples/config-only/pyproject.toml +7 -0
- readwright-0.3.0/examples/config-only/readme.yaml +78 -0
- readwright-0.3.0/examples/flow-plugin/README.md +26 -0
- readwright-0.3.0/examples/flow-plugin/README.md.j2 +7 -0
- readwright-0.3.0/examples/flow-plugin/plugin.json +1 -0
- readwright-0.3.0/examples/flow-plugin/readme.yaml +2 -0
- readwright-0.3.0/examples/ha-card/README.md +34 -0
- readwright-0.3.0/examples/ha-card/README.md.j2 +23 -0
- readwright-0.3.0/examples/ha-card/docs/example.yaml +2 -0
- readwright-0.3.0/examples/ha-card/hacs.json +1 -0
- readwright-0.3.0/examples/ha-card/package.json +1 -0
- readwright-0.3.0/examples/ha-card/readme.yaml +2 -0
- readwright-0.3.0/examples/kitchen-sink/.all-contributorsrc +1 -0
- readwright-0.3.0/examples/kitchen-sink/.env.example +5 -0
- readwright-0.3.0/examples/kitchen-sink/CHANGELOG.md +12 -0
- readwright-0.3.0/examples/kitchen-sink/LICENSE +1 -0
- readwright-0.3.0/examples/kitchen-sink/README.md +171 -0
- readwright-0.3.0/examples/kitchen-sink/README.md.j2 +75 -0
- readwright-0.3.0/examples/kitchen-sink/demo_tool/__init__.py +0 -0
- readwright-0.3.0/examples/kitchen-sink/demo_tool/cli.py +18 -0
- readwright-0.3.0/examples/kitchen-sink/docs/logo.svg +1 -0
- readwright-0.3.0/examples/kitchen-sink/docs/screenshots/CREDITS.md +6 -0
- readwright-0.3.0/examples/kitchen-sink/docs/screenshots/captions.yaml +2 -0
- readwright-0.3.0/examples/kitchen-sink/docs/screenshots/main.jpg +0 -0
- readwright-0.3.0/examples/kitchen-sink/docs/screenshots/mobile/captions.yaml +1 -0
- readwright-0.3.0/examples/kitchen-sink/docs/screenshots/mobile/phone.jpg +0 -0
- readwright-0.3.0/examples/kitchen-sink/docs/screenshots/settings-dark.jpg +0 -0
- readwright-0.3.0/examples/kitchen-sink/docs/screenshots/settings-light.jpg +0 -0
- readwright-0.3.0/examples/kitchen-sink/docs/usage.md +5 -0
- readwright-0.3.0/examples/kitchen-sink/pyproject.toml +20 -0
- readwright-0.3.0/examples/kitchen-sink/readme.yaml +26 -0
- readwright-0.3.0/examples/kitchen-sink/templates/partials/contributing.md.j2 +4 -0
- readwright-0.3.0/examples/minecraft-mod/README.md +32 -0
- readwright-0.3.0/examples/minecraft-mod/README.md.j2 +9 -0
- readwright-0.3.0/examples/minecraft-mod/build.gradle +1 -0
- readwright-0.3.0/examples/minecraft-mod/gradle.properties +6 -0
- readwright-0.3.0/examples/minecraft-mod/readme.yaml +10 -0
- readwright-0.3.0/examples/minecraft-mod/src/main/resources/META-INF/neoforge.mods.toml +8 -0
- readwright-0.3.0/pyproject.toml +62 -0
- readwright-0.3.0/readme.yaml +6 -0
- readwright-0.3.0/src/readwright/__init__.py +8 -0
- readwright-0.3.0/src/readwright/badges.py +323 -0
- readwright-0.3.0/src/readwright/changelog.py +46 -0
- readwright-0.3.0/src/readwright/cli.py +397 -0
- readwright-0.3.0/src/readwright/config.py +230 -0
- readwright-0.3.0/src/readwright/helpers.py +494 -0
- readwright-0.3.0/src/readwright/images.py +217 -0
- readwright-0.3.0/src/readwright/metadata.py +292 -0
- readwright-0.3.0/src/readwright/py.typed +0 -0
- readwright-0.3.0/src/readwright/renderer.py +183 -0
- readwright-0.3.0/src/readwright/templates/base.md.j2 +21 -0
- readwright-0.3.0/src/readwright/templates/partials/badges.md.j2 +1 -0
- readwright-0.3.0/src/readwright/templates/partials/contributing.md.j2 +7 -0
- readwright-0.3.0/src/readwright/templates/partials/donate.md.j2 +1 -0
- readwright-0.3.0/src/readwright/templates/partials/header.md.j2 +10 -0
- readwright-0.3.0/src/readwright/templates/partials/install.md.j2 +46 -0
- readwright-0.3.0/src/readwright/templates/partials/license.md.j2 +5 -0
- readwright-0.3.0/src/readwright/templates/partials/screenshots.md.j2 +5 -0
- readwright-0.3.0/src/readwright/templates/partials/usage.md.j2 +5 -0
- readwright-0.3.0/src/readwright/toc.py +60 -0
- readwright-0.3.0/tests/conftest.py +45 -0
- readwright-0.3.0/tests/golden/base.md +38 -0
- readwright-0.3.0/tests/test_badges.py +211 -0
- readwright-0.3.0/tests/test_changelog.py +34 -0
- readwright-0.3.0/tests/test_cli.py +210 -0
- readwright-0.3.0/tests/test_config.py +149 -0
- readwright-0.3.0/tests/test_examples.py +73 -0
- readwright-0.3.0/tests/test_helpers.py +265 -0
- readwright-0.3.0/tests/test_images.py +158 -0
- readwright-0.3.0/tests/test_metadata.py +138 -0
- readwright-0.3.0/tests/test_renderer.py +226 -0
- readwright-0.3.0/tests/test_toc.py +40 -0
- readwright-0.3.0/tox.ini +15 -0
- readwright-0.3.0/uv.lock +957 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches: [main]
|
|
5
|
+
pull_request:
|
|
6
|
+
jobs:
|
|
7
|
+
test:
|
|
8
|
+
runs-on: ${{ matrix.os }}
|
|
9
|
+
strategy:
|
|
10
|
+
matrix:
|
|
11
|
+
os: [ubuntu-latest, windows-latest]
|
|
12
|
+
python: ["3.11", "3.12", "3.13"]
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
- uses: astral-sh/setup-uv@v5
|
|
16
|
+
with:
|
|
17
|
+
python-version: ${{ matrix.python }}
|
|
18
|
+
- run: uv sync --group dev
|
|
19
|
+
- run: uv run ruff check src tests
|
|
20
|
+
- run: uv run ruff format --check src tests
|
|
21
|
+
- run: uv run pytest
|
|
22
|
+
- run: uv run readwright check
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
tags: ["v*"]
|
|
5
|
+
jobs:
|
|
6
|
+
build:
|
|
7
|
+
runs-on: ubuntu-latest
|
|
8
|
+
steps:
|
|
9
|
+
- uses: actions/checkout@v4
|
|
10
|
+
- uses: astral-sh/setup-uv@v5
|
|
11
|
+
- run: uv build
|
|
12
|
+
- uses: actions/upload-artifact@v4
|
|
13
|
+
with:
|
|
14
|
+
name: dist
|
|
15
|
+
path: dist/
|
|
16
|
+
pypi:
|
|
17
|
+
needs: build
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
environment: pypi
|
|
20
|
+
permissions:
|
|
21
|
+
id-token: write
|
|
22
|
+
steps:
|
|
23
|
+
- uses: actions/download-artifact@v4
|
|
24
|
+
with:
|
|
25
|
+
name: dist
|
|
26
|
+
path: dist/
|
|
27
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
28
|
+
github-release:
|
|
29
|
+
needs: build
|
|
30
|
+
runs-on: ubuntu-latest
|
|
31
|
+
permissions:
|
|
32
|
+
contents: write
|
|
33
|
+
steps:
|
|
34
|
+
- uses: actions/download-artifact@v4
|
|
35
|
+
with:
|
|
36
|
+
name: dist
|
|
37
|
+
path: dist/
|
|
38
|
+
- uses: softprops/action-gh-release@v2
|
|
39
|
+
with:
|
|
40
|
+
files: dist/*
|
|
41
|
+
generate_release_notes: true
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
# Created by https://www.toptal.com/developers/gitignore/api/python,visualstudiocode,vim
|
|
2
|
+
# Edit at https://www.toptal.com/developers/gitignore?templates=python,visualstudiocode,vim
|
|
3
|
+
|
|
4
|
+
### Python ###
|
|
5
|
+
# Byte-compiled / optimized / DLL files
|
|
6
|
+
__pycache__/
|
|
7
|
+
*.py[cod]
|
|
8
|
+
*$py.class
|
|
9
|
+
|
|
10
|
+
# C extensions
|
|
11
|
+
*.so
|
|
12
|
+
|
|
13
|
+
# Distribution / packaging
|
|
14
|
+
.Python
|
|
15
|
+
build/
|
|
16
|
+
develop-eggs/
|
|
17
|
+
dist/
|
|
18
|
+
downloads/
|
|
19
|
+
eggs/
|
|
20
|
+
.eggs/
|
|
21
|
+
lib/
|
|
22
|
+
lib64/
|
|
23
|
+
parts/
|
|
24
|
+
sdist/
|
|
25
|
+
var/
|
|
26
|
+
wheels/
|
|
27
|
+
share/python-wheels/
|
|
28
|
+
*.egg-info/
|
|
29
|
+
.installed.cfg
|
|
30
|
+
*.egg
|
|
31
|
+
MANIFEST
|
|
32
|
+
|
|
33
|
+
# PyInstaller
|
|
34
|
+
# Usually these files are written by a python script from a template
|
|
35
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
36
|
+
*.manifest
|
|
37
|
+
*.spec
|
|
38
|
+
|
|
39
|
+
# Installer logs
|
|
40
|
+
pip-log.txt
|
|
41
|
+
pip-delete-this-directory.txt
|
|
42
|
+
|
|
43
|
+
# Unit test / coverage reports
|
|
44
|
+
htmlcov/
|
|
45
|
+
.tox/
|
|
46
|
+
.nox/
|
|
47
|
+
.coverage
|
|
48
|
+
.coverage.*
|
|
49
|
+
.cache
|
|
50
|
+
nosetests.xml
|
|
51
|
+
coverage.xml
|
|
52
|
+
*.cover
|
|
53
|
+
*.py,cover
|
|
54
|
+
.hypothesis/
|
|
55
|
+
.pytest_cache/
|
|
56
|
+
cover/
|
|
57
|
+
|
|
58
|
+
# Translations
|
|
59
|
+
*.mo
|
|
60
|
+
*.pot
|
|
61
|
+
|
|
62
|
+
# Django stuff:
|
|
63
|
+
*.log
|
|
64
|
+
local_settings.py
|
|
65
|
+
db.sqlite3
|
|
66
|
+
db.sqlite3-journal
|
|
67
|
+
|
|
68
|
+
# Flask stuff:
|
|
69
|
+
instance/
|
|
70
|
+
.webassets-cache
|
|
71
|
+
|
|
72
|
+
# Scrapy stuff:
|
|
73
|
+
.scrapy
|
|
74
|
+
|
|
75
|
+
# Sphinx documentation
|
|
76
|
+
docs/_build/
|
|
77
|
+
|
|
78
|
+
# PyBuilder
|
|
79
|
+
.pybuilder/
|
|
80
|
+
target/
|
|
81
|
+
|
|
82
|
+
# Jupyter Notebook
|
|
83
|
+
.ipynb_checkpoints
|
|
84
|
+
|
|
85
|
+
# IPython
|
|
86
|
+
profile_default/
|
|
87
|
+
ipython_config.py
|
|
88
|
+
|
|
89
|
+
# pyenv
|
|
90
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
91
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
92
|
+
# .python-version
|
|
93
|
+
|
|
94
|
+
# pipenv
|
|
95
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
96
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
97
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
98
|
+
# install all needed dependencies.
|
|
99
|
+
#Pipfile.lock
|
|
100
|
+
|
|
101
|
+
# poetry
|
|
102
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
103
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
104
|
+
# commonly ignored for libraries.
|
|
105
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
106
|
+
#poetry.lock
|
|
107
|
+
|
|
108
|
+
# pdm
|
|
109
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
110
|
+
#pdm.lock
|
|
111
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
112
|
+
# in version control.
|
|
113
|
+
# https://pdm.fming.dev/#use-with-ide
|
|
114
|
+
.pdm.toml
|
|
115
|
+
|
|
116
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
117
|
+
__pypackages__/
|
|
118
|
+
|
|
119
|
+
# Celery stuff
|
|
120
|
+
celerybeat-schedule
|
|
121
|
+
celerybeat.pid
|
|
122
|
+
|
|
123
|
+
# SageMath parsed files
|
|
124
|
+
*.sage.py
|
|
125
|
+
|
|
126
|
+
# Environments
|
|
127
|
+
.env
|
|
128
|
+
.venv
|
|
129
|
+
env/
|
|
130
|
+
venv/
|
|
131
|
+
ENV/
|
|
132
|
+
env.bak/
|
|
133
|
+
venv.bak/
|
|
134
|
+
|
|
135
|
+
# Spyder project settings
|
|
136
|
+
.spyderproject
|
|
137
|
+
.spyproject
|
|
138
|
+
|
|
139
|
+
# Rope project settings
|
|
140
|
+
.ropeproject
|
|
141
|
+
|
|
142
|
+
# mkdocs documentation
|
|
143
|
+
/site
|
|
144
|
+
|
|
145
|
+
# mypy
|
|
146
|
+
.mypy_cache/
|
|
147
|
+
.dmypy.json
|
|
148
|
+
dmypy.json
|
|
149
|
+
|
|
150
|
+
# Pyre type checker
|
|
151
|
+
.pyre/
|
|
152
|
+
|
|
153
|
+
# pytype static type analyzer
|
|
154
|
+
.pytype/
|
|
155
|
+
|
|
156
|
+
# Cython debug symbols
|
|
157
|
+
cython_debug/
|
|
158
|
+
|
|
159
|
+
# PyCharm
|
|
160
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
161
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
162
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
163
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
164
|
+
#.idea/
|
|
165
|
+
|
|
166
|
+
### Python Patch ###
|
|
167
|
+
# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
|
|
168
|
+
poetry.toml
|
|
169
|
+
|
|
170
|
+
# ruff
|
|
171
|
+
.ruff_cache/
|
|
172
|
+
|
|
173
|
+
# LSP config files
|
|
174
|
+
pyrightconfig.json
|
|
175
|
+
|
|
176
|
+
### Vim ###
|
|
177
|
+
# Swap
|
|
178
|
+
[._]*.s[a-v][a-z]
|
|
179
|
+
!*.svg # comment out if you don't need vector files
|
|
180
|
+
[._]*.sw[a-p]
|
|
181
|
+
[._]s[a-rt-v][a-z]
|
|
182
|
+
[._]ss[a-gi-z]
|
|
183
|
+
[._]sw[a-p]
|
|
184
|
+
|
|
185
|
+
# Session
|
|
186
|
+
Session.vim
|
|
187
|
+
Sessionx.vim
|
|
188
|
+
|
|
189
|
+
# Temporary
|
|
190
|
+
.netrwhist
|
|
191
|
+
*~
|
|
192
|
+
# Auto-generated tag files
|
|
193
|
+
tags
|
|
194
|
+
# Persistent undo
|
|
195
|
+
[._]*.un~
|
|
196
|
+
|
|
197
|
+
### VisualStudioCode ###
|
|
198
|
+
.vscode/*
|
|
199
|
+
!.vscode/settings.json
|
|
200
|
+
!.vscode/tasks.json
|
|
201
|
+
!.vscode/launch.json
|
|
202
|
+
!.vscode/extensions.json
|
|
203
|
+
!.vscode/*.code-snippets
|
|
204
|
+
|
|
205
|
+
# Local History for Visual Studio Code
|
|
206
|
+
.history/
|
|
207
|
+
|
|
208
|
+
# Built Visual Studio Code Extensions
|
|
209
|
+
*.vsix
|
|
210
|
+
|
|
211
|
+
### VisualStudioCode Patch ###
|
|
212
|
+
# Ignore all local history of files
|
|
213
|
+
.history
|
|
214
|
+
.ionide
|
|
215
|
+
|
|
216
|
+
# End of https://www.toptal.com/developers/gitignore/api/python,visualstudiocode,vim
|
|
217
|
+
|
|
218
|
+
# mkreadme
|
|
219
|
+
.tox/
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/gitleaks/gitleaks
|
|
3
|
+
rev: v8.21.2
|
|
4
|
+
hooks:
|
|
5
|
+
- id: gitleaks
|
|
6
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
7
|
+
rev: v5.0.0
|
|
8
|
+
hooks:
|
|
9
|
+
- id: trailing-whitespace
|
|
10
|
+
- id: end-of-file-fixer
|
|
11
|
+
- id: check-added-large-files
|
|
12
|
+
- id: check-merge-conflict
|
|
13
|
+
- id: check-yaml
|
|
14
|
+
- id: check-toml
|
|
15
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
16
|
+
rev: v0.6.9
|
|
17
|
+
hooks:
|
|
18
|
+
- id: ruff
|
|
19
|
+
args: [--fix]
|
|
20
|
+
- id: ruff-format
|
|
21
|
+
- repo: local
|
|
22
|
+
hooks:
|
|
23
|
+
- id: pytest
|
|
24
|
+
name: pytest
|
|
25
|
+
entry: uv run pytest
|
|
26
|
+
language: system
|
|
27
|
+
pass_filenames: false
|
|
28
|
+
stages: [pre-push]
|
|
29
|
+
- id: readwright-check
|
|
30
|
+
name: readwright check
|
|
31
|
+
entry: uv run readwright check
|
|
32
|
+
language: system
|
|
33
|
+
pass_filenames: false
|
|
34
|
+
files: ^(README\.md|README\.md\.j2|readme\.yaml|src/readwright/templates/.*)$
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
- id: readwright-check
|
|
2
|
+
name: readwright check
|
|
3
|
+
description: Fail if README.md is out of date with its readwright template.
|
|
4
|
+
entry: readwright check
|
|
5
|
+
language: python
|
|
6
|
+
pass_filenames: false
|
|
7
|
+
files: ^(README\.md|README\.md\.j2|readme\.yaml|templates/.*|docs/screenshots/.*)$
|
|
8
|
+
- id: readwright-render
|
|
9
|
+
name: readwright render
|
|
10
|
+
description: Re-render README.md from its readwright template.
|
|
11
|
+
entry: readwright render
|
|
12
|
+
language: python
|
|
13
|
+
pass_filenames: false
|
|
14
|
+
files: ^(README\.md|README\.md\.j2|readme\.yaml|templates/.*|docs/screenshots/.*)$
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.11
|
readwright-0.3.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Garulf
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: readwright
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Render GitHub READMEs from Jinja2 templates with badge and screenshot helpers
|
|
5
|
+
Project-URL: Homepage, https://github.com/Garulf/readwright
|
|
6
|
+
Project-URL: Issues, https://github.com/Garulf/readwright/issues
|
|
7
|
+
Author-email: Garulf <535299+Garulf@users.noreply.github.com>
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Keywords: badges,jinja2,markdown,readme,shields
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Classifier: Topic :: Documentation
|
|
16
|
+
Classifier: Topic :: Software Development :: Documentation
|
|
17
|
+
Requires-Python: >=3.11
|
|
18
|
+
Requires-Dist: jinja2>=3.1
|
|
19
|
+
Requires-Dist: pydantic>=2.7
|
|
20
|
+
Requires-Dist: pyyaml>=6.0
|
|
21
|
+
Requires-Dist: rich>=13.0
|
|
22
|
+
Requires-Dist: tomli-w>=1.2.0
|
|
23
|
+
Requires-Dist: typer>=0.12
|
|
24
|
+
Requires-Dist: watchfiles>=1.2.0
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
|
|
27
|
+
<!-- generated by readwright from README.md.j2; edit the template, not this file -->
|
|
28
|
+
# readwright
|
|
29
|
+
|
|
30
|
+
Render GitHub READMEs from Jinja2 templates with badge and screenshot helpers.
|
|
31
|
+
|
|
32
|
+
[](https://pypi.org/project/readwright/) [](https://pypi.org/project/readwright/) [](https://github.com/Garulf/readwright/blob/main/LICENSE) [](https://github.com/Garulf/readwright/actions/workflows/ci.yml) [](https://github.com/pre-commit/pre-commit) [](https://github.com/astral-sh/ruff)
|
|
33
|
+
|
|
34
|
+
- [Installation](#installation)
|
|
35
|
+
- [Quick start](#quick-start)
|
|
36
|
+
- [Template helpers](#template-helpers)
|
|
37
|
+
- [Configuration](#configuration)
|
|
38
|
+
- [pre-commit and GitHub Actions](#pre-commit-and-github-actions)
|
|
39
|
+
- [Contributing](#contributing)
|
|
40
|
+
- [License](#license)
|
|
41
|
+
|
|
42
|
+
## Installation
|
|
43
|
+
|
|
44
|
+
```sh
|
|
45
|
+
pip install readwright
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Or with [uv](https://docs.astral.sh/uv/):
|
|
49
|
+
|
|
50
|
+
```sh
|
|
51
|
+
uv tool install readwright
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Quick start
|
|
55
|
+
|
|
56
|
+
```sh
|
|
57
|
+
cd my-repo
|
|
58
|
+
readwright init # writes readme.yaml + README.md.j2 (autodetects owner/repo, name, license, ...)
|
|
59
|
+
readwright render # writes README.md (--watch to re-render on change, -o - for stdout)
|
|
60
|
+
readwright check # exit 1 with a diff if README.md is stale (use as a pre-commit hook / in CI)
|
|
61
|
+
readwright badges # list badge presets
|
|
62
|
+
readwright blocks # list overridable blocks and partials
|
|
63
|
+
readwright show partials/install.md.j2 # print a packaged template to copy and tweak
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Already have a README? `readwright init --from-readme` moves its body into the template so nothing is
|
|
67
|
+
lost, then takes over `README.md`. Prefer `pyproject.toml`? `readwright init --pyproject` writes the config
|
|
68
|
+
to `[tool.readme]`.
|
|
69
|
+
|
|
70
|
+
`README.md.j2` extends the packaged `base.md.j2` and overrides only what it needs:
|
|
71
|
+
|
|
72
|
+
```jinja
|
|
73
|
+
{% extends "base.md.j2" %}
|
|
74
|
+
|
|
75
|
+
{% block usage %}
|
|
76
|
+
## Usage
|
|
77
|
+
|
|
78
|
+
{{ screenshot("main", width=600) }}
|
|
79
|
+
|
|
80
|
+
Run `{{ project.name }} --help`.
|
|
81
|
+
{% endblock %}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
See [`examples/`](https://github.com/Garulf/readwright/tree/main/examples) for a kitchen-sink project using every helper,
|
|
85
|
+
plus Minecraft mod, HACS card and Flow Launcher plugin examples.
|
|
86
|
+
|
|
87
|
+
## Template helpers
|
|
88
|
+
|
|
89
|
+
| Helper | Result |
|
|
90
|
+
| --- | --- |
|
|
91
|
+
| `badge("pypi")`, `badge("ci", workflow="test.yml")` | Preset badge built from repo metadata |
|
|
92
|
+
| `shield("Discord", "chat", "5865F2", link=...)` | Custom shields.io static badge |
|
|
93
|
+
| `badges()` / `donate_badges()` | All badges from `badges:` / `donate:` in config |
|
|
94
|
+
| `screenshot("main", alt=..., width=...)` | Finds `docs/screenshots/main.{png,jpg,gif,webp,svg}`; `main-dark.*` + `main-light.*` become a theme-aware pair |
|
|
95
|
+
| `screenshots(columns=2)` | Gallery table of every image in the screenshots dir |
|
|
96
|
+
| `image("path/or/url", "alt", width=...)` | Explicit image, no discovery |
|
|
97
|
+
| `screenshots(order=[...], captions={...}, subdir=...)` | Control gallery order/captions (or drop a `captions.yaml` in the folder) |
|
|
98
|
+
| `toc()`, `toc(1, 2)` | Table of contents from the headings below it (min/max level) |
|
|
99
|
+
| `changelog(n=1)` | Newest `n` entries of `CHANGELOG.md` |
|
|
100
|
+
| `project.*`, `vars.*` | Repo metadata and free-form config values |
|
|
101
|
+
| `cli_help("mytool --help")` | Runs the command and fences its output (needs `allow_exec: true`) |
|
|
102
|
+
| `include_file(path)`, `code_block(path)`, `snippet(path, start, end)` | Pull a file, a fenced file, or a marked region into the README |
|
|
103
|
+
| `config_table(path, section=...)`, `env_table(".env.example")`, `entry_points_table()` | Markdown tables from YAML/TOML/JSON, env files, `[project.scripts]` |
|
|
104
|
+
| `gh_link("issues", "Issues")`, `spdx_link()`, `my_ha_link("hacs_repository", owner=..., repository=...)` | Repo-relative GitHub links, SPDX license link, My Home Assistant buttons |
|
|
105
|
+
| `callout("tip", text)`, `details(summary, body)`, `center(html)`, `columns([...])` | GitHub alerts, collapsibles, centered blocks, side-by-side cells |
|
|
106
|
+
| `logo(width=120)`, `video("demo")`, `contributors([...])` | Theme-aware logo from `docs/logo.*`, video/gif embed, avatar grid |
|
|
107
|
+
| `unsplash("photo-1518…", credit="Name", user="handle", width=1000, height=280)` | Hero image from Unsplash's CDN with the required attribution line; `banner:` in config puts one above the title |
|
|
108
|
+
| `flow_install_cmd()`, `mc_versions()`, `mod_dependencies()`, `related_repos()` | Flow Launcher / Minecraft mod / related-repo tables |
|
|
109
|
+
| `git_sha()`, `git_tag()`, `today()` | Build metadata (these change between renders, so `check` will flag them) |
|
|
110
|
+
|
|
111
|
+
To add a badge to the top row without touching the config list, fill the `badges_extra` hook (there is a
|
|
112
|
+
`donate_extra` too):
|
|
113
|
+
|
|
114
|
+
```jinja
|
|
115
|
+
{% block badges_extra %} {{ shield("docs", "latest", "success", link=gh_link("wiki")) }}{% endblock %}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Badge presets: `pypi`, `pypi-downloads`, `python`, `license`, `ci`, `codecov`, `npm`, `github-release`,
|
|
119
|
+
`github-stars`, `pre-commit`, `ruff`, `version`, `modrinth`, `curseforge`, `hacs`, `ha-version`, plus donation presets `kofi`, `buymeacoffee`, `github-sponsors`,
|
|
120
|
+
`patreon`, `paypal`. Add your own under `badges_custom`; set `badges_style: flat-square` (or pass
|
|
121
|
+
`style=` to any badge helper) to restyle them all.
|
|
122
|
+
|
|
123
|
+
Blocks in `base.md.j2`: `header`, `badges`, `donate`, `toc`, `screenshots`, `install`, `usage`, `extra`,
|
|
124
|
+
`contributing`, `license`. Any packaged partial can be shadowed by a file of the same name under
|
|
125
|
+
`templates/partials/` in the repo (or `~/.config/readwright/templates/` for all your repos).
|
|
126
|
+
|
|
127
|
+
Image helpers emit plain markdown by default (dark/light pairs use GitHub's
|
|
128
|
+
`#gh-light-mode-only`/`#gh-dark-mode-only` fragments instead of `<picture>`), and only fall back to HTML
|
|
129
|
+
when you ask for something markdown can't do, like a `width=`. Set `screenshots.style: html` to always
|
|
130
|
+
get `<img>`/`<picture>`/`<table>` output, or pass `html=True` to `unsplash()`/`banner:`.
|
|
131
|
+
|
|
132
|
+
## Configuration
|
|
133
|
+
|
|
134
|
+
`readme.yaml` in the repo root (or `[tool.readme]` in `pyproject.toml`); see
|
|
135
|
+
[`examples/config-only/readme.yaml`](https://github.com/Garulf/readwright/blob/main/examples/config-only/readme.yaml) for every key,
|
|
136
|
+
annotated. Everything is optional;
|
|
137
|
+
metadata is autodetected from the git remote, the `LICENSE` file and whichever manifest the project
|
|
138
|
+
has: `pyproject.toml`, `package.json`, `Cargo.toml`, `go.mod`, `*.csproj`, Gradle (`gradle.properties`
|
|
139
|
+
mod metadata for Minecraft mods), `hacs.json` or a Flow Launcher `plugin.json`. The install section
|
|
140
|
+
adapts to the project type.
|
|
141
|
+
|
|
142
|
+
```yaml
|
|
143
|
+
template: README.md.j2
|
|
144
|
+
templates: [../shared-readme-templates, "pkg:my_org_templates"] # extra template search paths
|
|
145
|
+
output: README.md
|
|
146
|
+
strict: false # missing screenshot -> error instead of warning
|
|
147
|
+
allow_exec: false # let cli_help() run commands during render
|
|
148
|
+
badges_style: flat-square # optional shields.io style for every badge
|
|
149
|
+
related: [{repo: other-tool, description: Sibling project}] # for related_repos()
|
|
150
|
+
banner: {unsplash: photo-1518770660439-4636190af475, credit: Alexandre Debiève, user: alexkixa}
|
|
151
|
+
screenshots: {dir: docs/screenshots, width: 720, style: markdown} # style: html for width/alignment
|
|
152
|
+
badges: [pypi, python, license, {preset: ci, workflow: test.yml}, {shield: {label: Docs, message: latest, color: success}}]
|
|
153
|
+
badges_custom:
|
|
154
|
+
discord: {label: Discord, message: chat, color: 5865F2, link: https://discord.gg/xyz}
|
|
155
|
+
donate: [kofi, github-sponsors]
|
|
156
|
+
donate_handles: {kofi: yourname, github-sponsors: yourname}
|
|
157
|
+
project: {name: ..., owner: ..., repo: ..., tagline: ..., pypi: ..., npm: ..., license: ..., ci_workflow: ...}
|
|
158
|
+
vars: {anything: you like}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Put the values you repeat across repos (donation handles, owner, custom badges) in
|
|
162
|
+
`~/.config/readwright/config.yaml`; `readwright init` bakes them into each new `readme.yaml` so rendering
|
|
163
|
+
stays reproducible in CI. `readwright render --user-config` merges them ad hoc.
|
|
164
|
+
|
|
165
|
+
## pre-commit and GitHub Actions
|
|
166
|
+
|
|
167
|
+
```yaml
|
|
168
|
+
# .pre-commit-config.yaml
|
|
169
|
+
- repo: https://github.com/Garulf/readwright
|
|
170
|
+
rev: v0.3.0
|
|
171
|
+
hooks:
|
|
172
|
+
- id: readwright-check
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
```yaml
|
|
176
|
+
# .github/workflows/ci.yml
|
|
177
|
+
- uses: Garulf/readwright@v0.3.0
|
|
178
|
+
with:
|
|
179
|
+
mode: check # or render
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## Contributing
|
|
183
|
+
|
|
184
|
+
Issues and pull requests are welcome at [Garulf/readwright](https://github.com/Garulf/readwright).
|
|
185
|
+
|
|
186
|
+
## License
|
|
187
|
+
|
|
188
|
+
MIT
|