structured-tutorials 0.1.0__tar.gz → 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.
Files changed (180) hide show
  1. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/.github/workflows/tests.yml +3 -1
  2. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/.readthedocs.yaml +1 -1
  3. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/PKG-INFO +8 -5
  4. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/README.md +6 -3
  5. structured_tutorials-0.3.0/docs/changelog.rst +51 -0
  6. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/docs/conf.py +7 -3
  7. structured_tutorials-0.3.0/docs/include/quickstart-more-features.rst +13 -0
  8. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/docs/include/quickstart.rst +0 -2
  9. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/docs/quickstart.rst +56 -44
  10. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/docs/spelling_wordlist.txt +2 -0
  11. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/docs/tutorials/quickstart/tutorial.yaml +3 -1
  12. structured_tutorials-0.3.0/docs/tutorials/templates/tutorial.yaml +39 -0
  13. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/htmlcov/class_index.html +162 -132
  14. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/htmlcov/function_index.html +226 -151
  15. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/htmlcov/index.html +61 -61
  16. structured_tutorials-0.3.0/htmlcov/status.json +1 -0
  17. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/htmlcov/z_0ce4b8b40d14c0ec_base_py.html +66 -52
  18. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/htmlcov/z_0ce4b8b40d14c0ec_parts_py.html +201 -194
  19. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/htmlcov/z_0ce4b8b40d14c0ec_tests_py.html +39 -30
  20. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/htmlcov/z_0ce4b8b40d14c0ec_tutorial_py.html +97 -91
  21. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/htmlcov/z_0ce4b8b40d14c0ec_validators_py.html +24 -10
  22. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/htmlcov/z_10746939a1c77e4c___init___py.html +22 -21
  23. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/htmlcov/z_10746939a1c77e4c_directives_py.html +38 -37
  24. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/htmlcov/z_10746939a1c77e4c_utils_py.html +221 -191
  25. structured_tutorials-0.3.0/htmlcov/z_1b8c1a89abcc896b_base_py.html +277 -0
  26. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/htmlcov/z_1b8c1a89abcc896b_local_py.html +223 -214
  27. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/htmlcov/z_3b10c79445bd681b_cli_py.html +44 -35
  28. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/htmlcov/z_3b10c79445bd681b_errors_py.html +24 -20
  29. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/htmlcov/z_3b10c79445bd681b_output_py.html +2 -2
  30. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/htmlcov/z_3b10c79445bd681b_textwrap_py.html +2 -2
  31. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/htmlcov/z_3b10c79445bd681b_typing_py.html +24 -13
  32. structured_tutorials-0.3.0/htmlcov/z_3b10c79445bd681b_utils_py.html +212 -0
  33. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/pyproject.toml +7 -5
  34. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/structured_tutorials/cli.py +15 -6
  35. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/structured_tutorials/errors.py +4 -0
  36. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/structured_tutorials/models/base.py +14 -0
  37. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/structured_tutorials/models/parts.py +14 -7
  38. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/structured_tutorials/models/tests.py +12 -3
  39. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/structured_tutorials/models/tutorial.py +6 -0
  40. structured_tutorials-0.3.0/structured_tutorials/models/validators.py +28 -0
  41. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/structured_tutorials/runners/base.py +66 -3
  42. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/structured_tutorials/runners/local.py +31 -22
  43. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/structured_tutorials/sphinx/__init__.py +3 -2
  44. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/structured_tutorials/sphinx/directives.py +4 -3
  45. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/structured_tutorials/sphinx/utils.py +41 -11
  46. structured_tutorials-0.3.0/structured_tutorials/templates/alternative_part.rst.template +9 -0
  47. structured_tutorials-0.3.0/structured_tutorials/templates/commands_part.rst.template +9 -0
  48. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/structured_tutorials/templates/file_part.rst.template +6 -1
  49. structured_tutorials-0.3.0/structured_tutorials/typing.py +26 -0
  50. structured_tutorials-0.3.0/structured_tutorials/utils.py +113 -0
  51. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/tests/conftest.py +12 -0
  52. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/tests/data/docs/conf.py +6 -1
  53. structured_tutorials-0.3.0/tests/data/docs/variable_defined_in_config.rst +3 -0
  54. structured_tutorials-0.3.0/tests/data/tutorials/alternatives-text.yaml +32 -0
  55. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/tests/data/tutorials/command-as-list.yaml +3 -0
  56. structured_tutorials-0.3.0/tests/data/tutorials/command-clear-environment-globally.yaml +27 -0
  57. structured_tutorials-0.3.0/tests/data/tutorials/command-clear-single-environment-variable.yaml +7 -0
  58. structured_tutorials-0.3.0/tests/data/tutorials/command-env-variable-for-single-command.yaml +11 -0
  59. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/tests/data/tutorials/command-hide-output.yaml +3 -0
  60. structured_tutorials-0.3.0/tests/data/tutorials/command-skip-single-command.rst +4 -0
  61. structured_tutorials-0.3.0/tests/data/tutorials/command-skip-single-command.yaml +9 -0
  62. structured_tutorials-0.3.0/tests/data/tutorials/command-test-output-count.yaml +9 -0
  63. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/tests/data/tutorials/command-test-output.yaml +3 -0
  64. structured_tutorials-0.3.0/tests/data/tutorials/command-text.yaml +10 -0
  65. structured_tutorials-0.3.0/tests/data/tutorials/command-undefined-variable.yaml +3 -0
  66. structured_tutorials-0.3.0/tests/data/tutorials/command-with-chdir-template.yaml +9 -0
  67. structured_tutorials-0.3.0/tests/data/tutorials/file-contents-exists.yaml +7 -0
  68. structured_tutorials-0.3.0/tests/data/tutorials/file-contents-text.yaml +10 -0
  69. structured_tutorials-0.3.0/tests/data/tutorials/prompt-confirm-error-template.yaml +8 -0
  70. structured_tutorials-0.3.0/tests/runners/local/commands/__init__.py +2 -0
  71. structured_tutorials-0.3.0/tests/runners/local/commands/test_environment.py +84 -0
  72. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/tests/runners/local/test_command.py +79 -19
  73. structured_tutorials-0.3.0/tests/runners/local/test_file.py +82 -0
  74. structured_tutorials-0.3.0/tests/runners/local/test_local.py +89 -0
  75. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/tests/runners/local/test_prompt.py +11 -23
  76. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/tests/sphinx/test_app.py +4 -4
  77. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/tests/sphinx/test_build.py +6 -0
  78. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/tests/sphinx/test_wrapper.py +66 -0
  79. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/tests/test_cli.py +28 -14
  80. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/tests/test_models.py +21 -1
  81. structured_tutorials-0.3.0/tests/test_utils.py +38 -0
  82. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/uv.lock +170 -126
  83. structured_tutorials-0.1.0/docs/changelog.rst +0 -9
  84. structured_tutorials-0.1.0/docs/tutorials/simple-file/tutorial.yaml +0 -18
  85. structured_tutorials-0.1.0/docs/tutorials/templates/tutorial.yaml +0 -19
  86. structured_tutorials-0.1.0/htmlcov/status.json +0 -1
  87. structured_tutorials-0.1.0/htmlcov/z_1b8c1a89abcc896b_base_py.html +0 -214
  88. structured_tutorials-0.1.0/htmlcov/z_3b10c79445bd681b_utils_py.html +0 -177
  89. structured_tutorials-0.1.0/structured_tutorials/models/validators.py +0 -14
  90. structured_tutorials-0.1.0/structured_tutorials/templates/alternative_part.rst.template +0 -5
  91. structured_tutorials-0.1.0/structured_tutorials/typing.py +0 -15
  92. structured_tutorials-0.1.0/structured_tutorials/utils.py +0 -78
  93. structured_tutorials-0.1.0/tests/runners/local/test_local.py +0 -165
  94. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/.editorconfig +0 -0
  95. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/.github/workflows/docs.yml +0 -0
  96. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/.github/workflows/mypy.yml +0 -0
  97. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/.github/workflows/quality.yml +0 -0
  98. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/.github/workflows/wheel.yml +0 -0
  99. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/.gitignore +0 -0
  100. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/LICENSE +0 -0
  101. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/docs/Makefile +0 -0
  102. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/docs/_static/.gitkeep +0 -0
  103. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/docs/dev.rst +0 -0
  104. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/docs/how-tos.rst +0 -0
  105. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/docs/index.rst +0 -0
  106. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/docs/make.bat +0 -0
  107. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/docs/reference.rst +0 -0
  108. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/docs/tutorials/alternatives/tutorial.yaml +0 -0
  109. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/docs/tutorials/cleanup/tutorial.yaml +0 -0
  110. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/docs/tutorials/cleanup-multiple/tutorial.yaml +0 -0
  111. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/docs/tutorials/command-as-list/tutorial.yaml +0 -0
  112. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/docs/tutorials/context/tutorial.yaml +0 -0
  113. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/docs/tutorials/default-context/tutorial.yaml +0 -0
  114. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/docs/tutorials/doc-or-runtime/tutorial.yaml +0 -0
  115. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/docs/tutorials/echo/tutorial.yaml +0 -0
  116. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/docs/tutorials/exit_code/tutorial.yaml +0 -0
  117. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/docs/tutorials/file/tutorial.yaml +0 -0
  118. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/docs/tutorials/file-copy/tutorial.yaml +0 -0
  119. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/docs/tutorials/file-full-example/tutorial.yaml +0 -0
  120. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/docs/tutorials/git-export/tutorial.yaml +0 -0
  121. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/docs/tutorials/interactive-prompt/tutorial.yaml +0 -0
  122. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/docs/tutorials/long-commands/tutorial.yaml +0 -0
  123. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/docs/tutorials/prompt/tutorial.yaml +0 -0
  124. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/docs/tutorials/skip-part-doc/tutorial.yaml +0 -0
  125. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/docs/tutorials/skip-part-run/tutorial.yaml +0 -0
  126. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/docs/tutorials/temporary-directory/tutorial.yaml +0 -0
  127. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/docs/tutorials/test-command/tutorial.yaml +0 -0
  128. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/docs/tutorials/test-output/tutorial.yaml +0 -0
  129. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/docs/tutorials/test-port/tutorial.yaml +0 -0
  130. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/fetch_swagger.sh +0 -0
  131. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/generate-schema.py +0 -0
  132. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/htmlcov/.gitignore +0 -0
  133. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/htmlcov/coverage_html_cb_6fb7b396.js +0 -0
  134. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/htmlcov/coverage_html_cb_bcae5fc4.js +0 -0
  135. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/htmlcov/favicon_32_cb_58284776.png +0 -0
  136. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/htmlcov/keybd_closed_cb_ce680311.png +0 -0
  137. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/htmlcov/style_cb_6b508a39.css +0 -0
  138. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/htmlcov/style_cb_8432e98f.css +0 -0
  139. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/htmlcov/style_cb_8e611ae1.css +0 -0
  140. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/htmlcov/style_cb_a5a05ca4.css +0 -0
  141. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/htmlcov/z_0ce4b8b40d14c0ec___init___py.html +0 -0
  142. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/htmlcov/z_10746939a1c77e4c_textwrap_py.html +0 -0
  143. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/htmlcov/z_1b8c1a89abcc896b___init___py.html +0 -0
  144. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/htmlcov/z_3b10c79445bd681b___init___py.html +0 -0
  145. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/htmlcov/z_3b10c79445bd681b_models_py.html +0 -0
  146. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/htmlcov/z_3b10c79445bd681b_tutorial_py.html +0 -0
  147. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/structured_tutorials/__init__.py +0 -0
  148. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/structured_tutorials/models/__init__.py +0 -0
  149. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/structured_tutorials/output.py +0 -0
  150. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/structured_tutorials/runners/__init__.py +0 -0
  151. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/structured_tutorials/textwrap.py +0 -0
  152. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/tests/__init__.py +0 -0
  153. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/tests/data/docs/index.rst +0 -0
  154. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/tests/data/tutorials/alternatives-files.yaml +0 -0
  155. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/tests/data/tutorials/alternatives.yaml +0 -0
  156. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/tests/data/tutorials/command-simple.yaml +0 -0
  157. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/tests/data/tutorials/command-stdin.yaml +0 -0
  158. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/tests/data/tutorials/command-with-chdir.yaml +0 -0
  159. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/tests/data/tutorials/empty.yaml +0 -0
  160. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/tests/data/tutorials/file-contents-destination-dir.yaml +0 -0
  161. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/tests/data/tutorials/file-copy-destination-dir.yaml +0 -0
  162. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/tests/data/tutorials/file_contents.txt +0 -0
  163. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/tests/data/tutorials/invalid-model.yaml +0 -0
  164. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/tests/data/tutorials/invalid-yaml.yaml +0 -0
  165. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/tests/data/tutorials/multiple-parts.yaml +0 -0
  166. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/tests/data/tutorials/named-part.yaml +0 -0
  167. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/tests/data/tutorials/prompt-confirm-default-false.yaml +0 -0
  168. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/tests/data/tutorials/prompt-confirm.yaml +0 -0
  169. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/tests/data/tutorials/prompt-enter.yaml +0 -0
  170. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/tests/data/tutorials/simple.yaml +0 -0
  171. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/tests/data/tutorials/templates.yaml +0 -0
  172. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/tests/runners/__init__.py +0 -0
  173. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/tests/runners/local/__init__.py +0 -0
  174. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/tests/runners/local/conftest.py +0 -0
  175. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/tests/runners/local/test_alternatives.py +0 -0
  176. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/tests/runners/test_base.py +0 -0
  177. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/tests/sphinx/__init__.py +0 -0
  178. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/tests/sphinx/test_get_tutorial_path.py +0 -0
  179. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/tests/test_textwrap.py +0 -0
  180. {structured_tutorials-0.1.0 → structured_tutorials-0.3.0}/tutorials/simple/simple.yaml +0 -0
