Skip to content

Commit 44af61c

Browse files
committedNov 29, 2024·
Prepare release 0.6.0
1 parent 6bd8ca7 commit 44af61c

39 files changed

+110
-78
lines changed
 

‎ChangeLog.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Change Log
22

3+
## [0.6.0] - 2024-11-29
4+
5+
- New: Highlight the item in the TOC at the right side ('on this page' column) when the location bar refers to an anchor that is part of the TOC.
6+
- Change: Lighten body background in light color-scheme for all colorsets.
7+
38
## [0.5.3] - 2024-11-28
49

510
- ReadTheDocs no longer provides versions in the context of the template.

‎js/src/index.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { CSchemeHandler } from "./cschemes.js";
44
import { MenuHandler } from "./menu.js";
55
import { selectActiveHeaderLink } from "./navbar.js";
66
import { updateRepoMetrics } from "./repometrics.js";
7-
import { TocObserver } from "./pagetoc.js";
7+
import { LocationHashHandler, TocObserver } from "./pagetoc.js";
88
import { resizeAsides, updateScrollPaddingTop } from "./tocresize.js";
99
import { feedVersionsMenu, updateVersion } from "./versions.js";
1010

@@ -170,6 +170,7 @@ function loadSphinxNefertiti() {
170170
// 'active' to the one corresponding to the current URL.
171171
selectActiveHeaderLink();
172172

173+
// -------------------------------------------------------------------
173174
// Scroll the item from the left sidebar into view:
174175
const sidebar_elem = document.querySelector(".nftt-sidebar a.current");
175176
if (sidebar_elem) {
@@ -178,6 +179,8 @@ function loadSphinxNefertiti() {
178179
parent.scrollIntoView({behavior: "smooth", block: "end"});
179180
}
180181
}
182+
// And scroll down to the anchor name referred in the URL in the TOC.
183+
const location_hash_handler = new LocationHashHandler();
181184
}
182185

183186
runWhenDOMContentLoaded(loadSphinxNefertiti);

‎js/src/pagetoc.js

+44
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,47 @@ export class TocObserver {
6868
return 0;
6969
}
7070
}
71+
72+
73+
export class LocationHashHandler {
74+
constructor() {
75+
this.toc = document.querySelector("#TableOfContents");
76+
window.addEventListener("hashchange", this.hashChanged);
77+
this.hashChanged();
78+
}
79+
80+
isInViewport = (element) => {
81+
const rect = element.getBoundingClientRect();
82+
return (
83+
rect.top >= 0 &&
84+
rect.left >= 0 &&
85+
rect.bottom <= (
86+
window.innerHeight || document.documentElement.clientHeight
87+
) &&
88+
rect.right <= (
89+
window.innerWidth || document.documentElement.clientWidth
90+
)
91+
);
92+
}
93+
94+
hashChanged = (_) => {
95+
const anchors = this.toc.querySelectorAll("a.reference.internal");
96+
for (const anchor of anchors) {
97+
anchor.classList.remove("active");
98+
}
99+
100+
const ubits = window.location.href.split("#");
101+
if (ubits.length > 1) {
102+
const toc_ref = `a.reference.internal[href='#${ubits[1]}']`;
103+
const toc_ref_elem = this.toc.querySelector(toc_ref);
104+
if (toc_ref_elem) {
105+
toc_ref_elem.classList.add("active");
106+
if (!this.isInViewport(toc_ref_elem)) {
107+
toc_ref_elem.scrollIntoView({
108+
behavior: "smooth", block: "center"
109+
});
110+
}
111+
}
112+
}
113+
}
114+
}

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sphinx-nefertiti",
3-
"version": "0.5.3",
3+
"version": "0.6.0",
44
"private": true,
55
"description": "Nefertiti is a theme for the Sphinx Documentation Generator.",
66
"engines": {

‎scss/_theme.scss

-29
Original file line numberDiff line numberDiff line change
@@ -310,35 +310,6 @@ blockquote {
310310
}
311311
}
312312

