Skip to content

Commit

Permalink
Merge pull request #96 from collective/tabs
Browse files Browse the repository at this point in the history
Merge use with other tab libraries
  • Loading branch information
datakurre authored Aug 18, 2024
2 parents a43cb02 + 63ea99d commit 48f8d7a
Show file tree
Hide file tree
Showing 35 changed files with 976 additions and 283 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
docutils: docutils020
env:
COVERALLS_REPO_TOKEN: ${{ secrets.github_token }}
COVERALLS_SERVICE_NAME: github
steps:
- uses: actions/checkout@v4.1.1
- uses: cachix/install-nix-action@v25
Expand Down
45 changes: 44 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ coverage: .coverage

.PHONY: coveralls
coveralls: .coverage
coveralls --service=github
ifeq ($(GITHUB_BASE_REF),)
coveralls
endif

.PHONY: format
format:
black --skip-string-normalization src tests

.PHONY: nix-fmt
nix-fmt:
Expand Down Expand Up @@ -65,3 +71,40 @@ nix/requirements-python27.nix: .cache nix/requirements-python27.txt
nix/requirements-python27.txt: .cache requirements.txt
nix develop .#python27-pip2nix --command pip2nix generate -r requirements.txt --output=nix/requirements-python27.nix
@grep "pname =\|version =" nix/requirements-python27.nix|awk "ORS=NR%2?FS:RS"|sed 's|.*"\(.*\)";.*version = "\(.*\)".*|\1==\2|' > nix/requirements-python27.txt

poetry\ add\ --dev\ %:
cp nix/poetry-$(PYTHON)-$(FEATURE).toml pyproject.toml
cp nix/poetry-$(PYTHON)-$(FEATURE).lock poetry.lock
poetry add --group dev $*
mv pyproject.toml nix/poetry-$(PYTHON)-$(FEATURE).toml
mv poetry.lock nix/poetry-$(PYTHON)-$(FEATURE).lock

every\ poetry\ add\ --dev\ %:
PYTHON=python39 FEATURE=docutils018 $(MAKE) poetry\ add\ --dev\ $*
PYTHON=python39 FEATURE=docutils019 $(MAKE) poetry\ add\ --dev\ $*
PYTHON=python39 FEATURE=docutils020 $(MAKE) poetry\ add\ --dev\ $*
PYTHON=python310 FEATURE=docutils018 $(MAKE) poetry\ add\ --dev\ $*
PYTHON=python310 FEATURE=docutils019 $(MAKE) poetry\ add\ --dev\ $*
PYTHON=python310 FEATURE=docutils020 $(MAKE) poetry\ add\ --dev\ $*
PYTHON=python311 FEATURE=docutils018 $(MAKE) poetry\ add\ --dev\ $*
PYTHON=python311 FEATURE=docutils019 $(MAKE) poetry\ add\ --dev\ $*
PYTHON=python311 FEATURE=docutils020 $(MAKE) poetry\ add\ --dev\ $*

test\ all:
PYTHON=python27 FEATURE=docutils016 $(MAKE) nix-test
PYTHON=python27 FEATURE=docutils017 $(MAKE) nix-test
PYTHON=python39 FEATURE=docutils016 $(MAKE) nix-test
PYTHON=python39 FEATURE=docutils017 $(MAKE) nix-test
PYTHON=python39 FEATURE=docutils018 $(MAKE) nix-test
PYTHON=python39 FEATURE=docutils019 $(MAKE) nix-test
PYTHON=python39 FEATURE=docutils020 $(MAKE) nix-test
PYTHON=python310 FEATURE=docutils016 $(MAKE) nix-test
PYTHON=python310 FEATURE=docutils017 $(MAKE) nix-test
PYTHON=python310 FEATURE=docutils018 $(MAKE) nix-test
PYTHON=python310 FEATURE=docutils019 $(MAKE) nix-test
PYTHON=python310 FEATURE=docutils020 $(MAKE) nix-test
PYTHON=python311 FEATURE=docutils016 $(MAKE) nix-test
PYTHON=python311 FEATURE=docutils017 $(MAKE) nix-test
PYTHON=python311 FEATURE=docutils018 $(MAKE) nix-test
PYTHON=python311 FEATURE=docutils019 $(MAKE) nix-test
PYTHON=python311 FEATURE=docutils020 $(MAKE) nix-test
16 changes: 14 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,20 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinxcontrib.httpdomain',
'sphinxcontrib.httpexample']
extensions = [
'sphinxcontrib.httpdomain',
'sphinxcontrib.httpexample',
]

try:
import sphinx_design
import sphinx_inline_tabs
extensions.extend([
'sphinx_design',
'sphinx_inline_tabs',
])
except ImportError:
pass

