sphinxcontrib-httpexample
=========================
.. image:: https://github.com/collective/sphinxcontrib-httpexample/actions/workflows/build.yml/badge.svg?branch=master
:target: https://github.com/collective/sphinxcontrib-httpexample/actions
.. image:: https://coveralls.io/repos/github/collective/sphinxcontrib-httpexample/badge.svg?branch=master
:target: https://coveralls.io/github/collective/sphinxcontrib-httpexample?branch=master
.. image:: https://badge.fury.io/py/sphinxcontrib-httpexample.svg
:target: https://badge.fury.io/py/sphinxcontrib-httpexample
.. image:: https://readthedocs.org/projects/sphinxcontrib-httpexample/badge/?version=latest
:target: http://sphinxcontrib-httpexample.readthedocs.io/en/latest
sphinxcontrib-httpexample enhances `sphinxcontrib-httpdomain`_, a Sphinx domain extension for describing RESTful HTTP APIs in detail, with a simple call example directive. The new directive provided by this extension generates RESTful HTTP API call examples for different tools from a single HTTP request example.
The audience for this extension are developers and technical writes documenting their RESTful HTTP APIs. This extension has originally been developed for documenting `plone.restapi`_.
.. _sphinxcontrib-httpdomain: https://pythonhosted.org/sphinxcontrib-httpdomain/
.. _plone.restapi: http://plonerestapi.readthedocs.org/
Features
--------
* Directive for generating various RESTful HTTP API call examples from single HTTP request.
* Supported tools:
- curl_
- wget_
- httpie_
- python-requests_
.. _curl: https://curl.haxx.se/
.. _wget: https://www.gnu.org/software/wget/
.. _httpie: https://httpie.org/
.. _python-requests: http://docs.python-requests.org/
Examples
--------
This extension has been used at least in the following documentations:
* http://plonerestapi.readthedocs.org/
* http://sphinxcontrib-httpexample.readthedocs.org/
* https://guillotina.readthedocs.io/en/latest/
Documentation
-------------
Full documentation for end users can be found in the "docs" folder. It is also available online at http://sphinxcontrib-httpexample.readthedocs.org/
Installation
------------
Add sphinxcontrib-httpexample into requirements of your product documentation and into the configuration file of your Sphinx documentation next to sphincontrib-httpdomain as follows:
.. code:: python
extensions = ['sphinxcontrib.httpdomain', 'sphinxcontrib.httpexample']
License
-------
The project is licensed under the GPLv2.
Changelog
=========
1.3 (2024-08-18)
----------------
- Add new directive `.. http:example-block::` to allow use with Sphinx tab libraries like
`sphinx-inline-tabs <https://sphinx-inline-tabs.readthedocs.io/en/latest/>`_ or
`sphinx-design <https://sphinx-design.readthedocs.io/en/furo-theme/tabs.html>`_.
[AWhetter]
1.2 (2024-08-17)
----------------
- Add new HTTP example builder `plone-javascript`
[datakurre]
- Fix tabbing to no longer depend on jQuery
[datakurre]
- Fix tabbing to support arrow key navigation
[datakurre]
- Fix tab key to stop at tab list only once
[datakurre]
- Fix requests builder to flatten simple values in form data
[datakurre]
- Fix requests builder to pass form data as dictionary
[datakurre]
- Change JavaScript-based tabbing to no longer require JQuery
[datakurre]
1.1 (2021-12-25)
----------------
- Add support for docutils 0.17.x
[kvondersaar, datakurre]
- Add support for Python 3.8
[datakurre]
- Fix example tabs accessibility
[datakurre]
1.0 (2021-09-10)
----------------
- The curl command builder will now always specify a method
[LefterisJP]
0.11.0 (2021-05-14)
-------------------
- Change to quote examples with " rather than '
[datakurre]
- Fix Sphinx deprecation warnings and support Sphinx 4.x]
[kkrypt0nn, AWhetter]
- Fix to use ast.unparse instead astunparse on Python >= 3.9
[datakurre]
0.10.3 (2019-05-01)
-------------------
- Re-release 0.10.2 with wheel
[datakurre]
0.10.2 (2019-05-01)
-------------------
- Add support for inline response examples without HTTP version
(e.g. `HTTP 200 OK`)
[datakurre]
- Fix regression where support for reading request examples from
external files was broken since 0.10.0
[datakurre]
0.10.1 (2019-03-19)
-------------------
- Fix issue where it was not possible to request exmples with
float values in payload JSON [fixes #42]
[datakurre]
0.10.0 (2018-10-09)
-------------------
- Add support of the URL query parameters, using the `query` field.
Given a line `:query param_name: param_value` in an http example
directive, the key value pair `param_name`, `param_value` will be
added to the request URL (and excluded from further processing).
[ludaavics]
Example::
GET /items HTTP/1.1
Host: localhost
Accept: application/json
Authorization: Basic dXNlcjpwYXNzd29yZA==
:query from: 20170101
:query to: 20171231
:query user_id: 12
:query limit: 20
:query sort: date(asc)
0.9.1 (2018-10-06)
------------------
- Fix packaging to include setup.cfg in sdist
[datakurre]
- Add the guillotina docs (which now uses httpexample)
[cdevienne]
0.9.0 (2018-07-22)
------------------
- Add support for inlining responses
[cdevienne]
0.8.1 (2018-06-27)
------------------
- Fixed error when parsing top level json lists
[AWhetter]
0.8.0 (2017-11-18)
------------------
- Fix to not strip out Accept/Content-Type headers in builders
[dokai]
- Improve logic to detect a JSON content type
[dokai]
- Use redirected input to pass request payload to httpie
[dokai]
- Fix quoting of non-trivial HTTP headers in builders
[dokai]
- Change to use declarative packaging (setup.cfg instead of setup.py)
[datakurre]
0.7.0 (2017-10-21)
------------------
- Allow the URL scheme (http or https) to be configured
[dokai]
- Quote the URL if it contains `&` characters in curl/httpie/wget examples
[dokai]
0.6.1 (2017-05-11)
------------------
- Release as universal wheel
[datakurre]
0.6.0 (2017-05-11)
------------------
- Support non-json requests
[jaroel]
- Support application/json; charset=utf-8
[skyzyx]
0.5.2 (2017-03-09)
------------------
- Fix packaging to include the files in static #3
[csenger]
0.5.1 (2017-03-05)
------------------
- Update README and documentation
[datakurre]
0.5.0 (2017-03-05)
------------------
- Change development status to beta
[datakurre]
0.4.2 (2017-03-05)
------------------
- Fix issue where wget basic auth required challenge from backend, which is not
always available
[datakurre]
0.4.1 (2017-03-05)
------------------
- Fix issue where generate httpie-commands did not always set Accept and
Content-Type -headers
[datakurre]
0.4.0 (2017-03-05)
------------------
- Add support for wget
[datakurre]
0.3.0 (2017-03-05)
------------------
- Add generic 'Authorization'-header support
[datakurre]
0.2.1 (2017-03-05)
------------------
- Fix issue where Authorization-header was always requires
[datakurre]
- Fix raise proper exception when parsing bad requests
[datakurre]
- Fix issue where httpie-builder did not quote values with spaces
[datakurre]
- Fix link to python-requests' documentation
[datakurre]
0.2.0 (2017-03-05)
------------------
- Add support for GET requests
[datakurre]
0.1.0 (2017-03-05)
------------------
- First release
[datakurre]
Raw data
{
"_id": null,
"home_page": "https://github.com/collective/sphinxcontrib-httpexample",
"name": "sphinxcontrib-httpexample",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "sphinx, extension, http, rest, documentation",
"author": "Asko Soukka",
"author_email": "asko.soukka@iki.fi",
"download_url": "https://files.pythonhosted.org/packages/b1/de/4e26a2e72ba562b8498ca0ac3e32841c5727b07740913bfe3149dfbc3168/sphinxcontrib-httpexample-1.3.tar.gz",
"platform": null,
"description": "sphinxcontrib-httpexample\n=========================\n\n.. image:: https://github.com/collective/sphinxcontrib-httpexample/actions/workflows/build.yml/badge.svg?branch=master\n :target: https://github.com/collective/sphinxcontrib-httpexample/actions\n\n.. image:: https://coveralls.io/repos/github/collective/sphinxcontrib-httpexample/badge.svg?branch=master\n :target: https://coveralls.io/github/collective/sphinxcontrib-httpexample?branch=master\n\n.. image:: https://badge.fury.io/py/sphinxcontrib-httpexample.svg\n :target: https://badge.fury.io/py/sphinxcontrib-httpexample\n\n.. image:: https://readthedocs.org/projects/sphinxcontrib-httpexample/badge/?version=latest\n :target: http://sphinxcontrib-httpexample.readthedocs.io/en/latest\n\nsphinxcontrib-httpexample enhances `sphinxcontrib-httpdomain`_, a Sphinx domain extension for describing RESTful HTTP APIs in detail, with a simple call example directive. The new directive provided by this extension generates RESTful HTTP API call examples for different tools from a single HTTP request example.\n\nThe audience for this extension are developers and technical writes documenting their RESTful HTTP APIs. This extension has originally been developed for documenting `plone.restapi`_.\n\n.. _sphinxcontrib-httpdomain: https://pythonhosted.org/sphinxcontrib-httpdomain/\n.. _plone.restapi: http://plonerestapi.readthedocs.org/\n\n\nFeatures\n--------\n\n* Directive for generating various RESTful HTTP API call examples from single HTTP request.\n\n* Supported tools:\n\n - curl_\n - wget_\n - httpie_\n - python-requests_\n\n.. _curl: https://curl.haxx.se/\n.. _wget: https://www.gnu.org/software/wget/\n.. _httpie: https://httpie.org/\n.. _python-requests: http://docs.python-requests.org/\n\n\nExamples\n--------\n\nThis extension has been used at least in the following documentations:\n\n* http://plonerestapi.readthedocs.org/\n* http://sphinxcontrib-httpexample.readthedocs.org/\n* https://guillotina.readthedocs.io/en/latest/\n\n\nDocumentation\n-------------\n\nFull documentation for end users can be found in the \"docs\" folder. It is also available online at http://sphinxcontrib-httpexample.readthedocs.org/\n\n\nInstallation\n------------\n\nAdd sphinxcontrib-httpexample into requirements of your product documentation and into the configuration file of your Sphinx documentation next to sphincontrib-httpdomain as follows:\n\n.. code:: python\n\n extensions = ['sphinxcontrib.httpdomain', 'sphinxcontrib.httpexample']\n\n\nLicense\n-------\n\nThe project is licensed under the GPLv2.\n\nChangelog\n=========\n\n1.3 (2024-08-18)\n----------------\n\n- Add new directive `.. http:example-block::` to allow use with Sphinx tab libraries like\n `sphinx-inline-tabs <https://sphinx-inline-tabs.readthedocs.io/en/latest/>`_ or\n `sphinx-design <https://sphinx-design.readthedocs.io/en/furo-theme/tabs.html>`_.\n [AWhetter]\n\n1.2 (2024-08-17)\n----------------\n\n- Add new HTTP example builder `plone-javascript`\n [datakurre]\n\n- Fix tabbing to no longer depend on jQuery\n [datakurre]\n\n- Fix tabbing to support arrow key navigation\n [datakurre]\n\n- Fix tab key to stop at tab list only once\n [datakurre]\n\n- Fix requests builder to flatten simple values in form data\n [datakurre]\n\n- Fix requests builder to pass form data as dictionary\n [datakurre]\n\n- Change JavaScript-based tabbing to no longer require JQuery\n [datakurre]\n\n1.1 (2021-12-25)\n----------------\n\n- Add support for docutils 0.17.x\n [kvondersaar, datakurre]\n- Add support for Python 3.8\n [datakurre]\n- Fix example tabs accessibility\n [datakurre]\n\n1.0 (2021-09-10)\n----------------\n\n- The curl command builder will now always specify a method\n [LefterisJP]\n\n0.11.0 (2021-05-14)\n-------------------\n\n- Change to quote examples with \" rather than '\n [datakurre]\n- Fix Sphinx deprecation warnings and support Sphinx 4.x]\n [kkrypt0nn, AWhetter]\n- Fix to use ast.unparse instead astunparse on Python >= 3.9\n [datakurre]\n\n0.10.3 (2019-05-01)\n-------------------\n\n- Re-release 0.10.2 with wheel\n [datakurre]\n\n\n0.10.2 (2019-05-01)\n-------------------\n\n- Add support for inline response examples without HTTP version\n (e.g. `HTTP 200 OK`)\n [datakurre]\n\n- Fix regression where support for reading request examples from\n external files was broken since 0.10.0\n [datakurre]\n\n0.10.1 (2019-03-19)\n-------------------\n\n- Fix issue where it was not possible to request exmples with\n float values in payload JSON [fixes #42]\n [datakurre]\n\n0.10.0 (2018-10-09)\n-------------------\n\n- Add support of the URL query parameters, using the `query` field.\n Given a line `:query param_name: param_value` in an http example\n directive, the key value pair `param_name`, `param_value` will be\n added to the request URL (and excluded from further processing).\n [ludaavics]\n\n Example::\n\n GET /items HTTP/1.1\n Host: localhost\n Accept: application/json\n Authorization: Basic dXNlcjpwYXNzd29yZA==\n\n :query from: 20170101\n :query to: 20171231\n :query user_id: 12\n :query limit: 20\n :query sort: date(asc)\n\n0.9.1 (2018-10-06)\n------------------\n\n- Fix packaging to include setup.cfg in sdist\n [datakurre]\n- Add the guillotina docs (which now uses httpexample)\n [cdevienne]\n\n0.9.0 (2018-07-22)\n------------------\n\n- Add support for inlining responses\n [cdevienne]\n\n0.8.1 (2018-06-27)\n------------------\n\n- Fixed error when parsing top level json lists\n [AWhetter]\n\n0.8.0 (2017-11-18)\n------------------\n\n- Fix to not strip out Accept/Content-Type headers in builders\n [dokai]\n\n- Improve logic to detect a JSON content type\n [dokai]\n\n- Use redirected input to pass request payload to httpie\n [dokai]\n\n- Fix quoting of non-trivial HTTP headers in builders\n [dokai]\n\n- Change to use declarative packaging (setup.cfg instead of setup.py)\n [datakurre]\n\n\n0.7.0 (2017-10-21)\n------------------\n\n- Allow the URL scheme (http or https) to be configured\n [dokai]\n\n- Quote the URL if it contains `&` characters in curl/httpie/wget examples\n [dokai]\n\n\n0.6.1 (2017-05-11)\n------------------\n\n- Release as universal wheel\n [datakurre]\n\n\n0.6.0 (2017-05-11)\n------------------\n\n- Support non-json requests\n [jaroel]\n\n- Support application/json; charset=utf-8\n [skyzyx]\n\n\n0.5.2 (2017-03-09)\n------------------\n\n- Fix packaging to include the files in static #3\n [csenger]\n\n\n0.5.1 (2017-03-05)\n------------------\n\n- Update README and documentation\n [datakurre]\n\n\n0.5.0 (2017-03-05)\n------------------\n\n- Change development status to beta\n [datakurre]\n\n\n0.4.2 (2017-03-05)\n------------------\n\n- Fix issue where wget basic auth required challenge from backend, which is not\n always available\n [datakurre]\n\n\n0.4.1 (2017-03-05)\n------------------\n\n- Fix issue where generate httpie-commands did not always set Accept and\n Content-Type -headers\n [datakurre]\n\n\n0.4.0 (2017-03-05)\n------------------\n\n- Add support for wget\n [datakurre]\n\n\n0.3.0 (2017-03-05)\n------------------\n\n- Add generic 'Authorization'-header support\n [datakurre]\n\n\n0.2.1 (2017-03-05)\n------------------\n\n- Fix issue where Authorization-header was always requires\n [datakurre]\n- Fix raise proper exception when parsing bad requests\n [datakurre]\n- Fix issue where httpie-builder did not quote values with spaces\n [datakurre]\n- Fix link to python-requests' documentation\n [datakurre]\n\n\n0.2.0 (2017-03-05)\n------------------\n\n- Add support for GET requests\n [datakurre]\n\n\n0.1.0 (2017-03-05)\n------------------\n\n- First release\n [datakurre]\n\n\n",
"bugtrack_url": null,
"license": "GPL version 2",
"summary": "Adds example directive for sphinx-contrib httpdomain",
"version": "1.3",
"project_urls": {
"Homepage": "https://github.com/collective/sphinxcontrib-httpexample"
},
"split_keywords": [
"sphinx",
" extension",
" http",
" rest",
" documentation"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "061b9259981370ac1cc0a772050af1fc52e8b0e101d1ec69eaae4d0a2a3c9189",
"md5": "d145faac1c9b5f9293763050d9351c01",
"sha256": "052ca596b487f5363b8496712e52ae46d48f92cb3103c691ba1e81ec720b4b14"
},
"downloads": -1,
"filename": "sphinxcontrib_httpexample-1.3-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "d145faac1c9b5f9293763050d9351c01",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 14560,
"upload_time": "2024-08-18T18:06:51",
"upload_time_iso_8601": "2024-08-18T18:06:51.854595Z",
"url": "https://files.pythonhosted.org/packages/06/1b/9259981370ac1cc0a772050af1fc52e8b0e101d1ec69eaae4d0a2a3c9189/sphinxcontrib_httpexample-1.3-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b1de4e26a2e72ba562b8498ca0ac3e32841c5727b07740913bfe3149dfbc3168",
"md5": "bb14a49f3a4fa64e93eec2978444072e",
"sha256": "05999d36dd4a91f1146a3c9f5cd1faf721b8960ba3d4ee6d951b1a80cec0ea8f"
},
"downloads": -1,
"filename": "sphinxcontrib-httpexample-1.3.tar.gz",
"has_sig": false,
"md5_digest": "bb14a49f3a4fa64e93eec2978444072e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 33901,
"upload_time": "2024-08-18T18:06:53",
"upload_time_iso_8601": "2024-08-18T18:06:53.799342Z",
"url": "https://files.pythonhosted.org/packages/b1/de/4e26a2e72ba562b8498ca0ac3e32841c5727b07740913bfe3149dfbc3168/sphinxcontrib-httpexample-1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-18 18:06:53",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "collective",
"github_project": "sphinxcontrib-httpexample",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"requirements": [],
"tox": true,
"lcname": "sphinxcontrib-httpexample"
}