Skip to content

Commit adfaf25

Browse files
committed
Adjust docs
1 parent fe4d2c2 commit adfaf25

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

doc-source/api.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ API Reference
44

55
.. latex:vspace:: -20px
66
7-
.. autosummary-widths:: 7/16
7+
.. autosummary-widths:: 45/100
88

99
.. automodule:: sphinx_pyproject
1010
:member-order: bysource

doc-source/usage.rst

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,27 @@ By passing :func:`globalns=globals() <globals>` to the class constructor, the ke
3838
.. note::
3939

4040
At time of writing the "Poetry" tool does not support PEP 621. To enable a mode compatible with
41-
the ``[tool.poetry]`` heading supply the argument ``style="poetry"``. For example:
41+
the ``[tool.poetry]`` table supply the argument ``style="poetry"``. For example:
4242

4343
.. code-block:: python
4444
4545
config = SphinxConfig("../pyproject.toml", style="poetry")
4646
4747
48+
Additionally the ``SphinxConfig`` class takes an optional parameter ``config_overrides`` that
49+
can be used to dynamically update values from ``pyproject.toml``. This can be helpful for setting
50+
dynamic values like ``version``.
51+
52+
.. code-block:: python3
53+
54+
# conf.py
55+
from sphinx_pyproject import SphinxConfig
56+
57+
from myproject import __version__ as myproject_version
58+
59+
config = SphinxConfig("../pyproject.toml", globalns=globals(), config_overrides = {"version": myproject_version})
60+
61+
4862
Configuration
4963
----------------
5064

sphinx_pyproject/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ class SphinxConfig(Mapping[str, Any]):
6464
By default, or if explicitly :py:obj:`None`, no config updates are performed.
6565
:no-default config_overrides:
6666
67+
.. versionchanged:: 0.2.0 Added the ``style`` keyword argument.
68+
.. versionchanged:: 0.3.0 Added the ``config_overrides`` keyword argument.
69+
6770
.. autosummary-widths:: 1/4
6871
"""
6972

@@ -191,10 +194,6 @@ def __len__(self) -> int:
191194
def __iter__(self) -> Iterator[str]:
192195
"""
193196
Returns an iterator over the keys in the ``tool.sphinx-pyproject`` table.
194-
195-
:rtype:
196-
197-
.. latex:clearpage::
198197
"""
199198

200199
yield from self._freeform
@@ -305,6 +304,7 @@ def parse(
305304
:param config:
306305
:param set_defaults: Has no effect in this class.
307306
"""
307+
308308
if "authors" in config:
309309
config["author"] = config.pop("authors")
310310
elif "maintainers" in config:

0 commit comments

Comments
 (0)