Skip to content

Commit 5c6ef9f

Browse files
authored
STYLE: lint the documentation with Doc8 (#1150)
Fix #1139
1 parent c27f633 commit 5c6ef9f

File tree

7 files changed

+20
-14
lines changed

7 files changed

+20
-14
lines changed

.pre-commit-config.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ default_language_version:
55

66
repos:
77
- repo: https://github.com/pre-commit/mirrors-prettier
8-
rev: v3.0.0-alpha.4
8+
rev: v2.7.1
99
hooks:
1010
- id: prettier
1111
# Exclude the HTML, since it doesn't understand Jinja2
@@ -43,3 +43,8 @@ repos:
4343
hooks:
4444
- id: djlint-jinja
4545
types_or: ["html"]
46+
47+
- repo: https://github.com/PyCQA/doc8
48+
rev: v1.1.1
49+
hooks:
50+
- id: doc8

docs/examples/kitchen-sink/blocks.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,10 +238,10 @@ With line numbers
238238
"This is an intentionally very long line because I want to make sure that we are handling scrollable code blocks correctly."
239239
)
240240
241-
With ``none`` highlighting
242-
~~~~~~~~~~~~~~~~~~~~~~~~~~
241+
Without highlighting
242+
~~~~~~~~~~~~~~~~~~~~
243243

244-
.. code-block:: none
244+
.. code-block:: text
245245
246246
# Taken from https://en.wikipedia.org/wiki/Pseudocode#Example
247247
algorithm ford-fulkerson is

docs/user_guide/install.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ install it from the git repo:
4646
4747
or in a conda environment yml file, you can add:
4848

49-
.. code:: none
49+
.. code:: yaml
5050
5151
- pip:
5252
- git+https://github.com/pydata/pydata-sphinx-theme.git@main

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,6 @@ dev = [
8282

8383
[project.entry-points]
8484
"sphinx.html_themes" = { pydata_sphinx_theme = "pydata_sphinx_theme" }
85+
86+
[tool.doc8]
87+
ignore = ["D001"] # we follow a 1 line = 1 paragraph style

src/pydata_sphinx_theme/assets/scripts/bootstrap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import "../styles/bootstrap.scss";
1414
*/
1515
function TriggerTooltip() {
1616
var tooltipTriggerList = [].slice.call(
17-
document.querySelectorAll('[data-bs-toggle="tooltip"]'),
17+
document.querySelectorAll('[data-bs-toggle="tooltip"]')
1818
);
1919
tooltipTriggerList.map(function (tooltipTriggerEl) {
2020
return new Tooltip(tooltipTriggerEl, { delay: { show: 500, hide: 100 } });

src/pydata_sphinx_theme/assets/scripts/pydata-sphinx-theme.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ function scrollToActive() {
132132
// Inspired on source of revealjs.com
133133
let storedScrollTop = parseInt(
134134
sessionStorage.getItem("sidebar-scroll-top"),
135-
10,
135+
10
136136
);
137137

138138
if (!isNaN(storedScrollTop)) {
@@ -184,7 +184,7 @@ var findSearchInput = () => {
184184
} else {
185185
// must be at least one persistent form, use the first persistent one
186186
form = document.querySelector(
187-
"div:not(.search-button__search-container) > form.bd-search",
187+
"div:not(.search-button__search-container) > form.bd-search"
188188
);
189189
}
190190
return form.querySelector("input");
@@ -235,7 +235,7 @@ var addEventListenerForSearchKeyboard = () => {
235235
toggleSearchField();
236236
}
237237
},
238-
true,
238+
true
239239
);
240240
};
241241

@@ -247,7 +247,7 @@ var changeSearchShortcutKey = () => {
247247
var isMac = window.navigator.platform.toUpperCase().indexOf("MAC") >= 0;
248248
if (isMac) {
249249
forms.forEach(
250-
(f) => (f.querySelector("kbd.kbd-shortcut__modifier").innerText = "⌘"),
250+
(f) => (f.querySelector("kbd.kbd-shortcut__modifier").innerText = "⌘")
251251
);
252252
}
253253
};
@@ -331,7 +331,7 @@ if (themeSwitchBtns) {
331331
const node = document.createElement("a");
332332
node.setAttribute(
333333
"class",
334-
"list-group-item list-group-item-action py-1",
334+
"list-group-item list-group-item-action py-1"
335335
);
336336
node.setAttribute("href", `${entry.url}${currentFilePath}`);
337337
node.appendChild(span);

src/pydata_sphinx_theme/assets/styles/content/_api.scss

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,7 @@ span.highlighted {
111111

112112
// the API selector
113113
// from https://github.com/pradyunsg/furo/blob/main/src/furo/assets/styles/content/_api.sass#L6)
114-
dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(
115-
.simple
116-
) {
114+
dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) {
117115
dd {
118116
margin-left: 2rem;
119117

0 commit comments

Comments
 (0)