Haskell-like intervals for Python
Project description
autoreadme
Generate READMEs with collapsable* code and corresponding output from Python.
Installation
from package
# Set up a virtualenv.
python3 -m venv venv
source venv/bin/activate
# Install from PyPI
pip install autoreadme
from source
git clone https://github.com/davips/autoreadme
cd autoreadme
Example
A typical README-edit.md file would be:
# Uses
We can cook using the following Python code:
<<cook>>
However, we can also clean:
<<clean>>
The example file (given in this repo as examples/README-edit.md) depends on two scripts.
Each script should have a # ...
line where the output until that moment is expected to appear:
examples/cook.py:
# Cooking
x = 2 * 8
print("This script prints something:", x)
# ...
examples/clean.py:
# Cleaning
y = 34 % 5
print("this script prints another thing.", y)
# ...
Running...
autoreadme -i examples/README-edit.md -s examples/ -o examples/README.md examples/README-edit.md
...will result in the following markdown:
# UsesWe can cook using the following Python code:
Cooking
x = 2 * 8 print("This script prints something:", x)This script prints something: 16
However, we can also clean:
Cleaning
y = 34 % 5 print("this script prints another thing.", y)this script prints another thing. 4
Features / TODO
- . . .
- Fix """ """ in excess after command without '# ...'
-
[ ] . . .
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
autoreadme-0.2101.15.tar.gz
(4.9 kB
view details)
Built Distribution
File details
Details for the file autoreadme-0.2101.15.tar.gz
.
File metadata
- Download URL: autoreadme-0.2101.15.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f210eb795a914a389a0507c2ae5fedaa28e379b00e17f2a3d3236dae764426c6 |
|
MD5 | a6fa3f11ae85a32656c9dc670c75c840 |
|
BLAKE2b-256 | 3ed7b5338a1f021fa50a78dcac2707360e710b16edb94cedab2b6037ba82f8e6 |
File details
Details for the file autoreadme-0.2101.15-py3-none-any.whl
.
File metadata
- Download URL: autoreadme-0.2101.15-py3-none-any.whl
- Upload date:
- Size: 17.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c65d4b5375a8975c1bc515bed2fd22098ece01735a9794b559037b247e3e710f |
|
MD5 | ed77bf2a7ad523da132740a4a35b2f3a |
|
BLAKE2b-256 | 53a1df04e8f3978aa723a7f6100a23a709198fed41ed7ab7ab7d3484d6e858d5 |