Adds example directive for sphinx-contrib httpdomain
Project description
sphinxcontrib-httpexample
sphinxcontrib-httpexample is a Sphinx domain extension for describing RESTful HTTP APIs in detail.
It enhances sphinxcontrib-httpdomain with a simple call example directive.
The directive provided by this extension generates RESTful HTTP API call examples for different HTTP clients from a single HTTP request example.
The audience for this extension are developers and technical writers documenting their RESTful HTTP APIs.
This extension was originally developed for documenting plone.restapi.
Features
-
Directive for generating various RESTful HTTP API call examples from a single HTTP request.
-
Supported HTTP clients:
-
Custom builders, such as the
@plone/clientpackage, an agnostic library that provides easy access to the Plone REST API from a client written in TypeScript. See https://sphinxcontrib-httpexample.readthedocs.io/en/latest/custom.html for examples.
Examples
This extension has been used in documentation for the following projects and probably other similar projects as well.
- https://6.docs.plone.org/plone.restapi/docs/source/index.html
- https://sphinxcontrib-httpexample.readthedocs.io/en/latest/
- https://guillotina.readthedocs.io/en/latest/
Documentation
Full documentation for end users can be found in the docs folder.
It's also available online at https://sphinxcontrib-httpexample.readthedocs.io/en/latest/.
Installation
Add sphinxcontrib-httpexample and sphincontrib-httpdomain to your project requirements.
Then configure your Sphinx configuration file conf.py with sphinxcontrib.httpdomain and sphinxcontrib.httpexample as follows.
extensions = [
"sphinxcontrib.httpdomain",
"sphinxcontrib.httpexample",
]
Contribute
To contribute to sphinxcontrib-httpexample, first set up your environment.
Set up development environment
Install uv. Carefully read the console output for further instruction.
curl -LsSf https://astral.sh/uv/install.sh | sh
Initialize a Python virtual environment.
uv venv
Install sphinxcontrib-httpexample.
uv sync
Build documentation
Rebuild Sphinx documentation on changes, with live reload in the browser.
make livehtml
To stop the preview, type CTRL-C.
Run tests
make test
License
The project is licensed under the GPLv2.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sphinxcontrib_httpexample-2.0.tar.gz.
File metadata
- Download URL: sphinxcontrib_httpexample-2.0.tar.gz
- Upload date:
- Size: 113.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
881881e0125e0f75c15e46564a82252dd8a68c499348d2d9e42cd52c213a58ad
|
|
| MD5 |
3d94abfede7dde549580d6d3d6f43abd
|
|
| BLAKE2b-256 |
4297a2d11c63399e777f3013c508b1c7147cea86f10ebfa13f22b0f27e104c88
|
File details
Details for the file sphinxcontrib_httpexample-2.0-py3-none-any.whl.
File metadata
- Download URL: sphinxcontrib_httpexample-2.0-py3-none-any.whl
- Upload date:
- Size: 13.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e73ffc3e137816cb08947acc6210eaf0ea6a21400e0bc51e142a2a9b8ceecdc
|
|
| MD5 |
7a49919670eed1dae9fa88309ebc1143
|
|
| BLAKE2b-256 |
d4d6decba4e0db46c23fe098e82c821c714391b436a30fc3df18dea253bf9653
|