try:
import rst2pdf
Expand Down
68 changes: 68 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,74 @@ The audience for this extension are developers and technical writes documenting
Accept: application/json
Authorization: Basic YWRtaW46YWRtaW4=

* Compatible with other tab libraries:

`sphinx-inline-tabs <https://sphinx-inline-tabs.readthedocs.io/en/latest/>`_:

.. tab:: http

.. http:example-block:: http
:request: ../tests/fixtures/001.request.txt

.. tab:: curl

.. http:example-block:: curl
:request: ../tests/fixtures/001.request.txt

.. tab:: wget

.. http:example-block:: wget
:request: ../tests/fixtures/001.request.txt

.. tab:: httpie

.. http:example-block:: httpie
:request: ../tests/fixtures/001.request.txt

.. tab:: python-requests

.. http:example-block:: wget
:request: ../tests/fixtures/001.request.txt

.. tab:: response

.. http:example-block:: response
:response: ../tests/fixtures/001.response.txt

`sphinx-design <https://sphinx-design.readthedocs.io/en/furo-theme/tabs.html>`_:

.. tab-set::

.. tab-item:: http

.. http:example-block:: http
:request: ../tests/fixtures/001.request.txt

.. tab-item:: curl

.. http:example-block:: curl
:request: ../tests/fixtures/001.request.txt

.. tab-item:: wget

.. http:example-block:: wget
:request: ../tests/fixtures/001.request.txt

.. tab-item:: httpie

.. http:example-block:: httpie
:request: ../tests/fixtures/001.request.txt

.. tab-item:: python-requests

.. http:example-block:: wget
:request: ../tests/fixtures/001.request.txt

.. tab-item:: response

.. http:example-block:: response
:response: ../tests/fixtures/001.response.txt

* Supported tools:

- curl_
Expand Down
27 changes: 5 additions & 22 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,26 +1,9 @@
Jinja2
MarkupSafe
astunparse
coverage
coveralls
docutils==0.17.1
flake8-blind-except
flake8-coding
flake8-debugger
flake8-isort
flake8-quotes
idna
isort
pep8-naming
pytest
pytest-cov==2.12.1
pytest-runner
pyyaml
rst2pdf
snapshottest==0.5.0
docutils
setuptools
sphinx
sphinx-testing
sphinx_rtd_theme
sphinxcontrib-httpdomain
toml
sphinx-design
sphinx-inline-tabs
sphinx-rtd-theme
.
45 changes: 44 additions & 1 deletion nix/poetry-python310-docutils018.lock
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,49 @@ docs = ["sphinxcontrib-websupport"]
lint = ["flake8 (>=3.5.0)", "importlib_metadata", "mypy (==1.9.0)", "pytest (>=6.0)", "ruff (==0.3.7)", "sphinx-lint", "tomli", "types-docutils", "types-requests"]
test = ["cython (>=3.0)", "defusedxml (>=0.7.1)", "pytest (>=6.0)", "setuptools (>=67.0)"]

[[package]]
name = "sphinx-design"
version = "0.6.1"
description = "A sphinx extension for designing beautiful, view size responsive web components."
optional = false
python-versions = ">=3.9"
files = [
{file = "sphinx_design-0.6.1-py3-none-any.whl", hash = "sha256:b11f37db1a802a183d61b159d9a202314d4d2fe29c163437001324fe2f19549c"},
{file = "sphinx_design-0.6.1.tar.gz", hash = "sha256:b44eea3719386d04d765c1a8257caca2b3e6f8421d7b3a5e742c0fd45f84e632"},
]

[package.dependencies]
sphinx = ">=6,<9"

[package.extras]
code-style = ["pre-commit (>=3,<4)"]
rtd = ["myst-parser (>=2,<4)"]
testing = ["defusedxml", "myst-parser (>=2,<4)", "pytest (>=8.3,<9.0)", "pytest-cov", "pytest-regressions"]
testing-no-myst = ["defusedxml", "pytest (>=8.3,<9.0)", "pytest-cov", "pytest-regressions"]
theme-furo = ["furo (>=2024.7.18,<2024.8.0)"]
theme-im = ["sphinx-immaterial (>=0.12.2,<0.13.0)"]
theme-pydata = ["pydata-sphinx-theme (>=0.15.2,<0.16.0)"]
theme-rtd = ["sphinx-rtd-theme (>=2.0,<3.0)"]
theme-sbt = ["sphinx-book-theme (>=1.1,<2.0)"]