@@ -14,10 +14,12 @@ jobs:
14
14
  matrix:
15
15
  os: [ ubuntu-latest ]
16
16
  python-version: [ "3.10", "3.11", "3.12", "3.13", "3.14" ]
17
- sphinx-version: [ "8.1", "8.2" ]
17
+ sphinx-version: [ "8.1", "8.2", "9.0" ]
18
18
  exclude:
19
19
  - python-version: "3.10"
20
20
  sphinx-version: "8.2"
21
+ - python-version: "3.10"
22
+ sphinx-version: "9.0"
21
23
 
22
24
  name: Python ${{ matrix.python-version }}, Sphinx ${{ matrix.sphinx-version }}
23
25
  steps:
@@ -21,7 +21,7 @@ build:
21
21
  - asdf install uv 0.9.2
22
22
  - asdf global uv 0.9.2
23
23
  install:
24
- - uv sync
24
+ - uv sync --group dev --group rtd
25
25
  pre_build:
26
26
  - ./fetch_swagger.sh
27
27
  - uv run generate-schema.py
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: structured-tutorials
3
- Version: 0.1.0
3
+ Version: 0.3.0
4
4
  Summary: Add your description here
5
5
  Project-URL: Homepage, https://structured-tutorials.readthedocs.io/
6
6
  Project-URL: Documentation, https://structured-tutorials.readthedocs.io/
