clear-skies-doc-builder 2.0.5__tar.gz → 2.0.7__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 (59) hide show
  1. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/.copier-answers.yml +1 -1
  2. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/.github/workflows/create-version.yaml +1 -1
  3. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/.github/workflows/run-tests.yml +2 -1
  4. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/.github/workflows/tests-matrix.yaml +6 -19
  5. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/.pre-commit-config.yaml +0 -7
  6. clear_skies_doc_builder-2.0.7/.vscode/settings.json +21 -0
  7. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/CHANGELOG.md +21 -0
  8. clear_skies_doc_builder-2.0.7/LATEST_CHANGELOG.md +5 -0
  9. clear_skies_doc_builder-2.0.7/PKG-INFO +165 -0
  10. clear_skies_doc_builder-2.0.7/README.md +145 -0
  11. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/pyproject.toml +1 -1
  12. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/ruff.toml +1 -1
  13. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/src/clearskies_doc_builder/backends/attribute_backend.py +2 -1
  14. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/src/clearskies_doc_builder/backends/class_backend.py +3 -2
  15. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/src/clearskies_doc_builder/backends/module_backend.py +10 -9
  16. clear_skies_doc_builder-2.0.7/src/clearskies_doc_builder/build_callable.py +39 -0
  17. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/src/clearskies_doc_builder/builders/builder.py +37 -1
  18. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/src/clearskies_doc_builder/builders/module.py +37 -3
  19. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/src/clearskies_doc_builder/builders/single_class.py +43 -13
  20. clear_skies_doc_builder-2.0.7/uv.lock +898 -0
  21. clear_skies_doc_builder-2.0.5/LATEST_CHANGELOG.md +0 -8
  22. clear_skies_doc_builder-2.0.5/PKG-INFO +0 -40
  23. clear_skies_doc_builder-2.0.5/README.md +0 -20
  24. clear_skies_doc_builder-2.0.5/src/clearskies_doc_builder/build_callable.py +0 -24
  25. clear_skies_doc_builder-2.0.5/uv.lock +0 -748
  26. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/.editorconfig +0 -0
  27. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/.github/workflows/docs.yaml +0 -0
  28. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/.github/workflows/tests.yaml +0 -0
  29. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/.gitignore +0 -0
  30. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/.python-version +0 -0
  31. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/LICENSE +0 -0
  32. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/cliff.toml +0 -0
  33. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/src/clearskies_doc_builder/__init__.py +0 -0
  34. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/src/clearskies_doc_builder/backends/__init__.py +0 -0
  35. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/src/clearskies_doc_builder/backends/python.py +0 -0
  36. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/src/clearskies_doc_builder/builders/__init__.py +0 -0
  37. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/src/clearskies_doc_builder/builders/single_class_to_section.py +0 -0
  38. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/src/clearskies_doc_builder/columns/__init__.py +0 -0
  39. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/src/clearskies_doc_builder/columns/any.py +0 -0
  40. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/src/clearskies_doc_builder/columns/attribute.py +0 -0
  41. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/src/clearskies_doc_builder/columns/attributes.py +0 -0
  42. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/src/clearskies_doc_builder/columns/base_classes.py +0 -0
  43. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/src/clearskies_doc_builder/columns/class_column.py +0 -0
  44. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/src/clearskies_doc_builder/columns/method.py +0 -0
  45. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/src/clearskies_doc_builder/columns/module.py +0 -0
  46. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/src/clearskies_doc_builder/columns/module_classes.py +0 -0
  47. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/src/clearskies_doc_builder/configs/__init__.py +0 -0
  48. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/src/clearskies_doc_builder/models/__init__.py +0 -0
  49. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/src/clearskies_doc_builder/models/arg.py +0 -0
  50. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/src/clearskies_doc_builder/models/attribute.py +0 -0
  51. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/src/clearskies_doc_builder/models/attribute_reference.py +0 -0
  52. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/src/clearskies_doc_builder/models/class_model.py +0 -0
  53. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/src/clearskies_doc_builder/models/class_reference.py +0 -0
  54. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/src/clearskies_doc_builder/models/method.py +0 -0
  55. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/src/clearskies_doc_builder/models/method_reference.py +0 -0
  56. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/src/clearskies_doc_builder/models/module.py +0 -0
  57. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/src/clearskies_doc_builder/models/module_reference.py +0 -0
  58. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/src/clearskies_doc_builder/models/property.py +0 -0
  59. {clear_skies_doc_builder-2.0.5 → clear_skies_doc_builder-2.0.7}/src/clearskies_doc_builder/prepare_doc_space.py +0 -0
