Skip to content

Commit 0d9dfcc

Browse files
committed
Updated docs.
1 parent 1e3055c commit 0d9dfcc

File tree

6 files changed

+40
-22
lines changed

6 files changed

+40
-22
lines changed

doc-source/codes.rst

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
flake8 codes
33
=================
44

5-
============== =====================================================================
6-
Code Description
7-
============== =====================================================================
8-
SXL001 Double backticked variable should be a link to Python documentation.
9-
============== =====================================================================
5+
.. flake8-codes:: flake8_sphinx_links
6+
7+
SXL001

doc-source/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@
4646
'sphinxcontrib.default_values',
4747
'sphinxcontrib.toctree_plus',
4848
'seed_intersphinx_mapping',
49+
'sphinx_toolbox.pre_commit',
50+
'sphinx_toolbox.flake8',
4951
]
5052

5153
sphinxemoji_style = 'twemoji'

doc-source/index.rst

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -133,15 +133,9 @@ Use as a pre-commit hook
133133

134134
See `pre-commit <https://github.com/pre-commit/pre-commit>`_ for instructions
135135

136-
Sample `.pre-commit-config.yaml`:
136+
Sample ``.pre-commit-config.yaml``:
137137

138-
.. code-block:: yaml
139-
140-
- repo: https://gitlab.com/pycqa/flake8
141-
rev: 3.8.1
142-
hooks:
143-
- id: flake8
144-
additional_dependencies: [flake8-sphinx-links==0.0.4]
138+
.. pre-commit:flake8:: 0.0.4
145139
146140
147141
.. toctree::
@@ -156,8 +150,13 @@ Sample `.pre-commit-config.yaml`:
156150
codes
157151
examples
158152
API Reference<docs>
153+
154+
.. toctree::
155+
:maxdepth: 3
156+
:caption: Contributing
157+
158+
contributing
159159
Source
160-
Building
161160

162161
.. start links
163162

doc-source/requirements.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
autodocsumm>=0.2.0
2-
default_values>=0.2.0
3-
domdf_sphinx_theme>=0.1.0
4-
extras_require>=0.2.0
5-
seed_intersphinx_mapping>=0.1.1
2+
default-values>=0.2.0
3+
domdf-sphinx-theme>=0.1.0
4+
extras-require>=0.2.0
5+
seed-intersphinx-mapping>=0.1.1
66
sphinx>=3.0.3
77
sphinx-copybutton>=0.2.12
88
sphinx-notfound-page>=0.5
99
sphinx-prompt>=1.1.0
1010
sphinx-tabs>=1.1.13
11-
sphinx-toolbox>=1.5.1
11+
sphinx-toolbox>=1.6.1
1212
sphinxcontrib-httpdomain>=1.7.0
1313
sphinxemoji>=0.1.6
14-
toctree_plus>=0.0.4
14+
toctree-plus>=0.0.4

flake8_sphinx_links/__init__.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,20 @@
4242
__version__: str = "0.0.4"
4343
__email__: str = "dominic@davis-foster.co.uk"
4444

45+
__all__ = [
46+
"SXL001",
47+
"Visitor",
48+
"Plugin",
49+
"py_obj",
50+
"py_obj_python",
51+
"exc",
52+
"class_",
53+
"regex",
54+
]
55+
4556
SXL001: str = "SXL001 Double backticked strings should be a link to Python documentation." # noqa: E501
4657

58+
#: List of keywords that should become :file:`:py:obj:\`{<keyword>}\``
4759
py_obj: List[str] = [
4860
"True",
4961
"False",
@@ -58,7 +70,12 @@
5870
]
5971

6072
py_obj_python: List[str] = ["copyright"]
73+
"""
74+
List of keywords that should become :file:`:py:obj:\`python:{<keyword>}\``
75+
to prevent conflict with Sphinx objects.
76+
"""
6177

78+
#: List of keywords that should become :file:`:py:exc:\`{<keyword>}\``
6279
exc: List[str] = [
6380
"BaseException",
6481
"Exception",
@@ -152,6 +169,7 @@
152169

153170
all_objs: str = '|'.join(py_obj + py_obj_python + exc + class_)
154171

172+
#: Regex to match keywords that should be Sphinx links.
155173
regex: Pattern = re.compile(fr"(``)({all_objs})(``)")
156174

157175

repo_helper.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,6 @@ classifiers:
3737
- 'Topic :: Software Development :: Libraries :: Python Modules'
3838
- "Topic :: Utilities"
3939

40-
exclude_files:
41-
- setup_cfg
40+
extra_sphinx_extensions:
41+
- sphinx_toolbox.pre_commit
42+
- sphinx_toolbox.flake8

0 commit comments

Comments
 (0)