structured-tutorials 0.1.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 (150) hide show
  1. structured_tutorials-0.1.0/.editorconfig +17 -0
  2. structured_tutorials-0.1.0/.github/workflows/docs.yml +43 -0
  3. structured_tutorials-0.1.0/.github/workflows/mypy.yml +35 -0
  4. structured_tutorials-0.1.0/.github/workflows/quality.yml +37 -0
  5. structured_tutorials-0.1.0/.github/workflows/tests.yml +45 -0
  6. structured_tutorials-0.1.0/.github/workflows/wheel.yml +32 -0
  7. structured_tutorials-0.1.0/.gitignore +22 -0
  8. structured_tutorials-0.1.0/.readthedocs.yaml +44 -0
  9. structured_tutorials-0.1.0/LICENSE +21 -0
  10. structured_tutorials-0.1.0/PKG-INFO +114 -0
  11. structured_tutorials-0.1.0/README.md +79 -0
  12. structured_tutorials-0.1.0/docs/Makefile +20 -0
  13. structured_tutorials-0.1.0/docs/_static/.gitkeep +0 -0
  14. structured_tutorials-0.1.0/docs/changelog.rst +9 -0
  15. structured_tutorials-0.1.0/docs/conf.py +41 -0
  16. structured_tutorials-0.1.0/docs/dev.rst +19 -0
  17. structured_tutorials-0.1.0/docs/how-tos.rst +185 -0
  18. structured_tutorials-0.1.0/docs/include/quickstart.rst +7 -0
  19. structured_tutorials-0.1.0/docs/index.rst +23 -0
  20. structured_tutorials-0.1.0/docs/make.bat +35 -0
  21. structured_tutorials-0.1.0/docs/quickstart.rst +278 -0
  22. structured_tutorials-0.1.0/docs/reference.rst +16 -0
  23. structured_tutorials-0.1.0/docs/spelling_wordlist.txt +8 -0
  24. structured_tutorials-0.1.0/docs/tutorials/alternatives/tutorial.yaml +28 -0
  25. structured_tutorials-0.1.0/docs/tutorials/cleanup/tutorial.yaml +6 -0
  26. structured_tutorials-0.1.0/docs/tutorials/cleanup-multiple/tutorial.yaml +11 -0
  27. structured_tutorials-0.1.0/docs/tutorials/command-as-list/tutorial.yaml +8 -0
  28. structured_tutorials-0.1.0/docs/tutorials/context/tutorial.yaml +15 -0
  29. structured_tutorials-0.1.0/docs/tutorials/default-context/tutorial.yaml +8 -0
  30. structured_tutorials-0.1.0/docs/tutorials/doc-or-runtime/tutorial.yaml +3 -0
  31. structured_tutorials-0.1.0/docs/tutorials/echo/tutorial.yaml +5 -0
  32. structured_tutorials-0.1.0/docs/tutorials/exit_code/tutorial.yaml +6 -0
  33. structured_tutorials-0.1.0/docs/tutorials/file/tutorial.yaml +4 -0
  34. structured_tutorials-0.1.0/docs/tutorials/file-copy/tutorial.yaml +29 -0
  35. structured_tutorials-0.1.0/docs/tutorials/file-full-example/tutorial.yaml +19 -0
  36. structured_tutorials-0.1.0/docs/tutorials/git-export/tutorial.yaml +9 -0
  37. structured_tutorials-0.1.0/docs/tutorials/interactive-prompt/tutorial.yaml +20 -0
  38. structured_tutorials-0.1.0/docs/tutorials/long-commands/tutorial.yaml +23 -0
  39. structured_tutorials-0.1.0/docs/tutorials/prompt/tutorial.yaml +19 -0
  40. structured_tutorials-0.1.0/docs/tutorials/quickstart/tutorial.yaml +8 -0
  41. structured_tutorials-0.1.0/docs/tutorials/simple-file/tutorial.yaml +18 -0
  42. structured_tutorials-0.1.0/docs/tutorials/skip-part-doc/tutorial.yaml +14 -0
  43. structured_tutorials-0.1.0/docs/tutorials/skip-part-run/tutorial.yaml +20 -0
  44. structured_tutorials-0.1.0/docs/tutorials/templates/tutorial.yaml +19 -0
  45. structured_tutorials-0.1.0/docs/tutorials/temporary-directory/tutorial.yaml +9 -0
  46. structured_tutorials-0.1.0/docs/tutorials/test-command/tutorial.yaml +9 -0
  47. structured_tutorials-0.1.0/docs/tutorials/test-output/tutorial.yaml +21 -0
  48. structured_tutorials-0.1.0/docs/tutorials/test-port/tutorial.yaml +16 -0
  49. structured_tutorials-0.1.0/fetch_swagger.sh +6 -0
  50. structured_tutorials-0.1.0/generate-schema.py +70 -0
  51. structured_tutorials-0.1.0/htmlcov/.gitignore +2 -0
  52. structured_tutorials-0.1.0/htmlcov/class_index.html +1123 -0
  53. structured_tutorials-0.1.0/htmlcov/coverage_html_cb_6fb7b396.js +733 -0
  54. structured_tutorials-0.1.0/htmlcov/coverage_html_cb_bcae5fc4.js +735 -0
  55. structured_tutorials-0.1.0/htmlcov/favicon_32_cb_58284776.png +0 -0
  56. structured_tutorials-0.1.0/htmlcov/function_index.html +1228 -0
  57. structured_tutorials-0.1.0/htmlcov/index.html +395 -0
  58. structured_tutorials-0.1.0/htmlcov/keybd_closed_cb_ce680311.png +0 -0
  59. structured_tutorials-0.1.0/htmlcov/status.json +1 -0
  60. structured_tutorials-0.1.0/htmlcov/style_cb_6b508a39.css +377 -0
  61. structured_tutorials-0.1.0/htmlcov/style_cb_8432e98f.css +385 -0
  62. structured_tutorials-0.1.0/htmlcov/style_cb_8e611ae1.css +337 -0
  63. structured_tutorials-0.1.0/htmlcov/style_cb_a5a05ca4.css +389 -0
  64. structured_tutorials-0.1.0/htmlcov/z_0ce4b8b40d14c0ec___init___py.html +113 -0
  65. structured_tutorials-0.1.0/htmlcov/z_0ce4b8b40d14c0ec_base_py.html +196 -0
  66. structured_tutorials-0.1.0/htmlcov/z_0ce4b8b40d14c0ec_parts_py.html +326 -0
  67. structured_tutorials-0.1.0/htmlcov/z_0ce4b8b40d14c0ec_tests_py.html +139 -0
  68. structured_tutorials-0.1.0/htmlcov/z_0ce4b8b40d14c0ec_tutorial_py.html +249 -0
  69. structured_tutorials-0.1.0/htmlcov/z_0ce4b8b40d14c0ec_validators_py.html +113 -0
  70. structured_tutorials-0.1.0/htmlcov/z_10746939a1c77e4c___init___py.html +134 -0
  71. structured_tutorials-0.1.0/htmlcov/z_10746939a1c77e4c_directives_py.html +178 -0
  72. structured_tutorials-0.1.0/htmlcov/z_10746939a1c77e4c_textwrap_py.html +175 -0
  73. structured_tutorials-0.1.0/htmlcov/z_10746939a1c77e4c_utils_py.html +301 -0
  74. structured_tutorials-0.1.0/htmlcov/z_1b8c1a89abcc896b___init___py.html +101 -0
  75. structured_tutorials-0.1.0/htmlcov/z_1b8c1a89abcc896b_base_py.html +214 -0
  76. structured_tutorials-0.1.0/htmlcov/z_1b8c1a89abcc896b_local_py.html +353 -0
  77. structured_tutorials-0.1.0/htmlcov/z_3b10c79445bd681b___init___py.html +108 -0
  78. structured_tutorials-0.1.0/htmlcov/z_3b10c79445bd681b_cli_py.html +182 -0
  79. structured_tutorials-0.1.0/htmlcov/z_3b10c79445bd681b_errors_py.html +139 -0
  80. structured_tutorials-0.1.0/htmlcov/z_3b10c79445bd681b_models_py.html +497 -0
  81. structured_tutorials-0.1.0/htmlcov/z_3b10c79445bd681b_output_py.html +238 -0
  82. structured_tutorials-0.1.0/htmlcov/z_3b10c79445bd681b_textwrap_py.html +195 -0
  83. structured_tutorials-0.1.0/htmlcov/z_3b10c79445bd681b_tutorial_py.html +138 -0
  84. structured_tutorials-0.1.0/htmlcov/z_3b10c79445bd681b_typing_py.html +114 -0
  85. structured_tutorials-0.1.0/htmlcov/z_3b10c79445bd681b_utils_py.html +177 -0
  86. structured_tutorials-0.1.0/pyproject.toml +147 -0
  87. structured_tutorials-0.1.0/structured_tutorials/__init__.py +9 -0
  88. structured_tutorials-0.1.0/structured_tutorials/cli.py +83 -0
  89. structured_tutorials-0.1.0/structured_tutorials/errors.py +40 -0
  90. structured_tutorials-0.1.0/structured_tutorials/models/__init__.py +14 -0
  91. structured_tutorials-0.1.0/structured_tutorials/models/base.py +97 -0
  92. structured_tutorials-0.1.0/structured_tutorials/models/parts.py +227 -0
  93. structured_tutorials-0.1.0/structured_tutorials/models/tests.py +40 -0
  94. structured_tutorials-0.1.0/structured_tutorials/models/tutorial.py +150 -0
  95. structured_tutorials-0.1.0/structured_tutorials/models/validators.py +14 -0
  96. structured_tutorials-0.1.0/structured_tutorials/output.py +139 -0
  97. structured_tutorials-0.1.0/structured_tutorials/runners/__init__.py +2 -0
  98. structured_tutorials-0.1.0/structured_tutorials/runners/base.py +115 -0
  99. structured_tutorials-0.1.0/structured_tutorials/runners/local.py +254 -0
  100. structured_tutorials-0.1.0/structured_tutorials/sphinx/__init__.py +35 -0
  101. structured_tutorials-0.1.0/structured_tutorials/sphinx/directives.py +79 -0
  102. structured_tutorials-0.1.0/structured_tutorials/sphinx/utils.py +202 -0
  103. structured_tutorials-0.1.0/structured_tutorials/templates/alternative_part.rst.template +5 -0
  104. structured_tutorials-0.1.0/structured_tutorials/templates/file_part.rst.template +8 -0
  105. structured_tutorials-0.1.0/structured_tutorials/textwrap.py +96 -0
  106. structured_tutorials-0.1.0/structured_tutorials/typing.py +15 -0
  107. structured_tutorials-0.1.0/structured_tutorials/utils.py +78 -0
  108. structured_tutorials-0.1.0/tests/__init__.py +0 -0
  109. structured_tutorials-0.1.0/tests/conftest.py +121 -0
  110. structured_tutorials-0.1.0/tests/data/docs/conf.py +31 -0
  111. structured_tutorials-0.1.0/tests/data/docs/index.rst +12 -0
  112. structured_tutorials-0.1.0/tests/data/tutorials/alternatives-files.yaml +9 -0
  113. structured_tutorials-0.1.0/tests/data/tutorials/alternatives.yaml +9 -0
  114. structured_tutorials-0.1.0/tests/data/tutorials/command-as-list.yaml +8 -0
  115. structured_tutorials-0.1.0/tests/data/tutorials/command-hide-output.yaml +11 -0
  116. structured_tutorials-0.1.0/tests/data/tutorials/command-simple.yaml +3 -0
  117. structured_tutorials-0.1.0/tests/data/tutorials/command-stdin.yaml +27 -0
  118. structured_tutorials-0.1.0/tests/data/tutorials/command-test-output.yaml +8 -0
  119. structured_tutorials-0.1.0/tests/data/tutorials/command-with-chdir.yaml +5 -0
  120. structured_tutorials-0.1.0/tests/data/tutorials/empty.yaml +1 -0
  121. structured_tutorials-0.1.0/tests/data/tutorials/file-contents-destination-dir.yaml +8 -0
  122. structured_tutorials-0.1.0/tests/data/tutorials/file-copy-destination-dir.yaml +4 -0
  123. structured_tutorials-0.1.0/tests/data/tutorials/file_contents.txt +1 -0
  124. structured_tutorials-0.1.0/tests/data/tutorials/invalid-model.yaml +2 -0
  125. structured_tutorials-0.1.0/tests/data/tutorials/invalid-yaml.yaml +2 -0
  126. structured_tutorials-0.1.0/tests/data/tutorials/multiple-parts.yaml +16 -0
  127. structured_tutorials-0.1.0/tests/data/tutorials/named-part.yaml +6 -0
  128. structured_tutorials-0.1.0/tests/data/tutorials/prompt-confirm-default-false.yaml +4 -0
  129. structured_tutorials-0.1.0/tests/data/tutorials/prompt-confirm.yaml +3 -0
  130. structured_tutorials-0.1.0/tests/data/tutorials/prompt-enter.yaml +2 -0
  131. structured_tutorials-0.1.0/tests/data/tutorials/simple.yaml +6 -0
  132. structured_tutorials-0.1.0/tests/data/tutorials/templates.yaml +10 -0
  133. structured_tutorials-0.1.0/tests/runners/__init__.py +0 -0
  134. structured_tutorials-0.1.0/tests/runners/local/__init__.py +2 -0
  135. structured_tutorials-0.1.0/tests/runners/local/conftest.py +21 -0
  136. structured_tutorials-0.1.0/tests/runners/local/test_alternatives.py +49 -0
  137. structured_tutorials-0.1.0/tests/runners/local/test_command.py +201 -0
  138. structured_tutorials-0.1.0/tests/runners/local/test_local.py +165 -0
  139. structured_tutorials-0.1.0/tests/runners/local/test_prompt.py +114 -0
  140. structured_tutorials-0.1.0/tests/runners/test_base.py +35 -0
  141. structured_tutorials-0.1.0/tests/sphinx/__init__.py +0 -0
  142. structured_tutorials-0.1.0/tests/sphinx/test_app.py +42 -0
  143. structured_tutorials-0.1.0/tests/sphinx/test_build.py +15 -0
  144. structured_tutorials-0.1.0/tests/sphinx/test_get_tutorial_path.py +43 -0
  145. structured_tutorials-0.1.0/tests/sphinx/test_wrapper.py +320 -0
  146. structured_tutorials-0.1.0/tests/test_cli.py +76 -0
  147. structured_tutorials-0.1.0/tests/test_models.py +173 -0
  148. structured_tutorials-0.1.0/tests/test_textwrap.py +120 -0
  149. structured_tutorials-0.1.0/tutorials/simple/simple.yaml +5 -0
  150. structured_tutorials-0.1.0/uv.lock +1288 -0
