Skip to content

Commit d71f1f7

Browse files
committed
Update stylesheets
1 parent edc41d8 commit d71f1f7

File tree

4 files changed

+917
-27
lines changed

4 files changed

+917
-27
lines changed

docs/mkdocs.yml

Lines changed: 38 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,62 @@
1-
site_name: libCacheSim Python Documentation
1+
site_name: libCacheSim Python
22
site_url: https://cachemon.github.io/libCacheSim-python/
33
repo_url: https://github.com/cacheMon/libCacheSim-python
44
repo_name: cacheMon/libCacheSim-python
5+
edit_uri: edit/main/docs/src/
56

67
docs_dir: src
78

89
nav:
9-
- Home: index.md
10-
- Quick Start: quickstart.md
11-
- API Reference: api.md
12-
- Examples: examples.md
10+
- Home:
11+
- libCacheSim Python: index.md
12+
- Getting Started:
13+
- Quick Start: quickstart.md
14+
- API Reference:
15+
- API Documentation: api.md
16+
- Examples:
17+
- Usage Examples: examples.md
1318

1419
theme:
1520
name: material
1621
language: en
1722
palette:
23+
# Palette toggle for automatic mode
24+
- media: "(prefers-color-scheme)"
25+
toggle:
26+
icon: material/brightness-auto
27+
name: Switch to light mode
1828
# Palette toggle for light mode
19-
- scheme: default
20-
primary: custom
21-
accent: custom
29+
- media: "(prefers-color-scheme: light)"
30+
scheme: default
31+
primary: white
2232
toggle:
2333
icon: material/brightness-7
2434
name: Switch to dark mode
25-
# Palette toggle for dark mode
26-
- scheme: slate
27-
primary: custom
28-
accent: custom
35+
# Palette toggle for dark mode
36+
- media: "(prefers-color-scheme: dark)"
37+
scheme: slate
38+
primary: black
2939
toggle:
3040
icon: material/brightness-4
31-
name: Switch to light mode
41+
name: Switch to system preference
3242
font:
3343
text: Open Sans
3444
features:
35-
- header.autohide
45+
- content.action.edit
46+
- content.code.copy
47+
- content.tabs.link
48+
- navigation.tracking
3649
- navigation.tabs
37-
- navigation.footer
50+
- navigation.tabs.sticky
3851
- navigation.sections
39-
- navigation.expand
40-
- navigation.path
52+
- navigation.prune
4153
- navigation.top
42-
- toc.follow
4354
- search.highlight
4455
- search.share
45-
- search.suggest
46-
- content.code.copy
47-
- content.code.annotate
56+
- toc.follow
4857

4958
extra_css:
50-
- ../stylesheets/extra.css
59+
- stylesheets/extra.css
5160

5261
plugins:
5362
- search
@@ -71,25 +80,29 @@ plugins:
7180
Examples: 使用示例
7281

7382
markdown_extensions:
83+
- attr_list
84+
- md_in_html
7485
- admonition
7586
- pymdownx.details
7687
- pymdownx.superfences:
7788
custom_fences:
7889
- name: mermaid
7990
class: mermaid
8091
format: !!python/name:pymdownx.superfences.fence_code_format
92+
- pymdownx.tabbed:
93+
alternate_style: true
8194
- pymdownx.highlight:
8295
anchor_linenums: true
8396
line_spans: __span
8497
pygments_lang_class: true
8598
- pymdownx.inlinehilite
8699
- pymdownx.snippets
87-
- pymdownx.tabbed:
88-
alternate_style: true
89100
- pymdownx.keys
90101
- pymdownx.mark
91102
- pymdownx.tilde
92-
- codehilite
103+
- pymdownx.emoji:
104+
emoji_index: !!python/name:material.extensions.emoji.twemoji
105+
emoji_generator: !!python/name:material.extensions.emoji.to_svg
93106
- toc:
94107
permalink: true
95108
- tables