@@ -27,7 +27,7 @@ Requires-Dist: jinja2>=3.1.6
27
27
  Requires-Dist: pydantic>=2.11.4
28
28
  Requires-Dist: pyyaml>=6.0.2
29
29
  Requires-Dist: sphinx-inline-tabs>=2025
30
- Requires-Dist: sphinx>=8.2.0; python_version >= '3.11'
30
+ Requires-Dist: sphinx>=8.1.0; python_version >= '3.11'
31
31
  Requires-Dist: sphinx~=8.1.0; python_version < '3.11'
32
32
  Requires-Dist: termcolor>=3.2.0
33
33
  Requires-Dist: typing-extensions>=4.6.0; python_version < '3.11'
@@ -67,14 +67,14 @@ extensions = [
67
67
  "structured_tutorials.sphinx",
68
68
  ]
69
69
 
70
- # Optional: Root directory for tutorials
71
- #tutorial_root = DOC_ROOT / "tutorials"
70
+ # Optional: Root directory for tutorials (default: location of conf.py)
71
+ #structured_tutorials_root = DOC_ROOT / "tutorials"
72
72
  ```
73
73
 
74
74
  ## Your first (trivial) tutorial
75
75
 
76
76
  To create your first tutorial, create it in `docs/tutorial.yaml` (or elsewhere, if you configured
77
- `tutorial_root` in `conf.py`):
77
+ `structured_tutorials_root` in `conf.py`):
78
78
 
79
79
  ```yaml
