Skip to content

Commit 6902e89

Browse files
committed
Improve MkDocs visual preview layout and fix preview rendering/shim issues - 2026-02-22 17:15:06
1 parent cc21d76 commit 6902e89

66 files changed

Lines changed: 176 additions & 25 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/assets/stylesheets/extra.css

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/* Maximize horizontal space for visual preview pages in MkDocs Material. */
2+
3+
/* Hide right-side TOC / secondary sidebar on all widths. */
4+
.md-sidebar--secondary,
5+
.md-sidebar[data-md-type="toc"],
6+
.md-nav--secondary {
7+
display: none !important;
8+
}
9+
10+
/* Remove any reserved margin/gutter for the TOC area. */
11+
.md-content,
12+
.md-content__inner {
13+
margin-right: 0 !important;
14+
}
15+
16+
/* Expand layout width for large screens. */
17+
@media screen and (min-width: 60em) {
18+
.md-grid,
19+
.md-main__inner,
20+
.md-content__inner {
21+
max-width: none !important;
22+
}
23+
}
24+
25+
/* On desktop, force two-column layout (left nav + content), no right TOC column. */
26+
@media screen and (min-width: 76.25em) {
27+
.md-main__inner {
28+
grid-template-columns: minmax(12rem, 15rem) minmax(0, 1fr) !important;
29+
}
30+
}
31+
32+
/* Make embedded previews use more vertical space by default on large screens. */
33+
.md-typeset iframe {
34+
width: 100%;
35+
min-height: 78vh;
36+
}

mkdocs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ markdown_extensions:
2929
- tables
3030
- fenced_code
3131

32+
extra_css:
33+
- assets/stylesheets/extra.css
34+
3235
nav:
3336
- Home: index.md
3437
- Docs Index: docs-index.md

site/404.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747

4848

4949

50+
<link rel="stylesheet" href="/assets/stylesheets/extra.css">
51+
5052
<script>__md_scope=new URL("/",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
5153

5254

site/assets/stylesheets/extra.css

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/* Maximize horizontal space for visual preview pages in MkDocs Material. */
2+
3+
/* Hide right-side TOC / secondary sidebar on all widths. */
4+
.md-sidebar--secondary,
5+
.md-sidebar[data-md-type="toc"],
6+
.md-nav--secondary {
7+
display: none !important;
8+
}
9+
10+
/* Remove any reserved margin/gutter for the TOC area. */
11+
.md-content,
12+
.md-content__inner {
13+
margin-right: 0 !important;
14+
}
15+
16+
/* Expand layout width for large screens. */
17+
@media screen and (min-width: 60em) {
18+
.md-grid,
19+
.md-main__inner,
20+
.md-content__inner {
21+
max-width: none !important;
22+
}
23+
}
24+
25+
/* On desktop, force two-column layout (left nav + content), no right TOC column. */
26+
@media screen and (min-width: 76.25em) {
27+
.md-main__inner {
28+
grid-template-columns: minmax(12rem, 15rem) minmax(0, 1fr) !important;
29+
}
30+
}
31+
32+
/* Make embedded previews use more vertical space by default on large screens. */
33+
.md-typeset iframe {
34+
width: 100%;
35+
min-height: 78vh;
36+
}

site/docs-index/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@
5151

5252

5353

54+
<link rel="stylesheet" href="../assets/stylesheets/extra.css">
55+
5456
<script>__md_scope=new URL("..",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
5557

5658

site/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@
4949

5050

5151

52+
<link rel="stylesheet" href="assets/stylesheets/extra.css">
53+
5254
<script>__md_scope=new URL(".",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
5355

5456

site/release/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@
5151

5252

5353

54+
<link rel="stylesheet" href="../assets/stylesheets/extra.css">
55+
5456
<script>__md_scope=new URL("..",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
5557

5658

site/tools/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@
5151

5252

5353

54+
<link rel="stylesheet" href="../assets/stylesheets/extra.css">
55+
5456
<script>__md_scope=new URL("..",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
5557

5658

site/user-guide/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@
5151

5252

5353

54+
<link rel="stylesheet" href="../assets/stylesheets/extra.css">
55+
5456
<script>__md_scope=new URL("..",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
5557

5658

site/visual-mkdocs-plan/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@
4949

5050

5151

52+
<link rel="stylesheet" href="../assets/stylesheets/extra.css">
53+
5254
<script>__md_scope=new URL("..",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
5355

5456

0 commit comments

Comments
 (0)