File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33
44from datetime import date
55
6+ import setuptools_scm
7+
68# -- Project information ------------------------------------------------------
79
810project = "docstub"
9- copyright = f"{ date .today ().year } , docstub contributors"
11+
12+ version = setuptools_scm .get_version (search_parent_directories = True )
13+ version = f"v{ version } "
14+ version = version .replace ("+" , "<wbr>+" ) # Insert wrapping hint for long dev version
15+
16+ copyright = f"{ date .today ().year } docstub contributors."
1017
1118templates_path = ["templates" ]
1219
6269html_sidebars = {
6370 "**" : [
6471 "sidebar/brand.html" ,
72+ "version.html" ,
6573 "sidebar/search.html" ,
6674 "sidebar/scroll-start.html" ,
6775 "sidebar/navigation.html" ,
Original file line number Diff line number Diff line change @@ -8,6 +8,29 @@ article .align-default {
88 margin-right : unset;
99}
1010
11+ /* Apply the same padding to the ad as other items in the sidebar */
1112.ethical-ad-padding {
1213 padding : var (--sidebar-item-spacing-vertical ) var (--sidebar-item-spacing-horizontal );
1314}
15+
16+ /* Account for margin-bottom of a preceeding sidebar-tree's to keep spacing
17+ between items consistent. */
18+ .sidebar-tree + .sidebar-tree {
19+ margin-top : calc (var (--sidebar-tree-space-above ) - var (--sidebar-item-spacing-vertical ));
20+ }
21+
22+ /* Style and align inserted version in sidebar. */
23+ .sidebar-version {
24+ font-family : var (--font-stack--monospace );
25+ font-size : var (--font-size--small );
26+ color : var (--color-foreground-secondary );
27+ padding-inline : var (--sidebar-item-spacing-horizontal );
28+ padding-bottom : var (--sidebar-item-spacing-vertical ) ;
29+ margin-bottom : var (--sidebar-item-spacing-vertical );
30+ overflow-wrap : break-word;
31+ }
32+ /* Remove bottom margin of brand so that version info is closer and better aligned. */
33+ .sidebar-brand-text {
34+ margin-bottom : 0 ;
35+
36+ }
Original file line number Diff line number Diff line change 1+ {#- Indicate ad placement to Read the Docs. -#}
2+
13< div class ="sidebar-tree ethical-ad-padding ">
24 < div id ="ethical-ad-placement "> </ div >
35</ div >
Original file line number Diff line number Diff line change 1+ {#- Insert external project links into the sidebar. -#}
2+
13< div class ="sidebar-tree ">
24 < p class ="caption " role ="heading "> < span class ="caption-text "> Links</ span > </ p >
35 < ul >
Original file line number Diff line number Diff line change 1+ {#- Insert version information into the sidebar. -#}
2+
3+ {% if version %}
4+ < div class ="sidebar-version ">
5+ < span > {{ version }}</ span >
6+ </ div >
7+ {%- endif %}
Original file line number Diff line number Diff line change 11[build-system ]
2- requires = [" setuptools>=61" , " setuptools_scm[toml ]>=7 " ]
2+ requires = [" setuptools>=61" , " setuptools-scm[simple ]>=8 " ]
33build-backend = " setuptools.build_meta"
44
55[project ]
@@ -57,10 +57,11 @@ test = [
5757]
5858docs = [
5959 " sphinx" ,
60- " furo" ,
60+ " furo ==2025.9.25 " ,
6161 " numpydoc" ,
6262 " myst-parser" ,
6363 " sphinx-copybutton" ,
64+ " setuptools-scm[simple] >=8"
6465]
6566dev = [
6667 {include-group = " test" },
You can’t perform that action at this time.
0 commit comments