80
80
  parts:
@@ -107,6 +107,9 @@ Configure the tutorial that is being displayed - this will not show any output:
107
107
  ```
108
108
 
109
109
  ## TODO
110
+
111
+ * Test file existence or something like that
112
+ * Platform independent "echo" step (useful for debugging/testing)
110
113
  * Run in vagrant
111
114
 
112
115
  # License
@@ -32,14 +32,14 @@ extensions = [
32
32
  "structured_tutorials.sphinx",
33
33
  ]
34
34
 
35
- # Optional: Root directory for tutorials
36
- #tutorial_root = DOC_ROOT / "tutorials"
35
+ # Optional: Root directory for tutorials (default: location of conf.py)
36
+ #structured_tutorials_root = DOC_ROOT / "tutorials"
37
37
  ```
38
38
 
39
39
  ## Your first (trivial) tutorial
40
40
 
41
41
  To create your first tutorial, create it in `docs/tutorial.yaml` (or elsewhere, if you configured
42
- `tutorial_root` in `conf.py`):
42
+ `structured_tutorials_root` in `conf.py`):
43
43
 
44
44
  ```yaml
45
45
  parts:
@@ -72,6 +72,9 @@ Configure the tutorial that is being displayed - this will not show any output:
72
72
  ```
73
73
 