@@ -1,5 +1,5 @@
1
1
  # Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
2
- _commit: v0.0.34
2
+ _commit: v0.0.45
3
3
  _src_path: https://github.com/clearskies-py/clearskies-module-template
4
4
  author_email: cmancone@gmail.com
5
5
  author_name: Conor Mancone
@@ -79,7 +79,7 @@ jobs:
79
79
  # STEP 2: Commit all file changes together
80
80
  - name: Commit All Changes
81
81
  run: |
82
- git add pyproject.toml CHANGELOG.md
82
+ git add pyproject.toml CHANGELOG.md uv.lock
83
83
  git commit -m "chore(release): bump version to ${{ steps.bump.outputs.tag }}"
84
84
 
85
85
  # STEP 3: Create the tag for the final commit
@@ -67,7 +67,7 @@ jobs:
67
67
  python-version: ${{ matrix.python-version }}
68
68
  run-mypy: ${{ needs.changes.outputs.tests == 'true' }}
69
69
  run-pytest: ${{ needs.changes.outputs.tests == 'true' }}
70
- run-black: ${{ needs.changes.outputs.tests == 'true' }}
70
+ run-ruff-format: ${{ needs.changes.outputs.tests == 'true' }}
71
71
  run-ruff-check: ${{ needs.changes.outputs.tests == 'true' }}
72
72
  secrets: inherit
73
73
  strategy:
@@ -76,6 +76,7 @@ jobs:
76
76
  - '3.11'
77
77
  - '3.12'
78
78
  - '3.13'
79
+ - '3.14'
79
80
  fail-fast: false
80
81
 
81
82
  status:
@@ -14,7 +14,7 @@ on:
14
14
  run-pytest:
15
15
  required: true
16
16
  type: boolean
17
- run-black:
17
+ run-ruff-format:
18
18
  required: true
19
19
  type: boolean
20
20
  run-ruff-check:
@@ -66,27 +66,14 @@ jobs:
66
66
  - run: uv run pytest -v
67
67
  - run: git diff --exit-code --stat HEAD
68
68
 
69
- black:
70
- name: black
69
+ ruff-format:
70
+ name: ruff-format
71
71
  runs-on: ${{ inputs.runner }}
72
- if: inputs.run-black
72
+ if: inputs.run-ruff-format
73
73
  steps:
74
- - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
75
- - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
76
- with:
77
- persist-credentials: false
78
-
79
- - name: Install uv and set the python version
80
- uses: astral-sh/setup-uv@v6
81
- with:
82
- python-version: ${{ inputs.python-version }}
83
- enable-cache: true
84
- - name: Install dependencies
85
- run: uv sync --locked --all-extras --dev
86
- - uses: psf/black@stable
74
+ - uses: astral-sh/ruff-action@v3
87
75
  with:
88
- options: "--check --verbose"
89
- src: "./src"
76
+ args: "format --diff"
90
77
 
91
78
  ruff-check:
92
79
  name: ruff-check
@@ -1,5 +1,4 @@
1
1
  # Pre-commit configuration for Akeyless Custom Producer
2
- fail_fast: true
3
2
 
4
3
  ci:
5
4
  autofix_commit_msg: "chore(pre-commit): autofix run"
@@ -39,12 +38,6 @@ repos:
39
38
  hooks:
40
39
  - id: uv-lock
41
40
 
42
- - repo: https://github.com/psf/black
43
- rev: 25.1.0
44
- hooks:
45
- - id: black
46
- files: \.py$
47
-
48
41
  - repo: https://github.com/astral-sh/ruff-pre-commit
49
42
  rev: v0.12.1
50
43
  hooks:
@@ -0,0 +1,21 @@
1
+ {
2
+ "python.testing.pytestArgs": ["tests"],
3
+ "python.testing.unittestEnabled": false,
4
+ "python.testing.pytestEnabled": true,
5
+ "python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",
6
+ "ruff.interpreter": ["${workspaceFolder}/.venv/bin/python"],
7
+ "ruff.path": ["${workspaceFolder}/.venv/bin/ruff"],
8
+ "ruff.configuration": "${workspaceFolder}/ruff.toml",
9
+ "ruff.nativeServer": "on",
10
+ "[python]": {
11
+ "editor.formatOnSave": true,
12
+ "editor.codeActionsOnSave": {
13
+ "source.fixAll": "explicit",
14
+ "source.organizeImports": "explicit"
15
+ },
16
+ "editor.defaultFormatter": "charliermarsh.ruff"
17
+ },
18
+ "mypy-type-checker.args": [
19
+ "--config-file=${workspaceFolder}/pyproject.toml"
20
+ ]
21
+ }
@@ -5,9 +5,28 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [2.0.7] - 2026-01-28
9
+
10
+ ### Added
11
+ - Add multi hierarchy
12
+
13
+ ## [2.0.6] - 2026-01-28
14
+
15
+ ### Added
16
+ - Add some basic tests
17
+
18
+ ### Changed
19
+ - Bump version to v2.0.6 by @github-actions[bot]
20
+ - Update to latest copier version
21
+ - Update dependencies
22
+
23
+ ### Fixed
24
+ - Update to latest clear-skies QueryRequest
25
+
8
26
  ## [2.0.5] - 2025-10-16
9
27
 
10
28
  ### Changed
