sphinx-gp-theme 0.0.1a8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sphinx_gp_theme/__init__.py +82 -0
- sphinx_gp_theme/py.typed +0 -0
- sphinx_gp_theme/theme/page.html +78 -0
- sphinx_gp_theme/theme/sidebar/brand.html +18 -0
- sphinx_gp_theme/theme/sidebar/projects.html +84 -0
- sphinx_gp_theme/theme/static/css/argparse-highlight.css +437 -0
- sphinx_gp_theme/theme/static/css/custom.css +367 -0
- sphinx_gp_theme/theme/static/js/spa-nav.js +254 -0
- sphinx_gp_theme/theme/theme.conf +35 -0
- sphinx_gp_theme-0.0.1a8.dist-info/METADATA +50 -0
- sphinx_gp_theme-0.0.1a8.dist-info/RECORD +13 -0
- sphinx_gp_theme-0.0.1a8.dist-info/WHEEL +4 -0
- sphinx_gp_theme-0.0.1a8.dist-info/entry_points.txt +2 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"""sphinx-gp-theme — Furo child theme for git-pull projects.
|
|
2
|
+
|
|
3
|
+
Provides a shared visual identity for git-pull project documentation
|
|
4
|
+
by inheriting from Furo and bundling common templates, CSS, and JS.
|
|
5
|
+
|
|
6
|
+
Examples
|
|
7
|
+
--------
|
|
8
|
+
>>> import pathlib
|
|
9
|
+
|
|
10
|
+
>>> theme_path = get_theme_path()
|
|
11
|
+
>>> theme_path.is_dir()
|
|
12
|
+
True
|
|
13
|
+
|
|
14
|
+
>>> (theme_path / "theme.conf").is_file()
|
|
15
|
+
True
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
from __future__ import annotations
|
|
19
|
+
|
|
20
|
+
import pathlib
|
|
21
|
+
import typing as t
|
|
22
|
+
|
|
23
|
+
if t.TYPE_CHECKING:
|
|
24
|
+
from sphinx.application import Sphinx
|
|
25
|
+
|
|
26
|
+
__version__ = "0.0.1a8"
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def get_theme_path() -> pathlib.Path:
|
|
30
|
+
"""Return the path to the sphinx-gp-theme theme directory.
|
|
31
|
+
|
|
32
|
+
Returns
|
|
33
|
+
-------
|
|
34
|
+
pathlib.Path
|
|
35
|
+
Absolute path to the theme directory containing
|
|
36
|
+
``theme.conf`` and associated templates/static files.
|
|
37
|
+
|
|
38
|
+
Examples
|
|
39
|
+
--------
|
|
40
|
+
>>> theme_path = get_theme_path()
|
|
41
|
+
>>> (theme_path / "theme.conf").exists()
|
|
42
|
+
True
|
|
43
|
+
|
|
44
|
+
>>> (theme_path / "static" / "css" / "custom.css").exists()
|
|
45
|
+
True
|
|
46
|
+
"""
|
|
47
|
+
return pathlib.Path(__file__).parent / "theme"
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def setup(app: Sphinx) -> dict[str, bool | str]:
|
|
51
|
+
"""Register the bundled theme with Sphinx.
|
|
52
|
+
|
|
53
|
+
Parameters
|
|
54
|
+
----------
|
|
55
|
+
app : Sphinx
|
|
56
|
+
The Sphinx application object.
|
|
57
|
+
|
|
58
|
+
Returns
|
|
59
|
+
-------
|
|
60
|
+
dict[str, bool | str]
|
|
61
|
+
Extension metadata for Sphinx.
|
|
62
|
+
|
|
63
|
+
Examples
|
|
64
|
+
--------
|
|
65
|
+
>>> class FakeApp:
|
|
66
|
+
... def __init__(self) -> None:
|
|
67
|
+
... self.calls: list[tuple[str, pathlib.Path]] = []
|
|
68
|
+
... def add_html_theme(self, name: str, theme_path: pathlib.Path) -> None:
|
|
69
|
+
... self.calls.append((name, theme_path))
|
|
70
|
+
>>> fake = FakeApp()
|
|
71
|
+
>>> metadata = setup(fake) # type: ignore[arg-type]
|
|
72
|
+
>>> fake.calls[0][0]
|
|
73
|
+
'sphinx-gp-theme'
|
|
74
|
+
>>> metadata["parallel_read_safe"]
|
|
75
|
+
True
|
|
76
|
+
"""
|
|
77
|
+
app.add_html_theme("sphinx-gp-theme", get_theme_path())
|
|
78
|
+
return {
|
|
79
|
+
"parallel_read_safe": True,
|
|
80
|
+
"parallel_write_safe": True,
|
|
81
|
+
"version": __version__,
|
|
82
|
+
}
|
sphinx_gp_theme/py.typed
ADDED
|
File without changes
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{% extends "furo/page.html" %}
|
|
2
|
+
{%- block extrahead %}
|
|
3
|
+
{{ super() }}
|
|
4
|
+
{%- for href in font_preload_hrefs|default([]) %}
|
|
5
|
+
<link rel="preload" href="{{ pathto('_static/fonts/' + href, 1) }}" as="font" type="font/woff2" crossorigin="">
|
|
6
|
+
{%- endfor %}
|
|
7
|
+
{%- if font_faces is defined and font_faces %}
|
|
8
|
+
<style id="sphinx-fonts">
|
|
9
|
+
{%- for face in font_faces %}
|
|
10
|
+
@font-face {
|
|
11
|
+
font-family: "{{ face.family }}";
|
|
12
|
+
font-style: {{ face.style }};
|
|
13
|
+
font-weight: {{ face.weight }};
|
|
14
|
+
font-display: block;
|
|
15
|
+
src: url("{{ pathto('_static/fonts/' + face.filename, 1) }}") format("woff2");
|
|
16
|
+
}
|
|
17
|
+
{%- endfor %}
|
|
18
|
+
{%- for fb in font_fallbacks|default([]) %}
|
|
19
|
+
@font-face {
|
|
20
|
+
font-family: "{{ fb.family }}";
|
|
21
|
+
src: {{ fb.src }};
|
|
22
|
+
size-adjust: {{ fb.size_adjust }};
|
|
23
|
+
ascent-override: {{ fb.ascent_override }};
|
|
24
|
+
descent-override: {{ fb.descent_override }};
|
|
25
|
+
line-gap-override: {{ fb.line_gap_override }};
|
|
26
|
+
}
|
|
27
|
+
{%- endfor %}
|
|
28
|
+
body {
|
|
29
|
+
{%- for var, value in font_css_variables.items() %}
|
|
30
|
+
{{ var }}: {{ value }};
|
|
31
|
+
{%- endfor %}
|
|
32
|
+
}
|
|
33
|
+
</style>
|
|
34
|
+
{%- endif %}
|
|
35
|
+
{%- if theme_show_meta_manifest_tag == true %}
|
|
36
|
+
<link rel="manifest" href="/manifest.json">
|
|
37
|
+
{% endif -%}
|
|
38
|
+
{%- if theme_show_meta_og_tags == true %}
|
|
39
|
+
<meta name="description" content="{{ theme_project_description }}">
|
|
40
|
+
|
|
41
|
+
<!-- Open Graph / Facebook -->
|
|
42
|
+
<meta property="og:type" content="website">
|
|
43
|
+
<meta property="og:url" content="{{ theme_project_url }}/">
|
|
44
|
+
<meta property="og:title" content="{{ theme_project_title }}">
|
|
45
|
+
<meta property="og:description" content="{{ theme_project_description }}">
|
|
46
|
+
<meta property="og:image" itemprop="image" content="{{ theme_project_url }}/_static/img/icons/icon-192x192.png">
|
|
47
|
+
|
|
48
|
+
<!-- Twitter -->
|
|
49
|
+
<meta property="twitter:card" content="summary_large_image">
|
|
50
|
+
<meta property="twitter:url" content="{{ theme_project_url }} ">
|
|
51
|
+
<meta property="twitter:title" content="{{ theme_project_title }}">
|
|
52
|
+
<meta property="twitter:description" content="{{ theme_project_description }}">
|
|
53
|
+
<meta property="twitter:image" content="{{ theme_project_url }}/_static/img/icons/icon-512x512.png">
|
|
54
|
+
{% endif -%}
|
|
55
|
+
{%- if theme_show_meta_app_icon_tags == true %}
|
|
56
|
+
<meta name="theme-color" content="#ffffff">
|
|
57
|
+
<meta name="application-name" content="{{ theme_project_name }}">
|
|
58
|
+
|
|
59
|
+
<link rel="shortcut icon" href="/_static/favicon.ico">
|
|
60
|
+
<link rel="icon" type="image/png" sizes="512x512" href="/_static/img/icons/icon-512x512.png">
|
|
61
|
+
<link rel="icon" type="image/png" sizes="192x192" href="/_static/img/icons/icon-192x192.png">
|
|
62
|
+
<link rel="icon" type="image/png" sizes="32x32" href="/_static/img/icons/icon-32x32.png">
|
|
63
|
+
<link rel="icon" type="image/png" sizes="96x96" href="/_static/img/icons/icon-96x96.png">
|
|
64
|
+
<link rel="icon" type="image/png" sizes="16x16" href="/_static/img/icons/icon-16x16.png">
|
|
65
|
+
|
|
66
|
+
<!-- Apple -->
|
|
67
|
+
<meta name="apple-mobile-web-app-title" content="{{ theme_project_name }}">
|
|
68
|
+
|
|
69
|
+
<link rel="apple-touch-icon" sizes="192x192" href="/_static/img/icons/icon-192x192.png">
|
|
70
|
+
|
|
71
|
+
<!-- Microsoft -->
|
|
72
|
+
<meta name="msapplication-TileColor" content="#ffffff">
|
|
73
|
+
<meta name="msapplication-TileImage" content="/_static/img/icons/ms-icon-144x144.png">
|
|
74
|
+
{% endif -%}
|
|
75
|
+
{%- if theme_mask_icon %}
|
|
76
|
+
<link rel="mask-icon" href="{{ theme_mask_icon }}" color="grey">
|
|
77
|
+
{%- endif %}
|
|
78
|
+
{% endblock %}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<a class="sidebar-brand{% if logo %} centered{% endif %}" href="{{ pathto(master_doc) }}">
|
|
2
|
+
{%- block brand_content %}
|
|
3
|
+
{%- if logo_url %}
|
|
4
|
+
<div class="sidebar-logo-container">
|
|
5
|
+
<img class="sidebar-logo" src="{{ logo_url }}" width="200" height="200" decoding="async" alt="Logo"/>
|
|
6
|
+
</div>
|
|
7
|
+
{%- endif %}
|
|
8
|
+
{%- if theme_light_logo and theme_dark_logo %}
|
|
9
|
+
<div class="sidebar-logo-container">
|
|
10
|
+
<img class="sidebar-logo only-light" src="{{ pathto('_static/' + theme_light_logo, 1) }}" width="200" height="200" decoding="async" alt="Light Logo"/>
|
|
11
|
+
<img class="sidebar-logo only-dark" src="{{ pathto('_static/' + theme_dark_logo, 1) }}" width="200" height="200" decoding="async" alt="Dark Logo"/>
|
|
12
|
+
</div>
|
|
13
|
+
{%- endif %}
|
|
14
|
+
{% if not theme_sidebar_hide_name %}
|
|
15
|
+
<span class="sidebar-brand-text">{{ docstitle if docstitle else project }}</span>
|
|
16
|
+
{%- endif %}
|
|
17
|
+
{% endblock brand_content %}
|
|
18
|
+
</a>
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
<div class="sidebar-tree projects" id="sidebar-projects">
|
|
2
|
+
<p class="caption" role="heading">
|
|
3
|
+
<span class="caption-text"
|
|
4
|
+
>team git-pull / <a href="https://tony.sh">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">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
|
+
<span class="indent">
|
|
17
|
+
<a class="internal" href="https://tmuxp.git-pull.com">tmuxp</a>
|
|
18
|
+
</span>
|
|
19
|
+
<span class="indent">
|
|
20
|
+
<a class="internal" href="https://libtmux.git-pull.com">libtmux</a>
|
|
21
|
+
(<a class="internal" href="https://libtmux-mcp.git-pull.com">mcp</a>,
|
|
22
|
+
<a class="internal" href="https://libtmux.git-pull.com/pytest-plugin/">pytest</a>)
|
|
23
|
+
</span>
|
|
24
|
+
</p>
|
|
25
|
+
|
|
26
|
+
<p class="indented-block">
|
|
27
|
+
<span class="project-name">cihai</span>
|
|
28
|
+
<span class="indent">
|
|
29
|
+
<a class="internal" href="https://unihan-etl.git-pull.com">unihan-etl</a>
|
|
30
|
+
(<a class="internal" href="https://unihan-db.git-pull.com">db</a>)
|
|
31
|
+
</span>
|
|
32
|
+
<span class="indent">
|
|
33
|
+
<a class="internal" href="https://cihai.git-pull.com">cihai</a>
|
|
34
|
+
(<a class="internal" href="https://cihai-cli.git-pull.com">cli</a>)
|
|
35
|
+
</span>
|
|
36
|
+
</p>
|
|
37
|
+
|
|
38
|
+
<p class="indented-block">
|
|
39
|
+
<span class="project-name">django</span>
|
|
40
|
+
<span class="indent">
|
|
41
|
+
<a class="internal" href="https://django-slugify-processor.git-pull.com">django-slugify-processor</a>
|
|
42
|
+
</span>
|
|
43
|
+
<span class="indent">
|
|
44
|
+
<a class="internal" href="https://django-docutils.git-pull.com">django-docutils</a>
|
|
45
|
+
</span>
|
|
46
|
+
</p>
|
|
47
|
+
|
|
48
|
+
<p class="indented-block">
|
|
49
|
+
<span class="project-name">docs + tests</span>
|
|
50
|
+
<span class="indent">
|
|
51
|
+
<a class="internal" href="https://gp-libs.git-pull.com">gp-libs</a>
|
|
52
|
+
</span>
|
|
53
|
+
</p>
|
|
54
|
+
|
|
55
|
+
<p class="indented-block">
|
|
56
|
+
<span class="project-name">web</span>
|
|
57
|
+
<span class="indent">
|
|
58
|
+
<a class="internal" href="https://social-embed.org">social-embed</a>
|
|
59
|
+
</span>
|
|
60
|
+
</p>
|
|
61
|
+
</div>
|
|
62
|
+
<script type="text/javascript">
|
|
63
|
+
(() => {
|
|
64
|
+
const sidebar = document.getElementById("sidebar-projects");
|
|
65
|
+
const loc = window.location;
|
|
66
|
+
sidebar.querySelectorAll("a[href]").forEach((link) => {
|
|
67
|
+
const url = new URL(link.href, loc.origin);
|
|
68
|
+
const sameHost = url.hostname === loc.hostname;
|
|
69
|
+
const hasPath = url.pathname.replace(/\/+$/, "").length > 0;
|
|
70
|
+
// Links with a pathname: match origin + path prefix (e.g. /pytest-plugin/)
|
|
71
|
+
// Links without: match hostname only (e.g. https://libtmux.git-pull.com)
|
|
72
|
+
const isActive = hasPath
|
|
73
|
+
? sameHost && loc.pathname.startsWith(url.pathname.replace(/\/+$/, ""))
|
|
74
|
+
: sameHost;
|
|
75
|
+
if (isActive && !link.classList.contains("active")) {
|
|
76
|
+
const d = document.createElement('span');
|
|
77
|
+
d.textContent = link.textContent;
|
|
78
|
+
d.classList.add("active");
|
|
79
|
+
link.parentNode.replaceChild(d, link);
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
sidebar.classList.add('ready');
|
|
83
|
+
})()
|
|
84
|
+
</script>
|
|
@@ -0,0 +1,437 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Argparse/CLI Highlighting Styles
|
|
3
|
+
*
|
|
4
|
+
* Styles for CLI inline roles and argparse help output highlighting.
|
|
5
|
+
* Uses "One Dark" inspired color palette (Python 3.14 argparse style).
|
|
6
|
+
*
|
|
7
|
+
* Color Palette:
|
|
8
|
+
* Background: #282C34
|
|
9
|
+
* Default text: #CCCED4
|
|
10
|
+
* Usage label: #61AFEF (blue, bold)
|
|
11
|
+
* Program name: #C678DD (purple, bold)
|
|
12
|
+
* Subcommands: #98C379 (green)
|
|
13
|
+
* Options: #56B6C2 (teal)
|
|
14
|
+
* Metavars: #E5C07B (yellow, italic)
|
|
15
|
+
* Choices: #98C379 (green)
|
|
16
|
+
* Headings: #E5E5E5 (bright, bold)
|
|
17
|
+
* Punctuation: #CCCED4
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/* ==========================================================================
|
|
21
|
+
Inline Role Styles
|
|
22
|
+
========================================================================== */
|
|
23
|
+
|
|
24
|
+
/*
|
|
25
|
+
* Shared monospace font and code font-size for all CLI inline roles
|
|
26
|
+
*/
|
|
27
|
+
.cli-option,
|
|
28
|
+
.cli-metavar,
|
|
29
|
+
.cli-command,
|
|
30
|
+
.cli-default,
|
|
31
|
+
.cli-choice {
|
|
32
|
+
font-family: var(--font-stack--monospace);
|
|
33
|
+
font-size: var(--code-font-size);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/*
|
|
37
|
+
* CLI Options
|
|
38
|
+
*
|
|
39
|
+
* Long options (--verbose) and short options (-h) both use teal color.
|
|
40
|
+
*/
|
|
41
|
+
.cli-option-long,
|
|
42
|
+
.cli-option-short {
|
|
43
|
+
color: #56b6c2;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/*
|
|
47
|
+
* CLI Metavars
|
|
48
|
+
*
|
|
49
|
+
* Placeholder values like FILE, PATH, DIRECTORY.
|
|
50
|
+
* Yellow/amber to indicate "replace me" - distinct from flags (teal).
|
|
51
|
+
*/
|
|
52
|
+
.cli-metavar {
|
|
53
|
+
color: #e5c07b;
|
|
54
|
+
font-style: italic;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/*
|
|
58
|
+
* CLI Commands and Choices
|
|
59
|
+
*
|
|
60
|
+
* Both use green to indicate valid enumerated values.
|
|
61
|
+
* Commands: subcommand names like sync, add, list
|
|
62
|
+
* Choices: enumeration values like json, yaml, table
|
|
63
|
+
*/
|
|
64
|
+
.cli-command,
|
|
65
|
+
.cli-choice {
|
|
66
|
+
color: #98c379;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.cli-command {
|
|
70
|
+
font-weight: bold;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/*
|
|
74
|
+
* CLI Default Values
|
|
75
|
+
*
|
|
76
|
+
* Default values shown in help text like None, "auto".
|
|
77
|
+
* Subtle styling to not distract from options.
|
|
78
|
+
*/
|
|
79
|
+
.cli-default {
|
|
80
|
+
color: #ccced4;
|
|
81
|
+
font-style: italic;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* ==========================================================================
|
|
85
|
+
Argparse Code Block Highlighting
|
|
86
|
+
========================================================================== */
|
|
87
|
+
|
|
88
|
+
/*
|
|
89
|
+
* These styles apply within Pygments-highlighted code blocks using the
|
|
90
|
+
* argparse, argparse-usage, or argparse-help lexers.
|
|
91
|
+
*/
|
|
92
|
+
|
|
93
|
+
/* Usage heading "usage:" - bold blue */
|
|
94
|
+
.highlight-argparse .gh,
|
|
95
|
+
.highlight-argparse-usage .gh,
|
|
96
|
+
.highlight-argparse-help .gh {
|
|
97
|
+
color: #61afef;
|
|
98
|
+
font-weight: bold;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* Section headers like "positional arguments:", "options:" - neutral bright */
|
|
102
|
+
.highlight-argparse .gs,
|
|
103
|
+
.highlight-argparse-help .gs {
|
|
104
|
+
color: #e5e5e5;
|
|
105
|
+
font-weight: bold;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/* Long options --foo - teal */
|
|
109
|
+
.highlight-argparse .nt,
|
|
110
|
+
.highlight-argparse-usage .nt,
|
|
111
|
+
.highlight-argparse-help .nt {
|
|
112
|
+
color: #56b6c2;
|
|
113
|
+
font-weight: normal;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/* Short options -h - teal (same as long) */
|
|
117
|
+
.highlight-argparse .na,
|
|
118
|
+
.highlight-argparse-usage .na,
|
|
119
|
+
.highlight-argparse-help .na {
|
|
120
|
+
color: #56b6c2;
|
|
121
|
+
font-weight: normal;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/* Metavar placeholders FILE, PATH - yellow/amber italic */
|
|
125
|
+
.highlight-argparse .nv,
|
|
126
|
+
.highlight-argparse-usage .nv,
|
|
127
|
+
.highlight-argparse-help .nv {
|
|
128
|
+
color: #e5c07b;
|
|
129
|
+
font-style: italic;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/* Command/program names - purple bold */
|
|
133
|
+
.highlight-argparse .nl,
|
|
134
|
+
.highlight-argparse-usage .nl,
|
|
135
|
+
.highlight-argparse-help .nl {
|
|
136
|
+
color: #c678dd;
|
|
137
|
+
font-weight: bold;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* Subcommands - bold green */
|
|
141
|
+
.highlight-argparse .nf,
|
|
142
|
+
.highlight-argparse-usage .nf,
|
|
143
|
+
.highlight-argparse-help .nf {
|
|
144
|
+
color: #98c379;
|
|
145
|
+
font-weight: bold;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/* Choice values - green */
|
|
149
|
+
.highlight-argparse .no,
|
|
150
|
+
.highlight-argparse-usage .no,
|
|
151
|
+
.highlight-argparse-help .no,
|
|
152
|
+
.highlight-argparse .nc,
|
|
153
|
+
.highlight-argparse-usage .nc,
|
|
154
|
+
.highlight-argparse-help .nc {
|
|
155
|
+
color: #98c379;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/* Punctuation [], {}, () - neutral gray */
|
|
159
|
+
.highlight-argparse .p,
|
|
160
|
+
.highlight-argparse-usage .p,
|
|
161
|
+
.highlight-argparse-help .p {
|
|
162
|
+
color: #ccced4;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/* Operators like | - neutral gray */
|
|
166
|
+
.highlight-argparse .o,
|
|
167
|
+
.highlight-argparse-usage .o,
|
|
168
|
+
.highlight-argparse-help .o {
|
|
169
|
+
color: #ccced4;
|
|
170
|
+
font-weight: normal;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/* ==========================================================================
|
|
174
|
+
Argparse Directive Highlighting (.. argparse:: output)
|
|
175
|
+
========================================================================== */
|
|
176
|
+
|
|
177
|
+
/*
|
|
178
|
+
* These styles apply to the argparse directive output which uses custom
|
|
179
|
+
* nodes rendered by sphinx_autodoc_argparse. The directive adds highlight spans
|
|
180
|
+
* directly to the HTML output.
|
|
181
|
+
*/
|
|
182
|
+
|
|
183
|
+
/*
|
|
184
|
+
* Usage Block (.argparse-usage)
|
|
185
|
+
*
|
|
186
|
+
* The usage block now has both .argparse-usage and .highlight-argparse-usage
|
|
187
|
+
* classes. The .highlight-argparse-usage selectors above already handle the
|
|
188
|
+
* token highlighting. These selectors provide fallback and ensure consistent
|
|
189
|
+
* styling.
|
|
190
|
+
*/
|
|
191
|
+
|
|
192
|
+
/* Usage block container - match Pygments monokai background and code block styling */
|
|
193
|
+
pre.argparse-usage {
|
|
194
|
+
background: var(--argparse-code-background);
|
|
195
|
+
font-size: var(--code-font-size);
|
|
196
|
+
padding: 0.625rem 0.875rem;
|
|
197
|
+
line-height: 1.5;
|
|
198
|
+
border-radius: 0.2rem;
|
|
199
|
+
scrollbar-color: var(--color-foreground-border) transparent;
|
|
200
|
+
scrollbar-width: thin;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.argparse-usage .gh {
|
|
204
|
+
color: #61afef;
|
|
205
|
+
font-weight: bold;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.argparse-usage .nt {
|
|
209
|
+
color: #56b6c2;
|
|
210
|
+
font-weight: normal;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.argparse-usage .na {
|
|
214
|
+
color: #56b6c2;
|
|
215
|
+
font-weight: normal;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.argparse-usage .nv {
|
|
219
|
+
color: #e5c07b;
|
|
220
|
+
font-style: italic;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.argparse-usage .nl {
|
|
224
|
+
color: #c678dd;
|
|
225
|
+
font-weight: bold;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.argparse-usage .nf {
|
|
229
|
+
color: #98c379;
|
|
230
|
+
font-weight: bold;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.argparse-usage .no,
|
|
234
|
+
.argparse-usage .nc {
|
|
235
|
+
color: #98c379;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.argparse-usage .o {
|
|
239
|
+
color: #ccced4;
|
|
240
|
+
font-weight: normal;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.argparse-usage .p {
|
|
244
|
+
color: #ccced4;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/*
|
|
248
|
+
* Argument Name (<dt class="argparse-argument-name">)
|
|
249
|
+
*
|
|
250
|
+
* The argument names in the dl/dt structure are highlighted with
|
|
251
|
+
* semantic spans for options and metavars.
|
|
252
|
+
*/
|
|
253
|
+
.argparse-argument-name .nt {
|
|
254
|
+
color: #56b6c2;
|
|
255
|
+
font-weight: normal;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.argparse-argument-name .na {
|
|
259
|
+
color: #56b6c2;
|
|
260
|
+
font-weight: normal;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.argparse-argument-name .nv {
|
|
264
|
+
color: #e5c07b;
|
|
265
|
+
font-style: italic;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.argparse-argument-name .nl {
|
|
269
|
+
color: #c678dd;
|
|
270
|
+
font-weight: bold;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/* ==========================================================================
|
|
274
|
+
Argument Wrapper and Linking Styles
|
|
275
|
+
========================================================================== */
|
|
276
|
+
|
|
277
|
+
/*
|
|
278
|
+
* Argparse-specific code background (monokai #272822)
|
|
279
|
+
* Uses a custom variable to avoid affecting Furo's --color-inline-code-background.
|
|
280
|
+
*/
|
|
281
|
+
:root {
|
|
282
|
+
--argparse-code-background: #272822;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/*
|
|
286
|
+
* Background styling for argument names - subtle background like code.literal
|
|
287
|
+
* This provides visual weight and hierarchy for argument definitions.
|
|
288
|
+
*/
|
|
289
|
+
.argparse-argument-name {
|
|
290
|
+
background: var(--argparse-code-background);
|
|
291
|
+
border-radius: 0.2rem;
|
|
292
|
+
padding: 0.485rem 0.875rem;
|
|
293
|
+
font-family: var(--font-stack--monospace);
|
|
294
|
+
font-size: var(--code-font-size);
|
|
295
|
+
width: fit-content;
|
|
296
|
+
position: relative;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/*
|
|
300
|
+
* Wrapper for linking - enables scroll-margin for fixed header navigation
|
|
301
|
+
* and :target pseudo-class for highlighting when linked.
|
|
302
|
+
*/
|
|
303
|
+
.argparse-argument-wrapper {
|
|
304
|
+
scroll-margin-top: 2.5rem;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
/*
|
|
308
|
+
* Headerlink anchor (¶) - hidden until hover
|
|
309
|
+
* Positioned outside the dt element to the right.
|
|
310
|
+
* Follows Sphinx documentation convention for linkable headings.
|
|
311
|
+
*/
|
|
312
|
+
.argparse-argument-name .headerlink {
|
|
313
|
+
visibility: hidden;
|
|
314
|
+
position: absolute;
|
|
315
|
+
right: -1.5rem;
|
|
316
|
+
top: 50%;
|
|
317
|
+
transform: translateY(-50%);
|
|
318
|
+
color: var(--color-foreground-secondary);
|
|
319
|
+
text-decoration: none;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/*
|
|
323
|
+
* Show headerlink on hover or when targeted via URL fragment
|
|
324
|
+
*/
|
|
325
|
+
.argparse-argument-wrapper:hover .headerlink,
|
|
326
|
+
.argparse-argument-wrapper:target .headerlink {
|
|
327
|
+
visibility: visible;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.argparse-argument-name .headerlink:hover:not(:visited) {
|
|
331
|
+
color: var(--color-foreground-primary);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
/*
|
|
335
|
+
* Light mode headerlink color overrides
|
|
336
|
+
* Needed because code block has dark background regardless of theme
|
|
337
|
+
*/
|
|
338
|
+
body[data-theme="light"] .argparse-argument-name .headerlink {
|
|
339
|
+
color: #9ca0a5;
|
|
340
|
+
|
|
341
|
+
&:hover:not(:visited) {
|
|
342
|
+
color: #cfd0d0;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
@media (prefers-color-scheme: light) {
|
|
347
|
+
body:not([data-theme="dark"]) .argparse-argument-name .headerlink {
|
|
348
|
+
color: #9ca0a5;
|
|
349
|
+
|
|
350
|
+
&:hover:not(:visited) {
|
|
351
|
+
color: #cfd0d0;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/*
|
|
357
|
+
* Highlight when targeted via URL fragment
|
|
358
|
+
* Uses Furo's highlight-on-target color for consistency.
|
|
359
|
+
*/
|
|
360
|
+
.argparse-argument-wrapper:target .argparse-argument-name {
|
|
361
|
+
background-color: var(--color-highlight-on-target);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
/*
|
|
365
|
+
* Argument metadata definition list
|
|
366
|
+
*
|
|
367
|
+
* Renders metadata (Default, Type, Choices, Required) as a horizontal
|
|
368
|
+
* flexbox of key-value pairs and standalone tags.
|
|
369
|
+
*/
|
|
370
|
+
.argparse-argument-meta {
|
|
371
|
+
margin: 0.5rem 0 0 0;
|
|
372
|
+
padding: 0;
|
|
373
|
+
display: flex;
|
|
374
|
+
flex-wrap: wrap;
|
|
375
|
+
gap: 0.5rem 1rem;
|
|
376
|
+
align-items: center;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.argparse-meta-item {
|
|
380
|
+
display: flex;
|
|
381
|
+
align-items: center;
|
|
382
|
+
gap: 0.25rem;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
.argparse-meta-key {
|
|
386
|
+
color: var(--color-foreground-secondary, #6c757d);
|
|
387
|
+
font-size: var(--code-font-size);
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
.argparse-meta-key::after {
|
|
391
|
+
content: ":";
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
.argparse-meta-value .nv {
|
|
395
|
+
background: var(--argparse-code-background);
|
|
396
|
+
border-radius: 0.2rem;
|
|
397
|
+
padding: 0.1rem 0.3rem;
|
|
398
|
+
font-family: var(--font-stack--monospace);
|
|
399
|
+
font-size: var(--code-font-size);
|
|
400
|
+
color: #e5c07b;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
/*
|
|
404
|
+
* Meta tag (e.g., "Required") - follows Furo's guilabel pattern
|
|
405
|
+
* Uses semi-transparent amber background with border for visibility
|
|
406
|
+
* without the harshness of solid fills. Amber conveys "needs attention".
|
|
407
|
+
*/
|
|
408
|
+
.argparse-meta-tag {
|
|
409
|
+
background-color: #fef3c780;
|
|
410
|
+
border: 1px solid #fcd34d80;
|
|
411
|
+
color: var(--color-foreground-primary);
|
|
412
|
+
font-size: var(--code-font-size);
|
|
413
|
+
padding: 0.1rem 0.4rem;
|
|
414
|
+
border-radius: 0.2rem;
|
|
415
|
+
font-weight: 500;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
/* Dark mode: darker amber with adjusted border */
|
|
419
|
+
body[data-theme="dark"] .argparse-meta-tag {
|
|
420
|
+
background-color: #78350f60;
|
|
421
|
+
border-color: #b4530980;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
@media (prefers-color-scheme: dark) {
|
|
425
|
+
body:not([data-theme="light"]) .argparse-meta-tag {
|
|
426
|
+
background-color: #78350f60;
|
|
427
|
+
border-color: #b4530980;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
/*
|
|
432
|
+
* Help text description
|
|
433
|
+
* Adds spacing above for visual separation from argument name.
|
|
434
|
+
*/
|
|
435
|
+
.argparse-argument-help {
|
|
436
|
+
padding-block-start: 0.5rem;
|
|
437
|
+
}
|