74
74
  ## TODO
75
+
76
+ * Test file existence or something like that
77
+ * Platform independent "echo" step (useful for debugging/testing)
75
78
  * Run in vagrant
76
79
 
77
80
  # License
@@ -0,0 +1,51 @@
1
+ #########
2
+ ChangeLog
3
+ #########
4
+
5
+ ******************
6
+ 0.3.0 (2025-12-26)
7
+ ******************
8
+
9
+ * Add support for Sphinx 9.0.
10
+ * Tutorials can now be configured to pass a clear environment to all processes.
11
+ * Tutorials can now configure additional environment variables passed to all processes.
12
+ * Single commands can now update the environment for all subsequent commands. Values are rendered as
13
+ templates, so you can add (parts of) the output of a command to the environment by combining a test for
14
+ the command output that uses a named pattern in a regular expression for the output.
15
+ * ``parts.{commands}.{command}.run.{chdir}`` is now a template. This allows you to change the directory based
16
+ on the output of a previous command.
17
+ * Bugfix: Individual commands marked as skipped for documentation, are now actually skipped.
18
+
19
+ ******************
20
+ 0.2.0 (2025-12-23)
21
+ ******************
22
+
23
+ Documentation
24
+ =============
25
+
26
+ * Continue reworking the documentation.
27
+ * Add option to render extra text before/after a part. The text is rendered as a template.
28
+ * Parts can now have an ID that you can reference when rendering parts to make sure that you render what
29
+ you actually think you render (useful for longer tutorials).
30
+ * Add ``structured_tutorials_context`` option to pass extra context variables to a tutorial.
31
+ * Rename the ``tutorial_root`` option to ``structured_tutorials_root``.
32
+ * rename the ``structured_tutorial_command_text_width`` option to ``structured_tutorials_command_text_width``.
33
+
34
+ Command-line
35
+ ============
36
+
37
+ * Add option ``--define {key} {value}`` to pass extra context variables.
38
+ * Greatly improve error handling.
39
+ * Parts can now have a name that is shown before running a tutorial part.
40
+ * Add option to clear the environment for a command.
41
+ * Add option to add extra environment variables for a command. Environment variables are rendered as
42
+ templates.
43
+ * Add ability to pass input to a process.
44
+ * Command output can now also be tested for line or character count. You can specify an exact match, or a
45
+ minimum and/or maximum.
46
+
47
+ ******************
48
+ 0.1.0 (2025-12-22)
49
+ ******************
50
+
51
+ Initial version.
@@ -1,5 +1,7 @@
1
1
  """Standard Sphinx configuration module."""
