Skip to content

Commit 15bd059

Browse files
committed
docs: Move to furo theme, add pytest-watcher
1 parent 8fa6393 commit 15bd059

File tree

9 files changed

+396
-53
lines changed

9 files changed

+396
-53
lines changed

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.10.1 3.9.9 3.8.11 3.7.12

.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
poetry 1.1.12
2+
python 3.10.1 3.9.9 3.8.11 3.7.12

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ black:
1919
test:
2020
poetry run py.test $(test)
2121

22+
start:
23+
$(MAKE) test && poetry run ptw .
24+
2225
watch_test:
2326
if command -v entr > /dev/null; then ${PY_FILES} | entr -c $(MAKE) test; else $(MAKE) test entr_warn; fi
2427

@@ -34,6 +37,12 @@ serve_docs:
3437
dev_docs:
3538
$(MAKE) -j watch_docs serve_docs
3639

40+
start_docs:
41+
$(MAKE) -C docs start
42+
43+
design_docs:
44+
$(MAKE) -C docs design
45+
3746
flake8:
3847
poetry run flake8
3948

docs/Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,3 +175,10 @@ serve_py3:
175175

176176
dev:
177177
$(MAKE) -j watch serve
178+
179+
start:
180+
poetry run sphinx-autobuild "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) --port ${HTTP_PORT} $(O)
181+
182+
design:
183+
# This adds additional watch directories (for _static file changes) and disable incremental builds
184+
poetry run sphinx-autobuild "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) --port ${HTTP_PORT} --watch "." -a $(O)

docs/_static/css/custom.css

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
h2 {
2+
font-size: 2rem;
3+
margin-bottom: 1.25rem;
4+
margin-top: 1.25rem;
5+
scroll-margin-top: 0.5rem;
6+
}
7+
8+
h3 {
9+
font-size: 1.5rem;
10+
margin-bottom: 1.25rem;
11+
margin-top: 1.25rem;
12+
scroll-margin-top: 0.5rem;
13+
}
14+
15+
h4 {
16+
font-size: 1.25rem;
17+
margin-bottom: 1.25rem;
18+
scroll-margin-top: 0.5rem;
19+
}
20+
21+
.sidebar-tree p.indented-block {
22+
padding: var(--sidebar-item-spacing-vertical) var(--sidebar-item-spacing-horizontal) 0 var(--sidebar-item-spacing-horizontal);
23+
margin-bottom: 0;
24+
}
25+
26+
.sidebar-tree p.indented-block span.indent {
27+
margin-left: var(--sidebar-item-spacing-horizontal);
28+
display: block;
29+
}
30+
31+
.sidebar-tree p.indented-block > :not(.project-name) {
32+
font-size: var(--toc-font-size);
33+
}
34+
35+
.sidebar-tree p.indented-block .project-name {
36+
font-size: var(--sidebar-item-font-size);
37+
font-weight: bold;
38+
margin-right: calc(var(--sidebar-item-spacing-horizontal) / 2.5);
39+
}
40+
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<div class="sidebar-tree projects">
2+
<p class="caption" role="heading">
3+
<span class="caption-text"
4+
>team git-pull / <a href="https://www.git-pull.com/">Tony Narlock</a></span
5+
>:
6+
</p>
7+
8+
<p class="indented-block">
9+
<span class="project-name">vcs-python</span>
10+
<a class="internal" href="https://vcspull.git-pull.com" class="current">vcspull</a>
11+
(<a class="internal" href="https://libvcs.git-pull.com">libvcs</a>),
12+
<a class="internal" href="https://g.git-pull.com">g</a>
13+
</p>
14+
<p class="indented-block">
15+
<span class="project-name">tmux-python</span>
16+
<a class="internal" href="https://tmuxp.git-pull.com" class="current">tmuxp</a>
17+
(<a class="internal" href="https://libtmux.git-pull.com">libtmux</a>)
18+
</p>
19+
20+
<p class="indented-block">
21+
<span class="project-name">cihai</span>
22+
<span class="indent">
23+
<a class="internal" href="https://unihan-etl.git-pull.com" class="current">unihan-etl</a>
24+
(<a class="internal" href="https://unihan-db.git-pull.com">db</a>)
25+
</span>
26+
<span class="indent">
27+
<a class="internal" href="https://cihai.git-pull.com" class="current">cihai</a>
28+
(<a class="internal" href="https://cihai-cli.git-pull.com">cli</a>)
29+
</span>
30+
</p>
31+
</div>

