Skip to main content

The docbuilder for all 'official' clearskies plugins (as well as the main clearskies docs)

Project description

docs

The documentation builder for clearskies and related plugins

Overview

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.

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, the builder for the current documentation site. The site itself is hosted in S3, so building an actual documentation site means:

  1. Properly documenting everything inside of the source code via markdown.
  2. Creating a config file (docs/python/config.json) to map source code docs to Jekyll files.
  3. Creating a skeleton of a Jekyll site in the doc/jekyll folder of the plugin.
  4. Installing this doc builder via poetry add clear-skies-doc-builder.
  5. Run the doc builder.
  6. Build with Jekyll.
  7. Push to the appropriate subfolder via S3.
  8. (Only once) Update the main clearskies doc site to know about the new subfolder for this plugin.

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.

Configuration File Structure

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.

Basic Structure

{
  "tree": [
    {
      "title": "Section Title",
      "source": "package.module.ClassName",
      "builder": "clearskies_doc_builder.builders.Module",
      "classes": ["package.module.Class1", "package.module.Class2"]
    }
  ]
}

Nested Hierarchy (Parent/Grand-Parent)

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.

Two-Level Hierarchy (Parent) - Module with Classes

Use this when you want to document a submodule's classes under a parent section:

{
  "tree": [
    {
      "title": "Cursors",
      "source": "clearskies.cursors.Cursor",
      "builder": "clearskies_doc_builder.builders.Module",
      "classes": [
        "clearskies.cursors.MemoryCursor",
        "clearskies.cursors.FileCursor"
      ]
    },
    {
      "title": "From Environment",
      "source": "clearskies.cursors.from_environment.FromEnvironmentBase",
      "builder": "clearskies_doc_builder.builders.Module",
      "parent": "Cursors",
      "classes": [
        "clearskies.cursors.from_environment.EnvCursor",
        "clearskies.cursors.from_environment.SecretsCursor"
      ]
    }
  ]
}

This creates:

  • docs/cursors/index.md - Parent section with overview
  • docs/cursors/memory-cursor.md - Class documentation
  • docs/cursors/file-cursor.md - Class documentation
  • docs/cursors/from-environment/index.md - Submodule section with parent: Cursors
  • docs/cursors/from-environment/env-cursor.md - Class with parent: From Environment
  • docs/cursors/from-environment/secrets-cursor.md - Class with parent: From Environment

Three-Level Hierarchy (Grand-Parent)

For deeper nesting, use grand_parent to create a third level:

{
  "tree": [
    {
      "title": "Cursors",
      "source": "clearskies.cursors.Cursor",
      "builder": "clearskies_doc_builder.builders.Module",
      "classes": ["clearskies.cursors.MemoryCursor"]
    },
    {
      "title": "From Environment",
      "source": "clearskies.cursors.from_environment.FromEnvironmentBase",
      "builder": "clearskies_doc_builder.builders.SingleClass",
      "parent": "Cursors"
    },
    {
      "title": "AWS Secrets",
      "source": "clearskies.cursors.from_environment.aws.AWSSecretsBase",
      "builder": "clearskies_doc_builder.builders.Module",
      "parent": "From Environment",
      "grand_parent": "Cursors",
      "classes": [
        "clearskies.cursors.from_environment.aws.SecretsManagerCursor",
        "clearskies.cursors.from_environment.aws.ParameterStoreCursor"
      ]
    }
  ]
}

This creates:

  • docs/cursors/index.md - Grand-parent section
  • docs/cursors/from-environment/index.md - Parent section with parent: Cursors
  • docs/cursors/from-environment/aws-secrets/index.md - Child section with parent: From Environment and grand_parent: Cursors
  • docs/cursors/from-environment/aws-secrets/secrets-manager-cursor.md - Class documentation

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.

Using SingleClass for Individual Classes

You can also use SingleClass builder for documenting individual classes within a hierarchy:

{
  "tree": [
    {
      "title": "Cursors",
      "source": "clearskies.cursors.Cursor",
      "builder": "clearskies_doc_builder.builders.SingleClass"
    },
    {
      "title": "Environment Cursor",
      "source": "clearskies.cursors.from_environment.EnvironmentCursor",
      "builder": "clearskies_doc_builder.builders.SingleClass",
      "parent": "Cursors"
    }
  ]
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

clear_skies_doc_builder-2.0.7.tar.gz (76.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

clear_skies_doc_builder-2.0.7-py3-none-any.whl (27.2 kB view details)

Uploaded Python 3

File details

Details for the file clear_skies_doc_builder-2.0.7.tar.gz.

File metadata

  • Download URL: clear_skies_doc_builder-2.0.7.tar.gz
  • Upload date:
  • Size: 76.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for clear_skies_doc_builder-2.0.7.tar.gz
Algorithm Hash digest
SHA256 6260366e2c78158adae8fdd1c23de069f9c20f85a5f480328324e1597bcb5ce3
MD5 1e3a042c5e4a1ef9a2434ad997c52119
BLAKE2b-256 7cf9d18d94cc61d1a4e3f2e20525cfe180c0df636622b3817da60e5969a08d91

See more details on using hashes here.

File details

Details for the file clear_skies_doc_builder-2.0.7-py3-none-any.whl.

File metadata

  • Download URL: clear_skies_doc_builder-2.0.7-py3-none-any.whl
  • Upload date:
  • Size: 27.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for clear_skies_doc_builder-2.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 25cff7257cc802d06f5bdba17f794174e29465f0c5ed2c1f1c00097c26ee4ced
MD5 b81dfa7f50e53c14dd293e69e037ebd0
BLAKE2b-256 6cea6a60db57c057a5e9ad791e38f29d9a56615cd078334890662d535654ab02

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page