@@ -0,0 +1,17 @@
1
+ [*]
2
+ end_of_line = lf
3
+ trim_trailing_whitespace = true
4
+ charset = utf-8
5
+
6
+ [*.{py,pyi}]
7
+ indent_style = space
8
+ indent_size = 4
9
+
10
+ [*.rst]
11
+ insert_final_newline = true
12
+ max_line_length = 110
13
+ ij_wrap_on_typing = true
14
+
15
+ [*.{yaml,yml}]
16
+ indent_style = space
17
+ indent_size = 2
@@ -0,0 +1,43 @@
1
+ name: Documentation
2
+ on:
3
+ push:
4
+ pull_request:
5
+
6
+ env:
7
+ UV_PYTHON_PREFERENCE: only-system
8
+ UV_NO_SYNC: 1
9
+ SWAGGER_UI_RELEASE: "5.30.3"
10
+
11
+ jobs:
12
+ run:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - name: Acquire sources
16
+ uses: actions/checkout@v4.2.2
17
+ with:
18
+ fetch-depth: 0
19
+ - name: Setup Python
20
+ uses: actions/setup-python@v5.5.0
21
+ with:
22
+ python-version: "3.14"
23
+ architecture: x64
24
+ - name: Install uv
25
+ uses: astral-sh/setup-uv@v5.3.1
26
+ with:
27
+ enable-cache: true
28
+ - name: Install dependencies
29
+ run: uv sync
30
+ - name: doc8 style checks
31
+ run: uv run doc8 docs/
32
+
33
+ # Generate Swagger UI docs
34
+ - name: Fetch Swagger UI
35
+ run: ./fetch_swagger.sh
36
+ - name: Generate schema
37
+ run: uv run generate-schema.py
38
+
39
+ # Finally, generate Sphinx docs
40
+ - name: Spelling
41
+ run: uv run make -C docs spelling
42
+ - name: Generate documentation
43
+ run: uv run make -C docs html
@@ -0,0 +1,35 @@
1
+ name: type checking
2
+ on:
3
+ push:
4
+ pull_request:
5
+
6
+ env:
7
+ UV_PYTHON_PREFERENCE: only-system
8
+ UV_NO_SYNC: 1
9
+
10
+ jobs:
11
+ run:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+
15
+ - name: Acquire sources
16
+ uses: actions/checkout@v4.2.2
17
+ with:
18
+ fetch-depth: 0
19
+
20
+ - name: Setup Python
21
+ uses: actions/setup-python@v5.5.0
22
+ with:
23
+ python-version: "3.14"
24
+ architecture: x64
25
+
26
+ - name: Install uv
27
+ uses: astral-sh/setup-uv@v5.3.1
28
+ with:
29
+ enable-cache: true
30
+
31
+ - name: Install dependencies
32
+ run: uv sync
33
+
34
+ - name: run mypy
35
+ run: uv run mypy .
@@ -0,0 +1,37 @@
1
+ name: Code quality
2
+ on:
3
+ push:
4
+ pull_request:
5
+
6
+ env:
7
+ UV_PYTHON_PREFERENCE: only-system
8
+ UV_NO_SYNC: 1
9
+
10
+ jobs:
11
+ run:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - name: Acquire sources
15
+ uses: actions/checkout@v4.2.2
16
+ with:
17
+ fetch-depth: 0
18
+
19
+ - name: Setup Python
20
+ uses: actions/setup-python@v5.5.0
21
+ with:
22
+ python-version: "3.14"
23
+ architecture: x64
24
+
25
+ - name: Install uv
26
+ uses: astral-sh/setup-uv@v5.3.1
27
+ with:
28
+ enable-cache: true
29
+
30
+ - name: Install dependencies
31
+ run: uv sync
32
+
33
+ - name: Ruff format
34
+ run: uv run ruff format --diff
35
+
36
+ - name: Ruff check
37
+ run: uv run ruff check
@@ -0,0 +1,45 @@
1
+ name: Tests
2
+ on:
3
+ push:
4
+ pull_request:
5
+
6
+ env:
7
+ UV_PYTHON_PREFERENCE: only-system
8
+ UV_NO_SYNC: 1
9
+
10
+ jobs:
11
+ run:
12
+ runs-on: ${{ matrix.os }}
13
+ strategy:
14
+ matrix:
15
+ os: [ ubuntu-latest ]
16
+ python-version: [ "3.10", "3.11", "3.12", "3.13", "3.14" ]
17
+ sphinx-version: [ "8.1", "8.2" ]
18
+ exclude:
19
+ - python-version: "3.10"
20
+ sphinx-version: "8.2"
21
+
22
+ name: Python ${{ matrix.python-version }}, Sphinx ${{ matrix.sphinx-version }}
23
+ steps:
24
+
25
+ - name: Acquire sources
26
+ uses: actions/checkout@v4.2.2
27
+ with:
28
+ fetch-depth: 0
29
+
30
+ - name: Setup Python
31
+ uses: actions/setup-python@v5.5.0
32
+ with:
33
+ python-version: ${{ matrix.python-version }}
34
+ architecture: x64
35
+
36
+ - name: Install uv
37
+ uses: astral-sh/setup-uv@v5.3.1
38
+ with:
39
+ enable-cache: true
40
+
41
+ - name: Install dependencies
42
+ run: uv sync --no-default-groups --group=dev --group Sphinx${{ matrix.sphinx-version }}
43
+
44
+ - name: Run tests
45
+ run: uv run pytest -v --cov-report term-missing --durations=20
@@ -0,0 +1,32 @@
1
+ name: Wheel
2
+ on:
3
+ push:
4
+ pull_request:
5
+
6
+ env:
7
+ UV_PYTHON_PREFERENCE: only-system
8
+ UV_NO_SYNC: 1
9
+
10
+ jobs:
11
+ build:
12
+ name: Build wheel
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - name: Acquire sources
16
+ uses: actions/checkout@v4.2.2
17
+ with:
18
+ fetch-depth: 0
19
+
20
+ - name: Setup Python
21
+ uses: actions/setup-python@v5.5.0
22
+ with:
23
+ python-version: "3.14"
24
+ architecture: x64
25
+
26
+ - name: Install uv
27
+ uses: astral-sh/setup-uv@v5.3.1
28
+ with:
29
+ enable-cache: true
30
+
31
+ - name: Build wheel
32
+ run: uv build
@@ -0,0 +1,22 @@
1
+ # Python-generated files
2
+ __pycache__/
3
+ *.py[oc]
4
+ build/
5
+ dist/
6
+ wheels/
7
+ *.egg-info
8
+ tests/data/docs/_build/
9
+
10
+ # Virtual environments
11
+ .venv
12
+
13
+ # Documentation
14
+ /docs/_build/
15
+ /docs/_static/swagger-ui/
16
+ /*.tar.gz
17
+
18
+ # Coverage
19
+ /.coverage
20
+
21
+ # IntelliJ products (PyCharm)
22
+ .idea/
@@ -0,0 +1,44 @@
1
+
2
+
3
+ # Read the Docs configuration file
4
+ # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
5
+
6
+ # Required
7
+ version: 2
8
+
9
+ # Set the OS, Python version, and other tools you might need
10
+ build:
11
+ os: ubuntu-24.04
12
+ tools:
13
+ python: "3.13"
14
+ jobs:
15
+ post_checkout:
16
+ - git fetch --unshallow || true
17
+ - git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*' || true
18
+ - git fetch --all --tags || true
19
+ create_environment:
20
+ - asdf plugin add uv
21
+ - asdf install uv 0.9.2
22
+ - asdf global uv 0.9.2
23
+ install:
24
+ - uv sync
25
+ pre_build:
26
+ - ./fetch_swagger.sh
27
+ - uv run generate-schema.py
28
+ build:
29
+ html:
30
+ - uv run sphinx-build -T -b html docs/ $READTHEDOCS_OUTPUT/html
31
+
32
+ # Build documentation in the "docs/" directory with Sphinx
33
+ sphinx:
34
+ configuration: docs/conf.py
35
+
36
+ # Optionally, but recommended,
37
+ # declare the Python requirements required to build your documentation
38
+ # See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
39
+ # python:
40
+ # install:
41
+ # - requirements: docs/requirements.txt
42
+
43
+
44
+
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Mathias Ertl
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
13
+ all 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
21
+ THE SOFTWARE.
@@ -0,0 +1,114 @@
1
+ Metadata-Version: 2.4
2
+ Name: structured-tutorials
3
+ Version: 0.1.0
4
+ Summary: Add your description here
5
+ Project-URL: Homepage, https://structured-tutorials.readthedocs.io/
6
+ Project-URL: Documentation, https://structured-tutorials.readthedocs.io/
7
+ Project-URL: Source, https://github.com/mathiasertl/structured-tutorials
8
+ Project-URL: Issues, https://github.com/mathiasertl/structured-tutorials/issues
9
+ Project-URL: Changelog, https://structured-tutorials.readthedocs.io/en/latest/changelog.html
10
+ License-Expression: MIT
11
+ License-File: LICENSE
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Framework :: Sphinx :: Extension
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3 :: Only
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Programming Language :: Python :: 3.14
22
+ Classifier: Topic :: Documentation :: Sphinx
23
+ Classifier: Typing :: Typed
24
+ Requires-Python: >=3.10
25
+ Requires-Dist: colorama>=0.4.6
26
+ Requires-Dist: jinja2>=3.1.6
27
+ Requires-Dist: pydantic>=2.11.4
28
+ Requires-Dist: pyyaml>=6.0.2
29
+ Requires-Dist: sphinx-inline-tabs>=2025
30
+ Requires-Dist: sphinx>=8.2.0; python_version >= '3.11'
31
+ Requires-Dist: sphinx~=8.1.0; python_version < '3.11'
32
+ Requires-Dist: termcolor>=3.2.0
33
+ Requires-Dist: typing-extensions>=4.6.0; python_version < '3.11'
34
+ Description-Content-Type: text/markdown
35
+
36
+ # structured-tutorials
37
+
38
+ ![image](https://github.com/mathiasertl/structured-tutorials/workflows/Tests/badge.svg)
39
+ ![image](https://img.shields.io/pypi/v/structured-tutorials.svg)
40
+ ![image](https://img.shields.io/pypi/dm/structured-tutorials.svg)
41
+ ![image](https://img.shields.io/pypi/pyversions/structured-tutorials.svg)
42
+ ![image](https://img.shields.io/github/license/mathiasertl/structured-tutorials)
43
+
44
+ `structured-tutorials` allows you to write tutorials that can be rendered as documentation and run on your
45
+ system to verify correctness.
46
+
47
+ With `structured-tutorials` you to specify steps in a configuration file. A Sphinx plugin allows you to
48
+ render those commands in your project documentation. A command-line tool can load the configuration file and
49
+ run it on your local system.
50
+
51
+ Please see the [official documentation](https://structured-tutorials.readthedocs.io/) for more detailed
52
+ information.
53
+
54
+ ## Installation / Setup
55
+
56
+ Install `structured-tutorials`:
57
+
58
+ ```
59
+ pip install structured-tutorials
60
+ ```
61
+
62
+ and configure Sphinx:
63
+
64
+ ```python
65
+ extensions = [
66
+ # ... other extensions
67
+ "structured_tutorials.sphinx",
68
+ ]
69
+
70
+ # Optional: Root directory for tutorials
71
+ #tutorial_root = DOC_ROOT / "tutorials"
72
+ ```
73
+
74
+ ## Your first (trivial) tutorial
75
+
76
+ To create your first tutorial, create it in `docs/tutorial.yaml` (or elsewhere, if you configured
77
+ `tutorial_root` in `conf.py`):
78
+
79
+ ```yaml
80
+ parts:
81
+ - commands:
82
+ - command: structured-tutorial --help
83
+ doc:
84
+ output: |
85
+ usage: structured-tutorial [-h] path
86
+ ...
87
+ ```
88
+
89
+ ### Run the tutorial
90
+
91
+ Run the tutorial with:
92
+
93
+ ```
94
+ $ structured-tutorial docs/tutorials/quickstart/tutorial.yaml
95
+ usage: structured-tutorial [-h] path
96
+ ...
97
+ ```
98
+
99
+ ### Render tutorial in Sphinx:
100
+
101
+ Configure the tutorial that is being displayed - this will not show any output:
102
+
103
+ ```
104
+ .. structured-tutorial:: quickstart/tutorial.yaml
105
+
106
+ .. structured-tutorial-part::
107
+ ```
108
+
109
+ ## TODO
110
+ * Run in vagrant
111
+
112
+ # License
113
+
114
+ This project is licensed under the MIT License. See LICENSE file for details.
@@ -0,0 +1,79 @@
1
+ # structured-tutorials
2
+
3
+ ![image](https://github.com/mathiasertl/structured-tutorials/workflows/Tests/badge.svg)
4
+ ![image](https://img.shields.io/pypi/v/structured-tutorials.svg)
5
+ ![image](https://img.shields.io/pypi/dm/structured-tutorials.svg)
6
+ ![image](https://img.shields.io/pypi/pyversions/structured-tutorials.svg)
7
+ ![image](https://img.shields.io/github/license/mathiasertl/structured-tutorials)
8
+
9
+ `structured-tutorials` allows you to write tutorials that can be rendered as documentation and run on your
10
+ system to verify correctness.
11
+
12
+ With `structured-tutorials` you to specify steps in a configuration file. A Sphinx plugin allows you to
13
+ render those commands in your project documentation. A command-line tool can load the configuration file and
14
+ run it on your local system.
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
+
74
+ ## TODO
75
+ * Run in vagrant
76
+
77
+ # License
78
+
79
+ This project is licensed under the MIT License. See LICENSE file for details.
@@ -0,0 +1,20 @@
1
+ # Minimal makefile for Sphinx documentation
2
+ #
3
+
4
+ # You can set these variables from the command line, and also
5
+ # from the environment for the first two.
6
+ SPHINXOPTS ?=
7
+ SPHINXBUILD ?= sphinx-build
8
+ SOURCEDIR = .
9
+ BUILDDIR = _build
10
+
11
+ # Put it first so that "make" without argument is like "make help".
12
+ help:
13
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14
+
15
+ .PHONY: help Makefile
16
+
17
+ # Catch-all target: route all unknown targets to Sphinx using the new
18
+ # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19
+ %: Makefile
20
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) -W -n $(O)
File without changes
@@ -0,0 +1,9 @@
1
+ #########
2
+ ChangeLog
3
+ #########
4
+
5
+ ***********
6
+ 0.1.0 (TBR)
7
+ ***********
8
+
9
+ Initial version.
@@ -0,0 +1,41 @@
1
+ """Standard Sphinx configuration module."""
2
+
3
+ # Configuration file for the Sphinx documentation builder.
4
+ #
5
+ # For the full list of built-in configuration values, see the documentation:
6
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html
7
+ from pathlib import Path
8
+
9
+ # -- Project information -----------------------------------------------------
10
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
11
+
12
+ project = "structured-tutorials"
13
+ copyright = "2025, Mathias Ertl"
14
+ author = "Mathias Ertl"
15
+ release = "0.1.0"
16
+
17
+ # -- General configuration ---------------------------------------------------
18
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
19
+
20
+ extensions = [
21
+ "sphinx_rtd_theme",
22
+ "sphinxcontrib.spelling",
23
+ "structured_tutorials.sphinx",
24
+ "sphinx_inline_tabs",
25
+ ]
26
+ html_theme = "sphinx_rtd_theme"
27
+
28
+ DOC_ROOT = Path(__file__).parent
29
+ tutorial_root = DOC_ROOT / "tutorials"
30
+
31
+ templates_path = ["_templates"]
32
+ exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
33
+
34
+ # Nitpicky mode warns about references where the target cannot be found.
35
+ nitpicky = True
36
+
37
+ # -- Options for HTML output -------------------------------------------------
38
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
39
+
40
+ # html_theme = "alabaster"
41
+ html_static_path = ["_static"]
@@ -0,0 +1,19 @@
1
+ ###########
2
+ Development
3
+ ###########
4
+
5
+ ***************
6
+ Swagger UI docs
7
+ ***************
8
+
9
+ To generate the Swagger UI documentation locally
10
+
11
+ * Download the `latest release <https://github.com/swagger-api/swagger-ui/releases>`_.
12
+ * Extract the `dist` folder:
13
+
14
+ .. code-block:: console
15
+
16
+ tar xf v5.30.3.tar.gz -C docs/_static/ --strip=1 swagger-ui-5.30.3/dist/ --transform s/dist/swagger-ui/
17
+
18
+ * Generate schema:
19
+