2
2
 
3
+ from importlib.util import find_spec
4
+
3
5
  # Configuration file for the Sphinx documentation builder.
4
6
  #
5
7
  # For the full list of built-in configuration values, see the documentation:
@@ -18,15 +20,17 @@ release = "0.1.0"
18
20
  # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
19
21
 
20
22
  extensions = [
21
- "sphinx_rtd_theme",
22
23
  "sphinxcontrib.spelling",
23
24
  "structured_tutorials.sphinx",
24
25
  "sphinx_inline_tabs",
25
26
  ]
26
- html_theme = "sphinx_rtd_theme"
27
+
28
+ if find_spec("sphinx_rtd_theme") is not None:
29
+ extensions.append("sphinx_rtd_theme")
30
+ html_theme = "sphinx_rtd_theme"
27
31
 
28
32
  DOC_ROOT = Path(__file__).parent
29
- tutorial_root = DOC_ROOT / "tutorials"
33
+ structured_tutorials_root = DOC_ROOT / "tutorials"
30
34
 
31
35
  templates_path = ["_templates"]
32
36
  exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
@@ -0,0 +1,13 @@
1
+ .. structured-tutorial:: templates/tutorial.yaml
2
+
3
+ First, create a temporary directory:
4
+
5
+ .. structured-tutorial-part:: create-directory
6
+
7
+ Then create a JSON file in it:
8
+
9
+ .. structured-tutorial-part:: create-file
10
+
11
+ You can verify the contents of the file like this:
12
+
13
+ .. structured-tutorial-part::
@@ -2,6 +2,4 @@ Configure the tutorial that is being displayed - this will not show any output:
2
2
 
3
3
  .. structured-tutorial:: quickstart/tutorial.yaml
4
4
 
5
- Render the first part:
6
-
7
5
  .. structured-tutorial-part::
@@ -6,10 +6,16 @@ Quickstart
6
6
  Installation
7
7
  ************
8
8
 
9
- To do: show how to install wheel once it exists.
9
+ **structured-tutorials** is published on `PyPI <https://pypi.org/project/structured-tutorials/>`_ and
10
+ thus can simply be installed via ``pip`` (or any other package management tool, such as
11
+ `uv <https://docs.astral.sh/uv/>`_):
10
12
 
11
- To configure Sphinx, you need to add an extension and, optionally, the root directory where the tutorials are
12
- located:
13
+ .. code-block:: console
14
+
15
+ $ pip install structured-tutorials
16
+
17
+ To render your tutorials in Sphinx, add the extension and, optionally, where your tutorials are stored
18
+ (this can be outside of the Sphinx root):
13
19
 
