|
6 | 6 |  |
7 | 7 |  |
8 | 8 |
|
9 | | -`structured-tutorials` allows you to write tutorials that can be rendered as Sphinx documentation and also be |
10 | | -run on your local system to verify correctness. |
| 9 | +`structured-tutorials` allows you to write tutorials that can be rendered as documentation and run on your |
| 10 | +system to verify correctness. |
11 | 11 |
|
12 | | -With `structured-tutorials` you to specify commands in a configuration file. A Sphinx plugin allows you to |
| 12 | +With `structured-tutorials` you to specify steps in a configuration file. A Sphinx plugin allows you to |
13 | 13 | render those commands in your project documentation. A command-line tool can load the configuration file and |
14 | 14 | run it on your local system. |
15 | 15 |
|
| 16 | +Please see the [official documentation](https://structured-tutorials.readthedocs.io/) for more detailed |
| 17 | +information. |
| 18 | + |
| 19 | +## Installation / Setup |
| 20 | + |
| 21 | +Install `structured-tutorials`: |
| 22 | + |
| 23 | +``` |
| 24 | +pip install structured-tutorials |
| 25 | +``` |
| 26 | + |
| 27 | +and configure Sphinx: |
| 28 | + |
| 29 | +```python |
| 30 | +extensions = [ |
| 31 | + # ... other extensions |
| 32 | + "structured_tutorials.sphinx", |
| 33 | +] |
| 34 | + |
| 35 | +# Optional: Root directory for tutorials |
| 36 | +#tutorial_root = DOC_ROOT / "tutorials" |
| 37 | +``` |
| 38 | + |
| 39 | +## Your first (trivial) tutorial |
| 40 | + |
| 41 | +To create your first tutorial, create it in `docs/tutorial.yaml` (or elsewhere, if you configured |
| 42 | +`tutorial_root` in `conf.py`): |
| 43 | + |
| 44 | +```yaml |
| 45 | +parts: |
| 46 | + - commands: |
| 47 | + - command: structured-tutorial --help |
| 48 | + doc: |
| 49 | + output: | |
| 50 | + usage: structured-tutorial [-h] path |
| 51 | + ... |
| 52 | +``` |
| 53 | +
|
| 54 | +### Run the tutorial |
| 55 | +
|
| 56 | +Run the tutorial with: |
| 57 | +
|
| 58 | +``` |
| 59 | +$ structured-tutorial docs/tutorials/quickstart/tutorial.yaml |
| 60 | +usage: structured-tutorial [-h] path |
| 61 | +... |
| 62 | +``` |
| 63 | + |
| 64 | +### Render tutorial in Sphinx: |
| 65 | + |
| 66 | +Configure the tutorial that is being displayed - this will not show any output: |
| 67 | + |
| 68 | +``` |
| 69 | +.. structured-tutorial:: quickstart/tutorial.yaml |
| 70 | +
|
| 71 | +.. structured-tutorial-part:: |
| 72 | +``` |
| 73 | + |
16 | 74 | ## TODO |
17 | 75 | * Run in vagrant |
18 | 76 |
|
|
0 commit comments