docs/conf.py

Lines changed: 38 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1+
# flake8: NOQA E5
12
import inspect
23
import os
34
import sys
45
from os.path import dirname, relpath
56

6-
import alagitpull
7-
87
import tmuxp
98

109
# Get the project root dir, which is the parent dir of this
@@ -28,9 +27,13 @@
2827
"sphinx.ext.napoleon",
2928
"sphinx.ext.linkcode",
3029
"aafig",
31-
"alagitpull",
3230
"sphinx_issues",
3331
"myst_parser",
32+
"sphinx_click.ext", # sphinx-click
33+
"sphinx_inline_tabs",
34+
"sphinx_copybutton",
35+
"sphinxext.opengraph",
36+
"myst_parser",
3437
]
3538

3639
myst_enable_extensions = ["colon_fence"]
@@ -51,41 +54,46 @@
5154

5255
exclude_patterns = ["_build"]
5356

54-
pygments_style = "sphinx"
57+
pygments_style = "monokai"
58+
pygments_dark_style = "monokai"
5559

56-
html_theme_path = [alagitpull.get_path()]
57-
html_theme = "alagitpull"
60+
html_css_files = ["css/custom.css"]
5861
html_extra_path = ["manifest.json"]
5962
html_static_path = ["_static"]
63+
html_theme = "furo"
64+
html_theme_path = []
65+
html_theme_options = {
66+
"light_logo": "img/tmuxp.svg",
67+
"dark_logo": "img/tmuxp.svg",
68+
"footer_icons": [
69+
{
70+
"name": "GitHub",
71+
"url": about["__github__"],
72+
"html": """
73+
<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 16 16">
74+
<path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"></path>
75+
</svg>
76+
""",
77+
"class": "",
78+
},
79+
],
80+
}
6081
html_sidebars = {
6182
"**": [
62-
"about.html",
63-
"navigation.html",
64-
"relations.html",
65-
"more.html",
66-
"book.html",
67-
"searchbox.html",
83+
"sidebar/scroll-start.html",
84+
"sidebar/brand.html",
85+
"sidebar/search.html",
86+
"sidebar/navigation.html",
87+
"sidebar/projects.html",
88+
"sidebar/scroll-end.html",
6889
]
6990
}
7091

71-
html_theme_options = {
72-
"logo": "img/tmuxp.svg",
73-
"github_user": "tmux-python",
74-
"github_repo": "tmuxp",
75-
"github_type": "star",
76-
"github_banner": True,
77-
"projects": alagitpull.projects,
78-
"project_name": about["__title__"],
79-
"project_title": about["__title__"],
80-
"project_description": about["__description__"],
81-
"project_url": about["__docs__"],
82-
"show_meta_manifest_tag": True,
83-
"show_meta_og_tags": True,
84-
"show_meta_app_icon_tags": True,
85-
}
86-
87-
alagitpull_internal_hosts = ["tmuxp.git-pull.com", "0.0.0.0"]
88-
alagitpull_external_hosts_new_window = True
92+
# sphinxext.opengraph
93+
ogp_site_url = about["__docs__"]
94+
ogp_image = "_static/img/icons/icon-192x192.png"
95+
ogp_desscription_length = about["__description__"]
96+
ogp_site_name = about["__title__"]
8997

9098
htmlhelp_basename = "%sdoc" % about["__title__"]
9199

0 commit comments

Comments
 (0)