[[package]]
name = "sphinx-inline-tabs"
version = "2023.4.21"
description = "Add inline tabbed content to your Sphinx documentation."
optional = false
python-versions = ">=3.8"
files = [
{file = "sphinx_inline_tabs-2023.4.21-py3-none-any.whl", hash = "sha256:06809ac613f7c48ddd6e2fa588413e3fe92cff2397b56e2ccf0b0218f9ef6a78"},
{file = "sphinx_inline_tabs-2023.4.21.tar.gz", hash = "sha256:5df2f13f602c158f3f5f6c509e008aeada199a8c76d97ba3aa2822206683bebc"},
]

[package.dependencies]
sphinx = ">=3"

[package.extras]
doc = ["furo", "myst-parser"]
test = ["pytest", "pytest-cov", "pytest-xdist"]

[[package]]
name = "sphinx-rtd-theme"
version = "2.0.0"
Expand Down Expand Up @@ -1071,4 +1114,4 @@ test = ["pytest (>=6.0.0)", "setuptools (>=65)"]
[metadata]
lock-version = "2.0"
python-versions = "^3.10"
content-hash = "3bfbefac556463258dfeed4557272c702825b29ef747494b00e3f436d15e3518"
content-hash = "66720a593de2b9c6dd1a08410528c3407d690ad9f8b1110f1c90fe4dcefae718"
2 changes: 2 additions & 0 deletions nix/poetry-python310-docutils018.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ sphinx-testing = "^1.0.1"
flake8 = "^7.1.1"
sphinx-rtd-theme = "^2.0.0"
coveralls = "3.3.1"
sphinx-design = "^0.6.1"
sphinx-inline-tabs = "^2023.4.21"

[build-system]
requires = ["poetry-core"]
Expand Down
45 changes: 44 additions & 1 deletion nix/poetry-python310-docutils019.lock
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,49 @@ docs = ["sphinxcontrib-websupport"]
lint = ["flake8 (>=3.5.0)", "importlib_metadata", "mypy (==1.9.0)", "pytest (>=6.0)", "ruff (==0.3.7)", "sphinx-lint", "tomli", "types-docutils", "types-requests"]
test = ["cython (>=3.0)", "defusedxml (>=0.7.1)", "pytest (>=6.0)", "setuptools (>=67.0)"]

[[package]]
name = "sphinx-design"
version = "0.6.1"
description = "A sphinx extension for designing beautiful, view size responsive web components."
optional = false
python-versions = ">=3.9"
files = [
{file = "sphinx_design-0.6.1-py3-none-any.whl", hash = "sha256:b11f37db1a802a183d61b159d9a202314d4d2fe29c163437001324fe2f19549c"},
{file = "sphinx_design-0.6.1.tar.gz", hash = "sha256:b44eea3719386d04d765c1a8257caca2b3e6f8421d7b3a5e742c0fd45f84e632"},
]

[package.dependencies]
sphinx = ">=6,<9"

[package.extras]
code-style = ["pre-commit (>=3,<4)"]
rtd = ["myst-parser (>=2,<4)"]
testing = ["defusedxml", "myst-parser (>=2,<4)", "pytest (>=8.3,<9.0)", "pytest-cov", "pytest-regressions"]
testing-no-myst = ["defusedxml", "pytest (>=8.3,<9.0)", "pytest-cov", "pytest-regressions"]
theme-furo = ["furo (>=2024.7.18,<2024.8.0)"]
theme-im = ["sphinx-immaterial (>=0.12.2,<0.13.0)"]
theme-pydata = ["pydata-sphinx-theme (>=0.15.2,<0.16.0)"]
theme-rtd = ["sphinx-rtd-theme (>=2.0,<3.0)"]
theme-sbt = ["sphinx-book-theme (>=1.1,<2.0)"]

[[package]]
name = "sphinx-inline-tabs"
version = "2023.4.21"
description = "Add inline tabbed content to your Sphinx documentation."
optional = false
python-versions = ">=3.8"
files = [
{file = "sphinx_inline_tabs-2023.4.21-py3-none-any.whl", hash = "sha256:06809ac613f7c48ddd6e2fa588413e3fe92cff2397b56e2ccf0b0218f9ef6a78"},
{file = "sphinx_inline_tabs-2023.4.21.tar.gz", hash = "sha256:5df2f13f602c158f3f5f6c509e008aeada199a8c76d97ba3aa2822206683bebc"},
]

[package.dependencies]
sphinx = ">=3"

[package.extras]
doc = ["furo", "myst-parser"]
test = ["pytest", "pytest-cov", "pytest-xdist"]

