Skip to content

Commit 70635f7

Browse files
authored
Multiple features (#40)
* Back-to-top button * Working on multiple features * Add python tests, extend JavaScript tests * Add tox, update tests.yml GHA workflow * Update some docs (wip) * Call s/js-test/test from package.json * Add theme assets * Cosmetics changes * Fix var name for dynamic multi-versions docs * Hint for matrix in GHA Workflow * Update docs * Update bundles * Update README * Stylelint changes * JS Lint changes
1 parent 275e52b commit 70635f7

File tree

206 files changed

+7397
-9972
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

206 files changed

+7397
-9972
lines changed

.eslintrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"plugin:unicorn/recommended"
77
],
88
"ignorePatterns": [
9-
"build/*"
9+
"build/*",
10+
"**/*.min.js"
1011
],
1112
"rules": {
1213
"indent": [

.github/workflows/lint.yaml

Lines changed: 0 additions & 39 deletions
This file was deleted.

.github/workflows/tests.yaml

Lines changed: 50 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,59 @@ on:
55
- main
66
pull_request:
77

8+
env:
9+
FORCE_COLOR: true
10+
NODE: 20
11+
PYTHON: 3.13
12+
13+
permissions:
14+
contents: read
15+
816
jobs:
9-
tests:
17+
syntax-check:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: actions/setup-node@v4
22+
with:
23+
node-version: "${{ env.NODE }}"
24+
cache: npm
25+
- name: Install npm dependencies
26+
run: npm ci
27+
- uses: actions/setup-python@v5
28+
with:
29+
python-version: "${{ env.PYTHON }}"
30+
cache: pip
31+
- name: Install pip dependencies
32+
run: pip install .[dev]
33+
- name: Run make lint
34+
run: make lint
35+
36+
python-sphinx:
1037
runs-on: ubuntu-latest
38+
strategy:
39+
matrix:
40+
sphinx: ["7.3", "7.4", "8.0", "8.1"]
1141
steps:
1242
- uses: actions/checkout@v4
13-
- name: Set up Node.js
14-
uses: actions/setup-node@v3
43+
- uses: actions/setup-python@v5
1544
with:
16-
node-version: '18'
17-
- name: Cache dependencies
18-
uses: actions/cache@v4
45+
python-version: "${{ env.PYTHON }}"
46+
cache: pip
47+
- name: Install deps
48+
run: pip install tox
49+
- name: Run unit tests
50+
run: tox -e py3.13-sphinx${{ matrix.sphinx }}
51+
52+
javascript-tests:
53+
runs-on: ubuntu-latest
54+
steps:
55+
- uses: actions/checkout@v4
56+
- uses: actions/setup-node@v4
1957
with:
20-
path: ~/.npm
21-
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
22-
restore-keys: |
23-
${{ runner.os }}-node-
24-
- run: npm install
25-
- run: npm run js-test
58+
node-version: "${{ env.NODE }}"
59+
cache: npm
60+
- name: Install npm dependencies
61+
run: npm ci
62+
- name: Run unit tests
63+
run: npm run test

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ site/css/sphinx-nefertiti*
1818
site/css/nftt-pygments*
1919
site/js/
2020
site/karma/
21-
sphinx_nefertiti/static/*.min.js*
22-
sphinx_nefertiti/colorsets/sphinx-nefertiti*.min.css*
21+
tests/sample_prj_?/_build/
22+
docs/source/_static/sphinx-nefertiti-*.css
23+
docs/source/_static/sphinx-nefertiti-*.css.map

.pre-commit-config.yaml

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,41 @@
1+
---
2+
exclude: |
3+
(?x)(
4+
^dist|
5+
^sphinx_nefertiti/colorsets|
6+
^sphinx_nefertiti/static|
7+
^docs/source/static/
8+
)
9+
110
repos:
211
- repo: https://github.com/pre-commit/pre-commit-hooks
312
rev: v4.4.0
413
hooks:
5-
- id: check-added-large-files
6-
- id: check-case-conflict
7-
- id: check-json
8-
- id: check-yaml
9-
- id: check-merge-conflict
10-
- id: end-of-file-fixer
11-
- repo: https://github.com/psf/black
12-
rev: 23.7.0
14+
- id: check-added-large-files
15+
- id: check-case-conflict
16+
- id: check-json
17+
- id: check-yaml
18+
- id: check-merge-conflict
19+
- id: debug-statements
20+
- id: end-of-file-fixer
21+
- id: trailing-whitespace
22+
- repo: https://github.com/astral-sh/ruff-pre-commit
23+
rev: v0.1.4
1324
hooks:
14-
- id: black
25+
- id: ruff
26+
args:
27+
- "--fix"
28+
- id: ruff-format
29+
1530
- repo: local
1631
hooks:
17-
- id: css-lint-stylelint
18-
name: local-css-lint-stylelint
19-
entry: npm run css-lint-stylelint --
20-
language: node
21-
types: [scss]
22-
- id: js-lint
23-
name: local-js-lint
24-
entry: npm run js-lint --
25-
language: node
26-
types: [javascript]
32+
- id: js-lint
33+
name: local-js-lint
34+
entry: npm run js-lint --
35+
language: node
36+
types: [javascript]
37+
- id: css-lint-stylelint
38+
name: local-css-lint-stylelint
39+
entry: npm run css-lint-stylelint --
40+
language: node
41+
types: [scss]

.stylelintrc.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
{
22
"extends": "stylelint-config-twbs-bootstrap",
33
"customSyntax": "postcss-scss",
4+
"ignoreFiles": ["**.*.min.css*"],
5+
"rules": {
6+
"selector-max-type": [2, {"ignore": ["descendant"]}]
7+
},
48
"overrides": [
59
{
610
"files": "scss/*.scss",
711
"rules": {
12+
"color-named": [
13+
"always-where-possible", { "ignoreProperties": "/./" }
14+
],
815
"declaration-no-important": null,
916
"scss/at-function-named-arguments": [
1017
"never", { "ignoreFunctions": ["color.scale"] }
11-
],
12-
"color-named": [
13-
"always-where-possible", { "ignoreProperties": "/./" }
1418
]
1519
}
1620
}

ChangeLog.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Change Log
22

3+
## [0.5.0] - Unreleased
4+
5+
- Add breadcrumbs.
6+
- Use smooth scrolling.
7+
- Add **back-to-top** button.
8+
- Add customizable header links.
9+
- Limit height of version dropdown.
10+
- Use compact notation to display number of stars, and forks, in header's repository widget.
11+
- Scroll the left sidebar to show the link corresponding to the current page.
12+
- In the sphinx-nefertiti documentation website, reset the colorset selected by the user 24 hours after it has been selected.
13+
- Migrate from `setup.py` and multiple requirements files, to `pyproject.toml`.
14+
- Use tox to run verify that tests pass against multiple versions of Sphinx.
15+
316
## [0.4.2] - 2024-10-15
417

518
- Remove version constrain for Sphinx 8 in Nefertiti's dependencies.

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
1616
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1717
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1818
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19-
IN THE SOFTWARE.
19+
IN THE SOFTWARE.

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
include README.md
22
include requirements.txt
3+
include version.txt
34

45
recursive-include sphinx_nefertiti *.*
56
recursive-include sphinx_nefertiti/colorsets *.*

Makefile

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,31 @@ clean: ## Clean up built files.
1212
rm -f sphinx_nefertiti/static/snftt-*.*
1313
make -C docs clean
1414

15+
lint: ## Run pre-commit hook checks.
16+
npm run css-lint-vars
17+
pre-commit run --all-files --show-diff-on-failure
18+
19+
py-tests: ## Run Python tests with coverage.
20+
coverage erase
21+
coverage run --source=sphinx_nefertiti -m pytest -ra
22+
coverage report -m
23+
@sh ./ccsvg.sh ||:
24+
25+
js-tests: ## Run JavaScript tests.
26+
npm run test
27+
1528
build-ext: ## Build Sphinx extension.
1629
npm run build
30+
mkdir -p sphinx_nefertiti/static/
1731
mkdir -p sphinx_nefertiti/colorsets/
1832
cp site/css/bootstrap-icons.css sphinx_nefertiti/static/
1933
cp site/css/bootstrap-icons.woff2 sphinx_nefertiti/static/
2034
cp site/js/*.min.js sphinx_nefertiti/static/
2135
cp site/js/*.min.js.map sphinx_nefertiti/static/
2236
cp site/css/sphinx-nefertiti*.min.css sphinx_nefertiti/colorsets/
2337
cp site/css/sphinx-nefertiti*.min.css.map sphinx_nefertiti/colorsets/
24-
cp site/css/nftt-pygments.min.css docs/source/_static
25-
cp site/css/nftt-pygments.min.css.map docs/source/_static
38+
cp site/css/nftt-pygments.min.css docs/source/static
39+
cp site/css/nftt-pygments.min.css.map docs/source/static
2640
python -m build
2741

2842
build-docs: ## Create sphinx-nefertiti documentation.

0 commit comments

Comments
 (0)