29
+ - Bump version to v2.0.5 by @github-actions[bot]
11
30
  - Missing-f by @tnijboer in [#2](https://github.com/clearskies-py/doc-builder/pull/2)
12
31
  - Missing-f by @cmancone
13
32
  - Update copier
@@ -56,6 +75,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
56
75
  * @ made their first contribution
57
76
  * @tnijboer made their first contribution in [#1](https://github.com/clearskies-py/doc-builder/pull/1)
58
77
  * @cmancone made their first contribution
78
+ [2.0.7]: https://github.com/clearskies-py/doc-builder/compare/v2.0.6..v2.0.7
79
+ [2.0.6]: https://github.com/clearskies-py/doc-builder/compare/v2.0.5..v2.0.6
59
80
  [2.0.5]: https://github.com/clearskies-py/doc-builder/compare/v2.0.4..v2.0.5
60
81
  [2.0.4]: https://github.com/clearskies-py/doc-builder/compare/v2.0.3..v2.0.4
61
82
  [2.0.3]: https://github.com/clearskies-py/doc-builder/compare/v2.0.2..v2.0.3
@@ -0,0 +1,5 @@
1
+ ## [2.0.7] - 2026-01-28
2
+
3
+ ### Added
4
+ - Add multi hierarchy
5
+
@@ -0,0 +1,165 @@
1
+ Metadata-Version: 2.4
2
+ Name: clear-skies-doc-builder
3
+ Version: 2.0.7
4
+ Summary: The docbuilder for all 'official' clearskies plugins (as well as the main clearskies docs)
5
+ Project-URL: repository, https://github.com/clearskies-py/docs
6
+ Project-URL: issues, https://github.com/clearskies-py/docs/issues
7
+ Project-URL: changelog, https://github.com/clearskies-py/docs/blob/main/CHANGELOG.md
8
+ Author-email: Conor Mancone <cmancone@gmail.com>
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Classifier: Development Status :: 5 - Production/Stable
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Requires-Python: <4.0,>=3.11
16
+ Requires-Dist: clear-skies<3.0.0,>=2.0.0
17
+ Provides-Extra: dev
18
+ Requires-Dist: types-requests>=2.32.4; extra == 'dev'
19
+ Description-Content-Type: text/markdown
20
+
21
+ # docs
22
+
23
+ The documentation builder for clearskies and related plugins
24
+
25
+ ## Overview
26
+
27
+ Each "official" clearskies module (including the core clearskies library itself) has the documentation primarily written in the codebase as docblocks. The documentation site is then built by extracting these docblocks and stitching them together. To be clear, this isn't about the low-level "API" documentation that describes every single class/method in the framework. Rather, this is about the primary documentation site itself (clearskies.info) which is focused on high-level use cases and examples of the primary configuration options. As a result, it's not a simple matter of just iterating over the classes/methods and building documentation. To build a coherent documentation site, each plugin has a configuration file that basically outlines the final "structure" or organization of the resulting documentation, as well as the name of a builder class that will combine that configuration information with the codebase itself to create the actual docs.
28
+
29
+ The docs themselves (in the source code) are all written with markdown. This documentation builder then takes that markdwon and adds the necessary headers/etc so to make them valid files for [Jekyll](https://jekyllrb.com/), the builder for the current documentation site. The site itself is hosted in S3, so building an actual documentation site means:
30
+
31
+ 1. Properly documenting everything inside of the source code via markdown.
32
+ 2. Creating a config file (`docs/python/config.json`) to map source code docs to Jekyll files.
33
+ 3. Creating a skeleton of a Jekyll site in the `doc/jekyll` folder of the plugin.
34
+ 4. Installing this doc builder via `poetry add clear-skies-doc-builder`.
35
+ 5. Run the doc builder.
36
+ 6. Build with Jekyll.
37
+ 7. Push to the appropriate subfolder via S3.
38
+ 8. (Only once) Update the main clearskies doc site to know about the new subfolder for this plugin.
39
+
40
+ Of course, we want the Jekyll sites to be consistent with eachother in terms of style/look. In the long run we'll probably have this doc builder also bootstrap the Jekyll site, but for now you just have to manually setup the Jekyll build using the main clearskies repo as a template.
41
+
42
+ ## Configuration File Structure
43
+
44
+ The `config.json` file defines the documentation structure using a tree of entries. Each entry specifies a documentation section with its source class and builder.
45
+
46
+ ### Basic Structure
47
+
48
+ ```json
49
+ {
50
+ "tree": [
51
+ {
52
+ "title": "Section Title",
53
+ "source": "package.module.ClassName",
54
+ "builder": "clearskies_doc_builder.builders.Module",
55
+ "classes": ["package.module.Class1", "package.module.Class2"]
56
+ }
57
+ ]
58
+ }
59
+ ```
60
+
61
+ ### Nested Hierarchy (Parent/Grand-Parent)
62
+
63
+ The doc builder supports up to 3 levels of navigation hierarchy using `parent` and `grand_parent` fields. This is useful for organizing documentation of submodules under a common heading.
64
+
65
+ #### Two-Level Hierarchy (Parent) - Module with Classes
66
+
67
+ Use this when you want to document a submodule's classes under a parent section:
68
+
69
+ ```json
70
+ {
71
+ "tree": [
72
+ {
73
+ "title": "Cursors",
74
+ "source": "clearskies.cursors.Cursor",
75
+ "builder": "clearskies_doc_builder.builders.Module",
76
+ "classes": [
77
+ "clearskies.cursors.MemoryCursor",
78
+ "clearskies.cursors.FileCursor"
79
+ ]
80
+ },
81
+ {
82
+ "title": "From Environment",
83
+ "source": "clearskies.cursors.from_environment.FromEnvironmentBase",
84
+ "builder": "clearskies_doc_builder.builders.Module",
85
+ "parent": "Cursors",
86
+ "classes": [
87
+ "clearskies.cursors.from_environment.EnvCursor",
88
+ "clearskies.cursors.from_environment.SecretsCursor"
89
+ ]
90
+ }
91
+ ]
92
+ }
93
+ ```
94
+
95
+ This creates:
96
+ - `docs/cursors/index.md` - Parent section with overview
97
+ - `docs/cursors/memory-cursor.md` - Class documentation
98
+ - `docs/cursors/file-cursor.md` - Class documentation
99
+ - `docs/cursors/from-environment/index.md` - Submodule section with `parent: Cursors`
100
+ - `docs/cursors/from-environment/env-cursor.md` - Class with `parent: From Environment`
101
+ - `docs/cursors/from-environment/secrets-cursor.md` - Class with `parent: From Environment`
102
+
103
+ #### Three-Level Hierarchy (Grand-Parent)
104
+
105
+ For deeper nesting, use `grand_parent` to create a third level:
106
+
107
+ ```json
108
+ {
109
+ "tree": [
110
+ {
111
+ "title": "Cursors",
112
+ "source": "clearskies.cursors.Cursor",
113
+ "builder": "clearskies_doc_builder.builders.Module",
114
+ "classes": ["clearskies.cursors.MemoryCursor"]
115
+ },
116
+ {
117
+ "title": "From Environment",
118
+ "source": "clearskies.cursors.from_environment.FromEnvironmentBase",
119
+ "builder": "clearskies_doc_builder.builders.SingleClass",
120
+ "parent": "Cursors"
121
+ },
122
+ {
123
+ "title": "AWS Secrets",
124
+ "source": "clearskies.cursors.from_environment.aws.AWSSecretsBase",
125
+ "builder": "clearskies_doc_builder.builders.Module",
126
+ "parent": "From Environment",
127
+ "grand_parent": "Cursors",
128
+ "classes": [
129
+ "clearskies.cursors.from_environment.aws.SecretsManagerCursor",
130
+ "clearskies.cursors.from_environment.aws.ParameterStoreCursor"
131
+ ]
132
+ }
133
+ ]
134
+ }
135
+ ```
136
+
137
+ This creates:
138
+ - `docs/cursors/index.md` - Grand-parent section
139
+ - `docs/cursors/from-environment/index.md` - Parent section with `parent: Cursors`
140
+ - `docs/cursors/from-environment/aws-secrets/index.md` - Child section with `parent: From Environment` and `grand_parent: Cursors`
141
+ - `docs/cursors/from-environment/aws-secrets/secrets-manager-cursor.md` - Class documentation
142
+
143
+ The `grand_parent` field enables the Jekyll "just-the-docs" theme's three-level navigation, allowing you to document submodule classes under their logical grouping.
144
+
145
+ #### Using SingleClass for Individual Classes
146
+
147
+ You can also use `SingleClass` builder for documenting individual classes within a hierarchy:
148
+
149
+ ```json
150
+ {
151
+ "tree": [
152
+ {
153
+ "title": "Cursors",
154
+ "source": "clearskies.cursors.Cursor",
155
+ "builder": "clearskies_doc_builder.builders.SingleClass"
156
+ },
157
+ {
158
+ "title": "Environment Cursor",
159
+ "source": "clearskies.cursors.from_environment.EnvironmentCursor",
160
+ "builder": "clearskies_doc_builder.builders.SingleClass",
161
+ "parent": "Cursors"
162
+ }
163
+ ]
164
+ }
165
+ ```
@@ -0,0 +1,145 @@
1
+ # docs
2
+
3
+ The documentation builder for clearskies and related plugins
4
+
5
+ ## Overview
6
+
7
+ Each "official" clearskies module (including the core clearskies library itself) has the documentation primarily written in the codebase as docblocks. The documentation site is then built by extracting these docblocks and stitching them together. To be clear, this isn't about the low-level "API" documentation that describes every single class/method in the framework. Rather, this is about the primary documentation site itself (clearskies.info) which is focused on high-level use cases and examples of the primary configuration options. As a result, it's not a simple matter of just iterating over the classes/methods and building documentation. To build a coherent documentation site, each plugin has a configuration file that basically outlines the final "structure" or organization of the resulting documentation, as well as the name of a builder class that will combine that configuration information with the codebase itself to create the actual docs.
8
+
9
+ The docs themselves (in the source code) are all written with markdown. This documentation builder then takes that markdwon and adds the necessary headers/etc so to make them valid files for [Jekyll](https://jekyllrb.com/), the builder for the current documentation site. The site itself is hosted in S3, so building an actual documentation site means:
10
+
11
+ 1. Properly documenting everything inside of the source code via markdown.
12
+ 2. Creating a config file (`docs/python/config.json`) to map source code docs to Jekyll files.
13
+ 3. Creating a skeleton of a Jekyll site in the `doc/jekyll` folder of the plugin.
14
+ 4. Installing this doc builder via `poetry add clear-skies-doc-builder`.
15
+ 5. Run the doc builder.
16
+ 6. Build with Jekyll.
17
+ 7. Push to the appropriate subfolder via S3.
18
+ 8. (Only once) Update the main clearskies doc site to know about the new subfolder for this plugin.
19
+
20
+ Of course, we want the Jekyll sites to be consistent with eachother in terms of style/look. In the long run we'll probably have this doc builder also bootstrap the Jekyll site, but for now you just have to manually setup the Jekyll build using the main clearskies repo as a template.
21
+
22
+ ## Configuration File Structure
23
+
24
+ The `config.json` file defines the documentation structure using a tree of entries. Each entry specifies a documentation section with its source class and builder.
25
+
26
+ ### Basic Structure
27
+
28
+ ```json
29
+ {
30
+ "tree": [
31
+ {
32
+ "title": "Section Title",
33
+ "source": "package.module.ClassName",
34
+ "builder": "clearskies_doc_builder.builders.Module",
35
+ "classes": ["package.module.Class1", "package.module.Class2"]
36
+ }
37
+ ]
38
+ }
39
+ ```
40
+
41
+ ### Nested Hierarchy (Parent/Grand-Parent)
42
+
43
+ The doc builder supports up to 3 levels of navigation hierarchy using `parent` and `grand_parent` fields. This is useful for organizing documentation of submodules under a common heading.
44
+
45
+ #### Two-Level Hierarchy (Parent) - Module with Classes
46
+
47
+ Use this when you want to document a submodule's classes under a parent section:
48
+
49
+ ```json
50
+ {
51
+ "tree": [
52
+ {
53
+ "title": "Cursors",
54
+ "source": "clearskies.cursors.Cursor",
55
+ "builder": "clearskies_doc_builder.builders.Module",
56
+ "classes": [
57
+ "clearskies.cursors.MemoryCursor",
58
+ "clearskies.cursors.FileCursor"
59
+ ]
60
+ },
61
+ {
62
+ "title": "From Environment",
63
+ "source": "clearskies.cursors.from_environment.FromEnvironmentBase",
64
+ "builder": "clearskies_doc_builder.builders.Module",
65
+ "parent": "Cursors",
66
+ "classes": [
67
+ "clearskies.cursors.from_environment.EnvCursor",
68
+ "clearskies.cursors.from_environment.SecretsCursor"
69
+ ]
70
+ }
71
+ ]
72
+ }
73
+ ```
74
+
75
+ This creates:
76
+ - `docs/cursors/index.md` - Parent section with overview
77
+ - `docs/cursors/memory-cursor.md` - Class documentation
78
+ - `docs/cursors/file-cursor.md` - Class documentation
79
+ - `docs/cursors/from-environment/index.md` - Submodule section with `parent: Cursors`
80
+ - `docs/cursors/from-environment/env-cursor.md` - Class with `parent: From Environment`
81
+ - `docs/cursors/from-environment/secrets-cursor.md` - Class with `parent: From Environment`
82
+
83
+ #### Three-Level Hierarchy (Grand-Parent)
84
+
85
+ For deeper nesting, use `grand_parent` to create a third level:
86
+
87
+ ```json
88
+ {
89
+ "tree": [
90
+ {
91
+ "title": "Cursors",
92
+ "source": "clearskies.cursors.Cursor",
93
+ "builder": "clearskies_doc_builder.builders.Module",
94
+ "classes": ["clearskies.cursors.MemoryCursor"]
95
+ },
96
+ {
97
+ "title": "From Environment",
98
+ "source": "clearskies.cursors.from_environment.FromEnvironmentBase",
99
+ "builder": "clearskies_doc_builder.builders.SingleClass",
100
+ "parent": "Cursors"
101
+ },
102
+ {
103
+ "title": "AWS Secrets",
104
+ "source": "clearskies.cursors.from_environment.aws.AWSSecretsBase",
105
+ "builder": "clearskies_doc_builder.builders.Module",
106
+ "parent": "From Environment",
107
+ "grand_parent": "Cursors",
108
+ "classes": [
109
+ "clearskies.cursors.from_environment.aws.SecretsManagerCursor",
110
+ "clearskies.cursors.from_environment.aws.ParameterStoreCursor"
111
+ ]
112
+ }
113
+ ]
114
+ }
115
+ ```
116
+
117
+ This creates:
118
+ - `docs/cursors/index.md` - Grand-parent section
119
+ - `docs/cursors/from-environment/index.md` - Parent section with `parent: Cursors`
120
+ - `docs/cursors/from-environment/aws-secrets/index.md` - Child section with `parent: From Environment` and `grand_parent: Cursors`
121
+ - `docs/cursors/from-environment/aws-secrets/secrets-manager-cursor.md` - Class documentation
122
+
123
+ The `grand_parent` field enables the Jekyll "just-the-docs" theme's three-level navigation, allowing you to document submodule classes under their logical grouping.
124
+
125
+ #### Using SingleClass for Individual Classes
126
+
127
+ You can also use `SingleClass` builder for documenting individual classes within a hierarchy:
128
+
129
+ ```json
130
+ {
131
+ "tree": [
132
+ {
133
+ "title": "Cursors",
134
+ "source": "clearskies.cursors.Cursor",
135
+ "builder": "clearskies_doc_builder.builders.SingleClass"
136
+ },
137
+ {
138
+ "title": "Environment Cursor",
139
+ "source": "clearskies.cursors.from_environment.EnvironmentCursor",
140
+ "builder": "clearskies_doc_builder.builders.SingleClass",
141
+ "parent": "Cursors"
142
+ }
143
+ ]
144
+ }
145
+ ```
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  name = "clear-skies-doc-builder"
3
3
  description = "The docbuilder for all 'official' clearskies plugins (as well as the main clearskies docs)"
4
- version = "2.0.5"
4
+ version = "2.0.7"
5
5
  license = "MIT"
6
6
  readme = "./README.md"
7
7
  authors = [{name = "Conor Mancone", email = "cmancone@gmail.com"}]
@@ -7,7 +7,7 @@ show-fixes = true
7
7
  quote-style = "double"
8
8
  indent-style = "space"
9
9
  docstring-code-format = true
10
- preview = true
10
+ preview = false
11
11
  skip-magic-trailing-comma = false
12
12
  docstring-code-line-length = 100
13
13
  line-ending = "lf"
@@ -5,6 +5,7 @@ import clearskies
5
5
  import clearskies.column
6
6
  import clearskies.model
7
7
  import clearskies.query
8
+ from clearskies.query.result import RecordsQueryResult
8
9
 
9
10
  from clearskies_doc_builder.backends.module_backend import ModuleBackend
10
11
 
@@ -18,7 +19,7 @@ class AttributeBackend(ModuleBackend):
18
19
 
19
20
  def records(
20
21
  self, query: clearskies.query.Query, next_page_data: dict[str, str | int] | None = None
21
- ) -> list[dict[str, Any]]:
22
+ ) -> RecordsQueryResult:
22
23
  """
23
24
  Return a list of records that match the given query configuration.
24
25
 
@@ -7,6 +7,7 @@ import clearskies
7
7
  import clearskies.column
8
8
  import clearskies.model
9
9
  import clearskies.query
10
+ from clearskies.query.result import RecordsQueryResult
10
11
 
11
12
  from clearskies_doc_builder.backends.module_backend import ModuleBackend
12
13
 
@@ -19,7 +20,7 @@ class ClassBackend(ModuleBackend):
19
20
 
20
21
  def records(
21
22
  self, query: clearskies.query.Query, next_page_data: dict[str, str | int] | None = None
22
- ) -> list[dict[str, Any]]:
23
+ ) -> RecordsQueryResult:
23
24
  """
24
25
  Return a list of records that match the given query configuration.
25
26
 
@@ -53,7 +54,7 @@ class ClassBackend(ModuleBackend):
53
54
  raise ValueError(
54
55
  f"I was asked to import the class named '{import_path}' but this doesn't actually reference a class"
55
56
  )
56
- return [self.unpack(Class, module)]
57
+ return RecordsQueryResult(records=[self.unpack(Class, module)])
57
58
 
58
59
  if "module" not in query.conditions_by_column:
59
60
  raise ValueError(
@@ -9,6 +9,7 @@ import clearskies.model
9
9
  import clearskies.query
10
10
  from clearskies.autodoc.schema import Integer as AutoDocInteger
11
11
  from clearskies.autodoc.schema import Schema as AutoDocSchema
12
+ from clearskies.query.result import CountQueryResult, RecordQueryResult, RecordsQueryResult, SuccessQueryResult
12
13
 
13
14
 
14
15
  class ModuleBackend(clearskies.backends.Backend):
@@ -19,25 +20,25 @@ class ModuleBackend(clearskies.backends.Backend):
19
20
  "module": lambda module, value: id(module) == id(value),
20
21
  }
21
22
 
22
- def update(self, id: int | str, data: dict[str, Any], model: clearskies.model.Model) -> dict[str, Any]:
23
+ def update(self, id: int | str, data: dict[str, Any], model: clearskies.model.Model) -> RecordQueryResult:
23
24
  """Update the record with the given id with the information from the data dictionary."""
24
25
  raise Exception(f"The {self.__class__.__name__} only supports read operations: update is not allowed")
25
26
 
26
- def create(self, data: dict[str, Any], model: clearskies.model.Model) -> dict[str, Any]:
27
+ def create(self, data: dict[str, Any], model: clearskies.model.Model) -> RecordQueryResult:
27
28
  """Create a record with the information from the data dictionary."""
28
29
  raise Exception(f"The {self.__class__.__name__} only supports read operations: create is not allowed")
29
30
 
30
- def delete(self, id: int | str, model: clearskies.model.Model) -> bool:
31
+ def delete(self, id: int | str, model: clearskies.model.Model) -> SuccessQueryResult:
31
32
  """Delete the record with the given id."""
32
33
  raise Exception(f"The {self.__class__.__name__} only supports read operations: delete is not allowed")
33
34
 
34
- def count(self, query: clearskies.query.Query) -> int:
35
+ def count(self, query: clearskies.query.Query) -> CountQueryResult:
35
36
  """Return the number of records which match the given query configuration."""
36
- return len(self.records(query))
37
+ return CountQueryResult(count=len(self.records(query).records))
37
38
 
38
39
  def records(
39
40
  self, query: clearskies.query.Query, next_page_data: dict[str, str | int] | None = None
40
- ) -> list[dict[str, Any]]:
41
+ ) -> RecordsQueryResult:
41
42
  """
42
43
  Return a list of records that match the given query configuration.
43
44
 
@@ -58,7 +59,7 @@ class ModuleBackend(clearskies.backends.Backend):
58
59
  if module_name_condition:
59
60
  module_name = module_name_condition[0].values[0]
60
61
  module = importlib.import_module(module_name)
61
- return [self.unpack(module)]
62
+ return RecordsQueryResult(records=[self.unpack(module)])
62
63
 
63
64
  matching_modules = []
64
65
  module_names = set(sys.modules) & set(globals())
@@ -92,8 +93,8 @@ class ModuleBackend(clearskies.backends.Backend):
92
93
  "module": module,
93
94
  }
94
95
 
95
- def paginate(self, records, query):
96
- return records
96
+ def paginate(self, records, query) -> RecordsQueryResult:
97
+ return RecordsQueryResult(records=records)
97
98
 
98
99
  def validate_pagination_data(self, data: dict[str, Any], case_mapping: Callable) -> str:
99
100
  extra_keys = set(data.keys()) - set(self.allowed_pagination_keys())
@@ -0,0 +1,39 @@
1
+ from typing import Any
2
+
3
+ from clearskies_doc_builder import models
4
+ from clearskies_doc_builder.prepare_doc_space import prepare_doc_space
5
+
6
+
7
+ def build_callable(modules: models.Module, classes: models.Class, config: dict[str, Any], project_root: str):
8
+ doc_root = prepare_doc_space(project_root)
9
+ nav_order_parent_count: dict[str, int] = {}
10
+
11
+ for index, branch in enumerate(config["tree"]):
12
+ # For nav_order tracking, we need to track by the immediate parent
13
+ # If there's a grand_parent, the parent is the immediate container
14
+ # If there's only a parent, that's the immediate container
15
+ # If neither, it's a top-level item (doesn't need tracking)
16
+ parent = branch.get("parent")
17
+ grand_parent = branch.get("grand_parent")
18
+
19
+ # Determine nav_order based on hierarchy level
20
+ if parent or grand_parent:
21
+ # Child items: track by their immediate parent
22
+ nav_order_title_tracker = parent
23
+ if nav_order_title_tracker not in nav_order_parent_count:
24
+ nav_order_parent_count[nav_order_title_tracker] = 0
25
+ nav_order_parent_count[nav_order_title_tracker] += 1
26
+ nav_order = nav_order_parent_count[nav_order_title_tracker]
27
+ else:
28
+ # Top-level items: use index-based nav_order
29
+ nav_order = index + 2
30
+
31
+ builder_class = classes.find("import_path=" + branch["builder"]).type
32
+ builder = builder_class(
33
+ branch,
34
+ modules,
35
+ classes,
36
+ doc_root,
37
+ nav_order=nav_order,
38
+ )
39
+ builder.build()