[[package]]
name = "sphinx-rtd-theme"
version = "2.0.0"
Expand Down Expand Up @@ -1071,4 +1114,4 @@ test = ["pytest (>=6.0.0)", "setuptools (>=65)"]
[metadata]
lock-version = "2.0"
python-versions = "^3.10"
content-hash = "7d6a785666bfb4882c88606e5d7892fcd3e541056516448184962fec0cd827ce"
content-hash = "570150009d881bacf6cb4c595de2d36cb7b0223cf8a6e44aecb2f663e467536c"
2 changes: 2 additions & 0 deletions nix/poetry-python310-docutils019.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ sphinx-testing = "^1.0.1"
flake8 = "^7.1.1"
sphinx-rtd-theme = "^2.0.0"
coveralls = "3.3.1"
sphinx-design = "^0.6.1"
sphinx-inline-tabs = "^2023.4.21"

[build-system]
requires = ["poetry-core"]
Expand Down
45 changes: 44 additions & 1 deletion nix/poetry-python310-docutils020.lock
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,49 @@ docs = ["sphinxcontrib-websupport"]
lint = ["flake8 (>=6.0)", "importlib-metadata (>=6.0)", "mypy (==1.10.1)", "pytest (>=6.0)", "ruff (==0.5.2)", "sphinx-lint (>=0.9)", "tomli (>=2)", "types-docutils (==0.21.0.20240711)", "types-requests (>=2.30.0)"]
test = ["cython (>=3.0)", "defusedxml (>=0.7.1)", "pytest (>=8.0)", "setuptools (>=70.0)", "typing_extensions (>=4.9)"]

[[package]]
name = "sphinx-design"
version = "0.6.1"
description = "A sphinx extension for designing beautiful, view size responsive web components."
optional = false
python-versions = ">=3.9"
files = [
{file = "sphinx_design-0.6.1-py3-none-any.whl", hash = "sha256:b11f37db1a802a183d61b159d9a202314d4d2fe29c163437001324fe2f19549c"},
{file = "sphinx_design-0.6.1.tar.gz", hash = "sha256:b44eea3719386d04d765c1a8257caca2b3e6f8421d7b3a5e742c0fd45f84e632"},
]

[package.dependencies]
sphinx = ">=6,<9"

[package.extras]
code-style = ["pre-commit (>=3,<4)"]
rtd = ["myst-parser (>=2,<4)"]
testing = ["defusedxml", "myst-parser (>=2,<4)", "pytest (>=8.3,<9.0)", "pytest-cov", "pytest-regressions"]
testing-no-myst = ["defusedxml", "pytest (>=8.3,<9.0)", "pytest-cov", "pytest-regressions"]
theme-furo = ["furo (>=2024.7.18,<2024.8.0)"]
theme-im = ["sphinx-immaterial (>=0.12.2,<0.13.0)"]
theme-pydata = ["pydata-sphinx-theme (>=0.15.2,<0.16.0)"]
theme-rtd = ["sphinx-rtd-theme (>=2.0,<3.0)"]
theme-sbt = ["sphinx-book-theme (>=1.1,<2.0)"]

[[package]]
name = "sphinx-inline-tabs"
version = "2023.4.21"
description = "Add inline tabbed content to your Sphinx documentation."
optional = false
python-versions = ">=3.8"
files = [
{file = "sphinx_inline_tabs-2023.4.21-py3-none-any.whl", hash = "sha256:06809ac613f7c48ddd6e2fa588413e3fe92cff2397b56e2ccf0b0218f9ef6a78"},
{file = "sphinx_inline_tabs-2023.4.21.tar.gz", hash = "sha256:5df2f13f602c158f3f5f6c509e008aeada199a8c76d97ba3aa2822206683bebc"},
]

[package.dependencies]
sphinx = ">=3"

[package.extras]
doc = ["furo", "myst-parser"]
test = ["pytest", "pytest-cov", "pytest-xdist"]

[[package]]
name = "sphinx-rtd-theme"
version = "2.0.0"
Expand Down Expand Up @@ -1071,4 +1114,4 @@ test = ["pytest (>=6.0.0)", "setuptools (>=65)"]
[metadata]
lock-version = "2.0"
python-versions = "^3.10"
content-hash = "c303b2df101c7d3aa641d990d0cb9c7fc18fa3df76bcb6bf45cdcdb434d9bf6a"
content-hash = "aaa9ad76c6b9ca2cedbdc365d4aa3459cdaab8d51e0ba1d1a55f198c59bfeb5c"
2 changes: 2 additions & 0 deletions nix/poetry-python310-docutils020.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ sphinx-testing = "^1.0.1"
flake8 = "^7.1.1"
sphinx-rtd-theme = "^2.0.0"
coveralls = "3.3.1"
sphinx-design = "^0.6.1"
sphinx-inline-tabs = "^2023.4.21"

[build-system]
requires = ["poetry-core"]
Expand Down
Loading

0 comments on commit 48f8d7a

Please sign in to comment.