docs/src/stylesheets/extra.css

Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
/* Adapted from vllm project */
2+
3+
/* Warning for latest docs */
4+
.md-banner {
5+
background-color: var(--md-warning-bg-color);
6+
color: var(--md-warning-fg-color);
7+
}
8+
9+
/* https://christianoliff.com/blog/styling-external-links-with-an-icon-in-css/ */
10+
a:not(:has(svg)):not(.md-icon):not(.autorefs-external) {
11+
align-items: center;
12+
13+
&[href^="//"]::after,
14+
&[href^="http://"]::after,
15+
&[href^="https://"]::after {
16+
content: "";
17+
width: 12px;
18+
height: 12px;
19+
margin-left: 4px;
20+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' stroke='gray' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M8.636 3.5a.5.5 0 0 0-.5-.5H1.5A1.5 1.5 0 0 0 0 4.5v10A1.5 1.5 0 0 0 1.5 16h10a1.5 1.5 0 0 0 1.5-1.5V7.864a.5.5 0 0 0-1 0V14.5a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h6.636a.5.5 0 0 0 .5-.5z'/%3E%3Cpath fill-rule='evenodd' d='M16 .5a.5.5 0 0 0-.5-.5h-5a.5.5 0 0 0 0 1h3.793L6.146 9.146a.5.5 0 1 0 .708.708L15 1.707V5.5a.5.5 0 0 0 1 0v-5z'/%3E%3C/svg%3E");
21+
background-position: center;
22+
background-repeat: no-repeat;
23+
background-size: contain;
24+
display: inline-block;
25+
}
26+
}
27+
28+
/* Light mode: darker section titles */
29+
body[data-md-color-scheme="default"] .md-nav__item--section > label.md-nav__link .md-ellipsis {
30+
color: rgba(0, 0, 0, 0.7) !important;
31+
font-weight: 700;
32+
}
33+
34+
/* Dark mode: lighter gray section titles */
35+
body[data-md-color-scheme="slate"] .md-nav__item--section > label.md-nav__link .md-ellipsis {
36+
color: rgba(255, 255, 255, 0.75) !important;
37+
font-weight: 700;
38+
}
39+
40+
/* Custom admonitions */
41+
:root {
42+
--md-admonition-icon--announcement: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path d="M3.25 9a.75.75 0 0 1 .75.75c0 2.142.456 3.828.733 4.653a.122.122 0 0 0 .05.064.212.212 0 0 0 .117.033h1.31c.085 0 .18-.042.258-.152a.45.45 0 0 0 .075-.366A16.743 16.743 0 0 1 6 9.75a.75.75 0 0 1 1.5 0c0 1.588.25 2.926.494 3.85.293 1.113-.504 2.4-1.783 2.4H4.9c-.686 0-1.35-.41-1.589-1.12A16.4 16.4 0 0 1 2.5 9.75.75.75 0 0 1 3.25 9Z"></path><path d="M0 6a4 4 0 0 1 4-4h2.75a.75.75 0 0 1 .75.75v6.5a.75.75 0 0 1-.75.75H4a4 4 0 0 1-4-4Zm4-2.5a2.5 2.5 0 1 0 0 5h2v-5Z"></path><path d="M15.59.082A.75.75 0 0 1 16 .75v10.5a.75.75 0 0 1-1.189.608l-.002-.001h.001l-.014-.01a5.775 5.775 0 0 0-.422-.25 10.63 10.63 0 0 0-1.469-.64C11.576 10.484 9.536 10 6.75 10a.75.75 0 0 1 0-1.5c2.964 0 5.174.516 6.658 1.043.423.151.787.302 1.092.443V2.014c-.305.14-.669.292-1.092.443C11.924 2.984 9.713 3.5 6.75 3.5a.75.75 0 0 1 0-1.5c2.786 0 4.826-.484 6.155-.957.665-.236 1.154-.47 1.47-.64.144-.077.284-.161.421-.25l.014-.01a.75.75 0 0 1 .78-.061Z"></path></svg>');
43+
--md-admonition-icon--important: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path d="M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></svg>');
44+
--md-admonition-icon--code: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.75.75 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.75.75 0 0 1 .734.215m-6.56 0a.75.75 0 0 1 1.042.018.75.75 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.75.75 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"/></svg>');
45+
--md-admonition-icon--console: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M0 2.75C0 1.784.784 1 1.75 1h12.5c.966 0 1.75.784 1.75 1.75v10.5A1.75 1.75 0 0 1 14.25 15H1.75A1.75 1.75 0 0 1 0 13.25Zm1.75-.25a.25.25 0 0 0-.25.25v10.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V2.75a.25.25 0 0 0-.25-.25ZM7.25 8a.75.75 0 0 1-.22.53l-2.25 2.25a.749.749 0 0 1-1.275-.326.75.75 0 0 1 .215-.734L5.44 8 3.72 6.28a.749.749 0 0 1 .326-1.275.75.75 0 0 1 .734.215l2.25 2.25c.141.14.22.331.22.53m1.5 1.5h3a.75.75 0 0 1 0 1.5h-3a.75.75 0 0 1 0-1.5"/></svg>');
46+
}
47+
48+
.md-typeset .admonition.announcement,
49+
.md-typeset details.announcement {
50+
border-color: rgb(255, 110, 66);
51+
}
52+
.md-typeset .admonition.important,
53+
.md-typeset details.important {
54+
border-color: rgb(239, 85, 82);
55+
}
56+
.md-typeset .admonition.code,
57+
.md-typeset details.code {
58+
border-color: #64dd17
59+
}
60+
.md-typeset .admonition.console,
61+
.md-typeset details.console {
62+
border-color: #64dd17
63+
}
64+
65+
.md-typeset .announcement > .admonition-title,
66+
.md-typeset .announcement > summary {
67+
background-color: rgb(255, 110, 66, 0.1);
68+
}
69+
.md-typeset .important > .admonition-title,
70+
.md-typeset .important > summary {
71+
background-color: rgb(239, 85, 82, 0.1);
72+
}
73+
.md-typeset .code > .admonition-title,
74+
.md-typeset .code > summary {
75+
background-color: #64dd171a;
76+
}
77+
.md-typeset .console > .admonition-title,
78+
.md-typeset .console > summary {
79+
background-color: #64dd171a;
80+
}
81+
82+
.md-typeset .announcement > .admonition-title::before,
83+
.md-typeset .announcement > summary::before {
84+
background-color: rgb(239, 85, 82);
85+
-webkit-mask-image: var(--md-admonition-icon--announcement);
86+
mask-image: var(--md-admonition-icon--announcement);
87+
}
88+
.md-typeset .important > .admonition-title::before,
89+
.md-typeset .important > summary::before {
90+
background-color: rgb(239, 85, 82);
91+
-webkit-mask-image: var(--md-admonition-icon--important);
92+
mask-image: var(--md-admonition-icon--important);
93+
}
94+
.md-typeset .code > .admonition-title::before,
95+
.md-typeset .code > summary::before {
96+
background-color: #64dd17;
97+
-webkit-mask-image: var(--md-admonition-icon--code);
98+
mask-image: var(--md-admonition-icon--code);
99+
}
100+
.md-typeset .console > .admonition-title::before,
101+
.md-typeset .console > summary::before {
102+
background-color: #64dd17;
103+
-webkit-mask-image: var(--md-admonition-icon--console);
104+
mask-image: var(--md-admonition-icon--console);
105+
}
106+
107+
/* Make label fully visible on hover */
108+
.md-content__button[href*="edit"]:hover::after {
109+
opacity: 1;
110+
}
111+
112+
/* Hide edit button on generated docs/examples pages */
113+
@media (min-width: 960px) {
114+
.md-content__button[href*="docs/examples/"] {
115+
display: none !important;
116+
}
117+
}
118+
119+
.md-content__button-wrapper {
120+
position: absolute;
121+
top: 0.6rem;
122+
right: 0.8rem;
123+
display: flex;
124+
flex-direction: row;
125+
align-items: center;
126+
gap: 0.4rem;
127+
z-index: 1;
128+
}
129+
130+
.md-content__button-wrapper a {
131+
display: inline-flex;
132+
align-items: center;
133+
justify-content: center;
134+
height: 24px;
135+
width: 24px;
136+
color: var(--md-default-fg-color);
137+
text-decoration: none;
138+
}
139+
140+
.md-content__button-wrapper a:hover {
141+
color: var(--md-accent-fg-color);
142+
}
143+
144+
/* Slack and Forum css */
145+
.slack-button,
146+
.forum-button {
147+
display: inline-flex;
148+
align-items: center;
149+
justify-content: center;
150+
margin-left: 0.4rem;
151+
height: 24px;
152+
}
153+
154+
.slack-button img {
155+
height: 18px;
156+
filter: none !important;
157+
}
158+
159+
.slack-button:hover,
160+
.forum-button:hover {
161+
opacity: 0.7;
162+
}
163+
164+
.forum-button svg {
165+
height: 28px;
166+
opacity: 0.9;
167+
transform: translateY(2px);
168+
}
169+
170+
/* For logo css */
171+
[data-md-color-scheme="default"] .logo-dark {
172+
display: none;
173+
}
174+
175+
[data-md-color-scheme="slate"] .logo-light {
176+
display: none;
177+
}
178+
179+
/* Outline for content tabs */
180+
.md-typeset .tabbed-set {
181+
border: 0.075rem solid var(--md-default-fg-color);
182+
border-radius: 0.2rem;
183+
}
184+
185+
.md-typeset .tabbed-content {
186+
padding: 0 0.6em;
187+
}

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ test-command = "python -c 'import libcachesim; print(\"Import successful\")'"
7070