313-
aside.sidebar {
314-
float: right;
315-
width: 33%;
316-
padding: .8rem .9rem;
317-
margin: 0 0 .4rem 1.8rem;
318-
background-color: var(--#{$prefix}foot1-bg);
319-
border: 2px solid var(--#{$prefix}secondary-bg);
320-
border-radius: .25rem;
321-
322-
.sidebar-title {
323-
padding-bottom: .5rem;
324-
font-size: 1.2em;
325-
border-bottom: 1px solid var(--#{$prefix}secondary-bg);
326-
}
327-
328-
.sidebar-subtitle {
329-
font-size: 1.1em;
330-
}
331-
332-
.rubric {
333-
font-size: 1em;
334-
font-weight: 700;
335-
}
336-
337-
p:last-child {
338-
margin-bottom: .5rem;
339-
}
340-
}
341-
342313
.search-input {
343314
max-width: 10rem;
344315
}

‎scss/_variables-blue.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ $dark: $gray-800 !default;
6464
// scheme-color light.
6565
$scheme-light-body-color: $gray-700;
6666
$scheme-light-body-hc-color: $gray-800;
67-
$scheme-light-body-bg: $gray-300;
67+
$scheme-light-body-bg: $gray-200;
6868
$scheme-light-body-secondary-color: rgba($scheme-light-body-color, .75) !default;
69-
$scheme-light-body-secondary-bg: $gray-200 !default;
69+
$scheme-light-body-secondary-bg: $blue-100 !default;
7070
$scheme-light-body-tertiary-color: rgba($scheme-light-body-color, .8) !default;
7171
$scheme-light-body-tertiary-bg: $gray-100 !default;
7272
$scheme-light-body-emphasis-color: $black !default;

‎scss/_variables-cyan.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ $dark: $gray-800 !default;
6666
// scheme-color light.
6767
$scheme-light-body-color: $gray-700;
6868
$scheme-light-body-hc-color: $gray-800;
69-
$scheme-light-body-bg: $gray-300;
69+
$scheme-light-body-bg: $gray-200;
7070
$scheme-light-body-secondary-color: rgba($scheme-light-body-color, .9) !default;
71-
$scheme-light-body-secondary-bg: $gray-200 !default;
71+
$scheme-light-body-secondary-bg: $cyan-100 !default;
7272
$scheme-light-body-tertiary-color: rgba($scheme-light-body-color, .8) !default;
7373
$scheme-light-body-tertiary-bg: $gray-100 !default;
7474
$scheme-light-body-emphasis-color: $black !default;

‎scss/_variables-green.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ $dark: $gray-800 !default;
6767
// scheme-color light.
6868
$scheme-light-body-color: $gray-700;
6969
$scheme-light-body-hc-color: $gray-800;
70-
$scheme-light-body-bg: $gray-300;
70+
$scheme-light-body-bg: $gray-200;
7171
$scheme-light-body-secondary-color: rgba($scheme-light-body-color, .75) !default;
72-
$scheme-light-body-secondary-bg: $gray-200 !default;
72+
$scheme-light-body-secondary-bg: $green-100 !default;
7373
$scheme-light-body-tertiary-color: rgba($scheme-light-body-color, .8) !default;
7474
$scheme-light-body-tertiary-bg: $gray-100 !default;
7575
$scheme-light-body-emphasis-color: $black !default;

‎scss/_variables-indigo.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ $dark: $gray-800 !default;
6969
// scheme-color light.
7070
$scheme-light-body-color: $gray-700;
7171
$scheme-light-body-hc-color: $gray-800;
72-
$scheme-light-body-bg: $gray-300;
72+
$scheme-light-body-bg: $gray-200;
7373
$scheme-light-body-secondary-color: rgba($scheme-light-body-color, .75) !default;
74-
$scheme-light-body-secondary-bg: $gray-200 !default;
74+
$scheme-light-body-secondary-bg: $indigo-100 !default;
7575
$scheme-light-body-tertiary-color: rgba($scheme-light-body-color, .8) !default;
7676
$scheme-light-body-tertiary-bg: $gray-100 !default;
7777
$scheme-light-body-emphasis-color: $black !default;

‎scss/_variables-orange.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ $dark: $gray-800 !default;
7070
// scheme-color light.
7171
$scheme-light-body-color: $gray-700;
7272
$scheme-light-body-hc-color: $gray-800;
73-
$scheme-light-body-bg: $gray-300;
73+
$scheme-light-body-bg: $gray-200;
7474
$scheme-light-body-secondary-color: rgba($scheme-light-body-color, .75) !default;
75-
$scheme-light-body-secondary-bg: $gray-200 !default;
75+
$scheme-light-body-secondary-bg: $orange-100 !default;
7676
$scheme-light-body-tertiary-color: rgba($scheme-light-body-color, .8) !default;
7777
$scheme-light-body-tertiary-bg: $gray-100 !default;
7878
$scheme-light-body-emphasis-color: $black !default;

‎scss/_variables-pink.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ $dark: $gray-800 !default;
7070
// scheme-color light.
7171
$scheme-light-body-color: $gray-700;
7272
$scheme-light-body-hc-color: $gray-800;
73-
$scheme-light-body-bg: $gray-300;
73+
$scheme-light-body-bg: $gray-200;
7474
$scheme-light-body-secondary-color: rgba($scheme-light-body-color, .75) !default;
75-
$scheme-light-body-secondary-bg: $gray-200 !default;
75+
$scheme-light-body-secondary-bg: $pink-100 !default;
7676
$scheme-light-body-tertiary-color: rgba($scheme-light-body-color, .8) !default;
7777
$scheme-light-body-tertiary-bg: $gray-100 !default;
7878
$scheme-light-body-emphasis-color: $black !default;

‎scss/_variables-purple.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ $dark: $gray-800 !default;
6969
// scheme-color light.
7070
$scheme-light-body-color: $gray-700;
7171
$scheme-light-body-hc-color: $gray-800;
72-
$scheme-light-body-bg: $gray-300;
72+
$scheme-light-body-bg: $gray-200;
7373
$scheme-light-body-secondary-color: rgba($scheme-light-body-color, .75) !default;
74-
$scheme-light-body-secondary-bg: $gray-200 !default;
74+
$scheme-light-body-secondary-bg: $purple-100 !default;
7575
$scheme-light-body-tertiary-color: rgba($scheme-light-body-color, .8) !default;
7676
$scheme-light-body-tertiary-bg: $gray-100 !default;
7777
$scheme-light-body-emphasis-color: $black !default;

‎scss/_variables-red.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ $dark: $gray-800 !default;
6868
// scheme-color light.
6969
$scheme-light-body-color: $gray-700;
7070
$scheme-light-body-hc-color: $gray-800;
71-
$scheme-light-body-bg: $gray-300;
71+
$scheme-light-body-bg: $gray-200;
7272
$scheme-light-body-secondary-color: rgba($scheme-light-body-color, .75) !default;
73-
$scheme-light-body-secondary-bg: $gray-200 !default;
73+
$scheme-light-body-secondary-bg: $red-100 !default;
7474
$scheme-light-body-tertiary-color: rgba($scheme-light-body-color, .8) !default;
7575
$scheme-light-body-tertiary-bg: $gray-100 !default;
7676
$scheme-light-body-emphasis-color: $black !default;

‎scss/_variables-teal.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ $dark: $gray-800 !default;
6868
// scheme-color light.
6969
$scheme-light-body-color: $gray-700;
7070
$scheme-light-body-hc-color: $gray-800;
71-
$scheme-light-body-bg: $gray-300;
71+
$scheme-light-body-bg: $gray-200;
7272
$scheme-light-body-secondary-color: rgba($scheme-light-body-color, .75) !default;
73-
$scheme-light-body-secondary-bg: $gray-200 !default;
73+
$scheme-light-body-secondary-bg: $teal-100 !default;
7474
$scheme-light-body-tertiary-color: rgba($scheme-light-body-color, .8) !default;
7575
$scheme-light-body-tertiary-bg: $gray-100 !default;
7676
$scheme-light-body-emphasis-color: $black !default;

‎scss/_variables-yellow.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ $dark: $gray-800 !default;
6868
// scheme-color light.
6969
$scheme-light-body-color: $gray-700;
7070
$scheme-light-body-hc-color: $gray-800;
71-
$scheme-light-body-bg: $gray-300;
71+
$scheme-light-body-bg: $gray-200;
7272
$scheme-light-body-secondary-color: rgba($scheme-light-body-color, .75) !default;
73-
$scheme-light-body-secondary-bg: $gray-200 !default;
73+
$scheme-light-body-secondary-bg: $yellow-100 !default;
7474
$scheme-light-body-tertiary-color: rgba($scheme-light-body-color, .8) !default;
7575
$scheme-light-body-tertiary-bg: $gray-100 !default;
7676
$scheme-light-body-emphasis-color: $black !default;

‎scss/components/_toc.scss

+12-3
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,8 @@
146146
right: 0;
147147
z-index: 2;
148148
padding-right: .25rem;
149-
overflow-y: auto;
150-
// overflow-x: auto;
151-
// white-space: nowrap;
149+
overflow-y: scroll;
150+
scroll-snap-type: y mandatory;
152151

153152
@include scrollbars();
154153
}
@@ -179,6 +178,10 @@
179178
list-style-position: outside;
180179
list-style-type: circle;
181180
border-left: 1px solid var(--#{$prefix}border-color);
181+
182+
li {
183+
scroll-margin-bottom: 24px;
184+
}
182185
}
183186
}
184187

@@ -193,6 +196,12 @@
193196
text-decoration: none;
194197
}
195198