14
20
  .. code-block:: python
15
21
 
@@ -18,11 +24,8 @@ located:
18
24
  "structured_tutorials.sphinx",
19
25
  ]
20
26
 
21
- DOC_ROOT = Path(__file__).parent
22
-
23
- # configure the root directory where tutorials are located. Defaults to
24
- # the Sphinx source directory.
25
- tutorial_root = DOC_ROOT / "tutorials"
27
+ # Location where your tutorials are stored (default: same directory as conf.py).
28
+ #structured_tutorials_root = Path(__file__).parent / "tutorials"
26
29
 
27
30
 
28
31
  *******************
@@ -40,8 +43,12 @@ You can run this tutorial straight away:
40
43
  .. code-block:: console
41
44
 
42
45
  user@host:~/example/$ structured-tutorial docs/tutorials/quickstart/tutorial.yaml
46
+ Running part 0...
47
+ + structured-tutorial --help
43
48
  usage: structured-tutorial [-h] path
44
49
  ...
50
+ + echo "Finished running example tutorial."
51
+ Finished running example tutorial.
45
52
 
46
53
  Finally, you can render the tutorial in your Sphinx tutorial:
47
54
 
@@ -54,58 +61,63 @@ In fact, above lines are included below, so this is how this tutorial will rende
54
61
  .. include:: /include/quickstart.rst
55
62
 
56
63
  ***********************
57
- Tutorials are templates
64
+ A more advanced example
58
65
  ***********************
59
66
 
60
- Commands as well as output are rendered using `Jinja <https://jinja.palletsprojects.com/en/stable/>`_
61
- templates. This allows you to reduce repetition of values or cases where a tutorial should behave differently
62
- from runtime when rendering documentation.
63
-
64
- The following example will create a directory, writes to a file in it and outputs the contents of said file:
65
-
66
- .. literalinclude:: /tutorials/templates/tutorial.yaml
67
- :caption: docs/tutorials/templates/tutorial.yaml
68
- :language: yaml
69
-
70
- This is how the documentation renders:
71
-
72
- .. structured-tutorial:: templates/tutorial.yaml
73
-
74
- .. structured-tutorial-part::
67
+ The above is nice but not very useful. Let's show you a few new cool features next.
75
68
 
76
- However, when running, you will just get:
69
+ Commands, output, file contents and many other parts are rendered using `Jinja templates
70
+ <https://jinja.palletsprojects.com/en/stable/>`_. This allows you to reduce repetition of and use different
71
+ values for documentation and runtime.
77
72
 
78
- .. code-block:: console
73
+ Tutorials can create files (that are shown appropriately in your documentation). The tutorial below shows you
74
+ how to create a JSON file that shows up with proper syntax highlighting.
79
75
 
80
- user@host:~$ structured-tutorial docs/tutorials/templates/tutorial.yaml
81
- real data
76
+ You can test success of a command by checking the status code, output or even if a TCP port was
77
+ opened. When checking the output, you can use regular expressions for matching and even named patterns to
78
+ update the context with runtime data. Below we create a temporary directory with ``mktemp`` and use it
79
+ later to create the file in it.
82
80
 
83
- ***************************
84
- Tutorials can contain files
85
- ***************************
81
+ The following example will create a directory, writes to a file in it and outputs its contents:
86
82
 
87
- Tutorials can contain files that are also rendered as templates.
83
+ .. literalinclude:: /tutorials/templates/tutorial.yaml
84
+ :caption: docs/tutorials/templates/tutorial.yaml
85
+ :language: yaml
88
86
 
89
- The following example tutorial could be used to instruct the user to create a JSON file in
90
- ``/tmp/example.json`` and then call ``python`` to verify the syntax.
87
+ Render this tutorial
88
+ ====================
91
89
 
