Skip to main content

Static documentation generator for Protobuf and gRPC

Project description

sabledocs

CircleCI

A simple static documentation generator for Protobuf and gRPC contracts.

How to use

Generate the proto descriptor

In order to build the documentation, you need to generate a binary descriptor from your Proto contracts using protoc. If you don't have it yet, the protoc CLI can be installed by downloading the release from the official protobuf repository.

For example in the folder where your proto files are located, you can execute the following command.

protoc *.proto -o descriptor.pb --include_source_info

(It's important to use the --include_source_info flag, otherwise the comments will not be included in the generated documentation.)

The generated descriptor.pb file will be the input needed to build the documentation site.

Build the documetation

Install the sabledocs package.

pip install sabledocs

In the same folder where the generated descriptor.pb file is located, execute the command.

sabledocs

The documentation will be generated into a folder sabledocs_output, its main page can be opened with index.html.

Customization

For further customization, create a sabledocs.toml file in the folder where the Protobuf descriptor file is located and from which the sabledocs CLI is executed. You can customize the following options. Any omitted field will use its default value.

# Configures the main title of the documentation site.
# Default value: "Protobuf module documentation"
module-title = "My Awesome Module"

# Specifies the name of the Protobuf descriptor file.
# Default value: "descriptor.pb"
input-descriptor-file = "myawesomemodule.pb"

# The output folder to which the documentation is generated.
# Default value: "sabledocs_output"
output-dir = "docs"

# Copyright message displayed in the footer.
# Default value: ""
footer-content = "© 2023 Jane Doe. All rights reserved."

# The following 3 fields configure the source control repository of the project.
# It is used to generate deeplink for the components of the Proto model pointing to the original source code.
# By default these fields are not configured, and source code links are not included in the docs.
# The repository-type field supports two possible values, "github" and "bitbucket".
# The fields repository-url and `repository-branch` should be configured to point to the correct repository.
repository-type = "github"
repository-url = "https://github.com/janedoe/myawesomeproject"
repository-branch = "main"

For maintainers

Build the Python package:

python -m build

Publish with twine:

python -m twine upload --repository testpypi dist/*

Install from the local folder:

pip install .

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

sabledocs-0.1.43.tar.gz (42.9 kB view details)

Uploaded Source

Built Distribution

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

sabledocs-0.1.43-py3-none-any.whl (44.7 kB view details)

Uploaded Python 3

File details

Details for the file sabledocs-0.1.43.tar.gz.

File metadata

  • Download URL: sabledocs-0.1.43.tar.gz
  • Upload date:
  • Size: 42.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.2

File hashes

Hashes for sabledocs-0.1.43.tar.gz
Algorithm Hash digest
SHA256 f6455350c4758532e5fed0190fa8f48809992214256d0ecb9bb8675558e6d3ff
MD5 9beacc1c6d867ecf97122713c263a44b
BLAKE2b-256 14b983a7c42735e3e2f3c26bbf88863bc2ec812c05b0aaf329fd725757eee38b

See more details on using hashes here.

File details

Details for the file sabledocs-0.1.43-py3-none-any.whl.

File metadata

  • Download URL: sabledocs-0.1.43-py3-none-any.whl
  • Upload date:
  • Size: 44.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.2

File hashes

Hashes for sabledocs-0.1.43-py3-none-any.whl
Algorithm Hash digest
SHA256 ef9e6ffc1e932c69c179f9861617134b78293b47bf47642bf42a6a3be2dddb8c
MD5 4f75db95372365a25e4856a5f302c9f2
BLAKE2b-256 4d8b17240dc2c946f35fa5f056109b3f6f7094b0f6d93cc7faa7148f0b62585a

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