From 6cab300f1439cf6b2e88a011fe2da4c09b349fbc Mon Sep 17 00:00:00 2001 From: 12rambau Date: Fri, 3 Feb 2023 21:21:25 +0100 Subject: [PATCH 1/3] use the text lexer --- .pre-commit-config.yaml | 5 +++++ docs/examples/kitchen-sink/blocks.rst | 6 +++--- docs/user_guide/install.rst | 2 +- pyproject.toml | 3 +++ 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6dd4b07bc..48205cf5d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -43,3 +43,8 @@ repos: hooks: - id: djlint-jinja types_or: ["html"] + + - repo: https://github.com/PyCQA/doc8 + rev: v1.1.1 + hooks: + - id: doc8 diff --git a/docs/examples/kitchen-sink/blocks.rst b/docs/examples/kitchen-sink/blocks.rst index 3ebd90d92..771aee19b 100644 --- a/docs/examples/kitchen-sink/blocks.rst +++ b/docs/examples/kitchen-sink/blocks.rst @@ -238,10 +238,10 @@ With line numbers "This is an intentionally very long line because I want to make sure that we are handling scrollable code blocks correctly." ) -With ``none`` highlighting -~~~~~~~~~~~~~~~~~~~~~~~~~~ +Without highlighting +~~~~~~~~~~~~~~~~~~~~ -.. code-block:: none +.. code-block:: text # Taken from https://en.wikipedia.org/wiki/Pseudocode#Example algorithm ford-fulkerson is diff --git a/docs/user_guide/install.rst b/docs/user_guide/install.rst index f7ff89a8f..07325a493 100644 --- a/docs/user_guide/install.rst +++ b/docs/user_guide/install.rst @@ -46,7 +46,7 @@ install it from the git repo: or in a conda environment yml file, you can add: -.. code:: none +.. code:: yaml - pip: - git+https://github.com/pydata/pydata-sphinx-theme.git@main diff --git a/pyproject.toml b/pyproject.toml index b100191fa..378ca5c82 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -82,3 +82,6 @@ dev = [ [project.entry-points] "sphinx.html_themes" = { pydata_sphinx_theme = "pydata_sphinx_theme" } + +[tool.doc8] +ignore = ["D001"] # we follow a 1 line = 1 paragraph style From a274f6190cc9d04776da00bb7ca125e4df0d9f26 Mon Sep 17 00:00:00 2001 From: 12rambau Date: Fri, 3 Feb 2023 21:30:24 +0100 Subject: [PATCH 2/3] use a stable version of prettier --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 48205cf5d..c32c4bed7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ default_language_version: repos: - repo: https://github.com/pre-commit/mirrors-prettier - rev: v3.0.0-alpha.4 + rev: v2.7.1 hooks: - id: prettier # Exclude the HTML, since it doesn't understand Jinja2 From 99e17900c0401ab3c82b105cc32e42c47c4b6f38 Mon Sep 17 00:00:00 2001 From: 12rambau Date: Fri, 3 Feb 2023 21:50:13 +0100 Subject: [PATCH 3/3] prettier linting --- src/pydata_sphinx_theme/assets/scripts/bootstrap.js | 2 +- .../assets/scripts/pydata-sphinx-theme.js | 10 +++++----- .../assets/styles/content/_api.scss | 4 +--- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/pydata_sphinx_theme/assets/scripts/bootstrap.js b/src/pydata_sphinx_theme/assets/scripts/bootstrap.js index cfd296577..0238f64d9 100644 --- a/src/pydata_sphinx_theme/assets/scripts/bootstrap.js +++ b/src/pydata_sphinx_theme/assets/scripts/bootstrap.js @@ -14,7 +14,7 @@ import "../styles/bootstrap.scss"; */ function TriggerTooltip() { var tooltipTriggerList = [].slice.call( - document.querySelectorAll('[data-bs-toggle="tooltip"]'), + document.querySelectorAll('[data-bs-toggle="tooltip"]') ); tooltipTriggerList.map(function (tooltipTriggerEl) { return new Tooltip(tooltipTriggerEl, { delay: { show: 500, hide: 100 } }); diff --git a/src/pydata_sphinx_theme/assets/scripts/pydata-sphinx-theme.js b/src/pydata_sphinx_theme/assets/scripts/pydata-sphinx-theme.js index bd79ac025..71a7260ea 100644 --- a/src/pydata_sphinx_theme/assets/scripts/pydata-sphinx-theme.js +++ b/src/pydata_sphinx_theme/assets/scripts/pydata-sphinx-theme.js @@ -132,7 +132,7 @@ function scrollToActive() { // Inspired on source of revealjs.com let storedScrollTop = parseInt( sessionStorage.getItem("sidebar-scroll-top"), - 10, + 10 ); if (!isNaN(storedScrollTop)) { @@ -184,7 +184,7 @@ var findSearchInput = () => { } else { // must be at least one persistent form, use the first persistent one form = document.querySelector( - "div:not(.search-button__search-container) > form.bd-search", + "div:not(.search-button__search-container) > form.bd-search" ); } return form.querySelector("input"); @@ -235,7 +235,7 @@ var addEventListenerForSearchKeyboard = () => { toggleSearchField(); } }, - true, + true ); }; @@ -247,7 +247,7 @@ var changeSearchShortcutKey = () => { var isMac = window.navigator.platform.toUpperCase().indexOf("MAC") >= 0; if (isMac) { forms.forEach( - (f) => (f.querySelector("kbd.kbd-shortcut__modifier").innerText = "⌘"), + (f) => (f.querySelector("kbd.kbd-shortcut__modifier").innerText = "⌘") ); } }; @@ -331,7 +331,7 @@ if (themeSwitchBtns) { const node = document.createElement("a"); node.setAttribute( "class", - "list-group-item list-group-item-action py-1", + "list-group-item list-group-item-action py-1" ); node.setAttribute("href", `${entry.url}${currentFilePath}`); node.appendChild(span); diff --git a/src/pydata_sphinx_theme/assets/styles/content/_api.scss b/src/pydata_sphinx_theme/assets/styles/content/_api.scss index 9d17024ea..85314f070 100644 --- a/src/pydata_sphinx_theme/assets/styles/content/_api.scss +++ b/src/pydata_sphinx_theme/assets/styles/content/_api.scss @@ -111,9 +111,7 @@ span.highlighted { // the API selector // from https://github.com/pradyunsg/furo/blob/main/src/furo/assets/styles/content/_api.sass#L6) -dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not( - .simple - ) { +dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) { dd { margin-left: 2rem;