92
- Using this YAML file:
90
+ The code in your reStructuredText doesn't look much different. You render three parts, and the first two
91
+ reference the id you have given them in the YAML file.
93
92
 
94
- .. literalinclude:: /tutorials/simple-file/tutorial.yaml
95
- :caption: docs/tutorials/simple-file/tutorial.yaml
96
- :language: yaml
93
+ .. literalinclude:: /include/quickstart-more-features.rst
94
+ :caption: docs/tutorial.rst
95
+ :language: rst
97
96
 
98
- you could render a Tutorial like this:
97
+ The above file is included below.
99
98
 
100
- .. structured-tutorial:: simple-file/tutorial.yaml
99
+ .. include:: /include/quickstart-more-features.rst
101
100
 
102
- Create a configuration file with the following contents:
101
+ Run this tutorial
102
+ =================
103
103
 
104
- .. structured-tutorial-part::
104
+ When running this tutorial, it'll do what you instructed the user to do: Create a temporary directory, then a
105
+ JSON file in it, and then output it. Cleanup is assured through the cleanup directive, even if one of the
106
+ commands would fail:
105
107
 
106
- and make sure it is valid JSON:
108
+ .. code-block:: console
107
109
 
108
- .. structured-tutorial-part::
110
+ user@host:~/example/$ structured-tutorial docs/tutorials/templates/tutorial.yaml
111
+ Running part create-directory...
112
+ + mktemp -d
113
+ Running part create-file...
114
+ Running part 2...
115
+ + cat /tmp/tmp.6G6S9dX0MN/example.txt
116
+ {"key": "run"}
117
+ + cat /tmp/tmp.6G6S9dX0MN/example.txt | python -m json.tool
118
+ ...
119
+ INFO | Running cleanup commands.
120
+ + rm -r /tmp/tmp.6G6S9dX0M
109
121
 
110
122
  ********************************************
111
123
  Generating documentation out of the tutorial
@@ -6,3 +6,5 @@ sudo
6
6
  hostname
7
7
  cwd
8
8
  backend
9
+ reStructuredText
10
+ bugfix
@@ -5,4 +5,6 @@ parts:
5
5
  output: |
6
6
  usage: structured-tutorial [-h] path
7
7
  ...
8
- - command: ls
8
+ - command: echo "Finished running example tutorial."
9
+ doc:
10
+ text_before: "This shows your first tutorial:"
@@ -0,0 +1,39 @@
1
+ configuration:
2
+ context: # context shared between documentation and runtime
3
+ filename: example.json
4
+ doc: # template context at runtime
5
+ context:
6
+ dest: /tmp/tmp...
7
+ contents: '{"key": "doc"}'
8
+ run: # template context at runtime
9
+ context:
10
+ # dest is captured and added to the context by mktemp at runtime
11
+ contents: '{"key": "run"}'
12
+ parts:
13
+ - id: create-directory
14
+ commands:
15
+ - command: mktemp -d
16
+ doc:
17
+ output: "{{ dest }}"
18
+ run:
19
+ show_output: false
20
+ test:
21
+ # Capture the whole output and add it to the context
22
+ - regex: (?P<dest>.*)
23
+ cleanup:
24
+ # Remove temporary directory after running the tutorial
25
+ - command: rm -rf {{ dest }}
26
+ - id: create-file
27
+ contents: "{{ contents }}\n"
28
+ destination: "{{ dest }}/{{ filename }}"
29
+ doc:
30
+ language: json
31
+ # If you use sphinxcontrib-spelling, make sure the filename is not spell-checked
32
+ ignore_spelling: true
33
+ - commands:
34
+ - command: cat {{ dest }}/{{ filename }}
35
+ doc:
36
+ output: "{{ contents }}"
37
+ - command: cat {{ dest }}/{{ filename }} | python -m json.tool
38
+ doc:
39
+ output: ...