Lightweight documentation generator
Project description
📰 Edition
WARNING: This is a pre-release project.
Edition is a command-line application for creating beautiful HTML and Markdown editions of your projects' documentation.
In fact, the document you're reading right now was pressed by Edition.
Highlights
- Write your documentation once.
Edition will press you aREADME.md
to upload to your project, PyPI et al, and a beautiful HTML page ready to upload directly to GitHub or GitLab Pages. - Works out of the box.
With one command, your existingREADME.md
can be converted to beautiful HTML. - Embed your code samples.
Edition will execute your code and embed the results.
Getting started
Prerequisites
Edition requires Python 3.8 or later.
Installation
Install Edition via pip
:
pip install edition
Quick-start example
Create this Markdown document as example-source.md
:
# Edition example
Save this file to your local machine as `example-source.md`
then run:
```bash
edition example-source.md example.html --press html
```
Now open `example.html` in a web browser. The code example
below will be complete.
```bash
python --version
```
<!--edition-exec-->
Run:
edition docs/example-source.md docs/example.html --press html
warning: no value for "author"
warning: no value for "favicon-emoji"
Pressed: docs/example.html
Fun fact! The execution example above is executed every time I press this documentation. That means you can see the actual example.html that was generated.
Usage
Command line
Edition takes three command line arguments:
- Source file
- Destination file
--press html
to press HTML or--press markdown
to press Markdown
Creating your source document
Your source document is the Markdown document from which all your editions will be pressed.
Any Markdown document you already have -- like your project's README.md
-- is already a valid source document, but we can add some front matter and additional markup to help guide the presses.
Front matter
The following front matter properties come into play only when pressing HTML.
Property | Description | Default |
---|---|---|
author | Author name | No author |
favicon-emoji | Emoji to use as favicon | No favicon |
title | Page title | Top-level heading |
For example:
---
author: Cariad Eccleston
favicon-emoji: 🍕
# If "title" was omitted then the top-level "Example"
# heading would be used instead:
title: Embedded Example
---
# Example
Markup
Code execution
To have Edition execute your code then embed the result:
- Create a regular Markdown code block
- Add
<!--edition-exec-->
after the block
For example:
```python
print("Hello, world!")
```
<!--edition-exec-->
Currently only bash
and python
code blocks are supported. More languages can be added if they are requested.
Table of Contents
<edition value="toc" />
Project
Contributing
To contribute a bug report, enhancement or feature request, please raise an issue at github.com/cariad/edition/issues.
If you want to contribute a code change, please raise an issue first so we can chat about the direction you want to take.
Licence
Edition is released at github.com/cariad/edition under the MIT Licence.
See LICENSE for more information.
Author
Hello! 👋 I'm Cariad Eccleston and I'm a freelance DevOps and backend engineer. My contact details are available on my personal wiki at cariad.earth.
Please consider supporting my open source projects by sponsoring me on GitHub.
Acknowledgements
- The beautiful Dracula for Pygments theme is copyright of Dracula Theme and used under the MIT licence.
- Epic thanks to John Gruber for releasing the Markdown specification.
- Code injection is performed by dinject, copyright of Cariad Eccleston and used under the MIT licence.
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 Distributions
Built Distribution
Hashes for edition-1.0.0a6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8eed14c2aec5adb9e2953c77dfc866eec5bb78cc8be2dd47b049e7b4423f655 |
|
MD5 | 5331a074009322ed5242f4b3bab81e8a |
|
BLAKE2b-256 | 77f46660ea1da49e903300c4214da6ae0d6cd9989dc1f0bde144e94d6e6927f3 |