7171
[tool.cibuildwheel.linux]
7272
before-all = "yum install -y yum-utils && yum-config-manager --set-enabled crb && yum install -y ninja-build cmake libzstd-devel glib2-devel"
73-
before-build = "rm -rf {project}/src/libCacheSim/build && cmake -S {project} -B {project}/src/libCacheSim/build -G Ninja && cmake --build {project}/src/libCacheSim/build"
73+
before-build = "git submodule update --init --recursive && rm -rf {project}/src/libCacheSim/build && cmake -S {project} -B {project}/src/libCacheSim/build -G Ninja && cmake --build {project}/src/libCacheSim/build"
7474

7575
[tool.cibuildwheel.macos]
7676
before-all = "brew install glib google-perftools argp-standalone xxhash llvm wget cmake ninja zstd xgboost lightgbm"
77-
before-build = "rm -rf {project}/src/libCacheSim/build && cmake -S {project} -B {project}/src/libCacheSim/build -G Ninja -DCMAKE_OSX_DEPLOYMENT_TARGET=14.0 && cmake --build {project}/src/libCacheSim/build"
77+
before-build = "git submodule update --init --recursive && rm -rf {project}/src/libCacheSim/build && cmake -S {project} -B {project}/src/libCacheSim/build -G Ninja -DCMAKE_OSX_DEPLOYMENT_TARGET=14.0 && cmake --build {project}/src/libCacheSim/build"
7878

7979
[tool.ruff]
8080
# Allow lines to be as long as 120.

0 commit comments

Comments
 (0)