199+
&.active {
200+
padding-left: 7px;
201+
scroll-margin-bottom: 24px;
202+
background-color: var(--#{$prefix}foot2-bg);
203+
}
204+
196205
code {
197206
font: inherit;
198207
}

‎sphinx_nefertiti/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from sphinx_nefertiti import colorsets, docsver, fonts, links, pygments
88

9-
__version__ = "0.5.3"
9+
__version__ = "0.6.0"
1010

1111
pages_wo_index = ["genindex", "search"]
1212

‎sphinx_nefertiti/colorsets/sphinx-nefertiti-blue.min.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎sphinx_nefertiti/colorsets/sphinx-nefertiti-blue.min.css.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎sphinx_nefertiti/colorsets/sphinx-nefertiti-default.min.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎sphinx_nefertiti/colorsets/sphinx-nefertiti-default.min.css.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎sphinx_nefertiti/colorsets/sphinx-nefertiti-green.min.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎sphinx_nefertiti/colorsets/sphinx-nefertiti-green.min.css.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎sphinx_nefertiti/colorsets/sphinx-nefertiti-indigo.min.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎sphinx_nefertiti/colorsets/sphinx-nefertiti-indigo.min.css.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎sphinx_nefertiti/colorsets/sphinx-nefertiti-orange.min.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎sphinx_nefertiti/colorsets/sphinx-nefertiti-orange.min.css.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎sphinx_nefertiti/colorsets/sphinx-nefertiti-pink.min.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎sphinx_nefertiti/colorsets/sphinx-nefertiti-pink.min.css.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎sphinx_nefertiti/colorsets/sphinx-nefertiti-purple.min.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎sphinx_nefertiti/colorsets/sphinx-nefertiti-purple.min.css.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎sphinx_nefertiti/colorsets/sphinx-nefertiti-red.min.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎sphinx_nefertiti/colorsets/sphinx-nefertiti-red.min.css.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎sphinx_nefertiti/colorsets/sphinx-nefertiti-teal.min.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎sphinx_nefertiti/colorsets/sphinx-nefertiti-teal.min.css.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎sphinx_nefertiti/colorsets/sphinx-nefertiti-yellow.min.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎sphinx_nefertiti/colorsets/sphinx-nefertiti-yellow.min.css.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎sphinx_nefertiti/static/sphinx-nefertiti.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎sphinx_nefertiti/static/sphinx-nefertiti.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
Please sign in to comment.