Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0055f5e

Browse files
committed
Add pristine html partials, copied from mkdocs-material.
1 parent a49a5f5 commit 0055f5e

File tree

8 files changed

+262
-0
lines changed

8 files changed

+262
-0
lines changed

‎build_tools/github_actions/configure_ci.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
# worth the dependency.
3939
SKIP_PATH_PATTERNS = [
4040
"docs/*",
41+
"third_party/mkdocs-material/*",
4142
"experimental/*",
4243
"build_tools/buildkite/*",
4344
# These configure the runners themselves and don't affect presubmit.

‎docs/website/mkdocs.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ theme:
77
repo: fontawesome/brands/github
88
logo: iree/ghost
99
favicon: ghost.svg
10+
11+
# Note: this includes symlinks to forked files in third_party/mkdocs-material/
1012
custom_dir: overrides
1113

1214
features:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../third_party/mkdocs-material/overrides/partials/header.html
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../third_party/mkdocs-material/overrides/partials/nav.html
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2016-2023 Martin Donath <[email protected]>
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to
5+
deal in the Software without restriction, including without limitation the
6+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7+
sell copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in
11+
all copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19+
IN THE SOFTWARE.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Material for MkDocs
2+
3+
This directory includes files forked from https://github.com/squidfunk/mkdocs-material.
4+
5+
See:
6+
7+
* https://squidfunk.github.io/mkdocs-material/customization/#extending-the-theme
8+
* https://github.com/squidfunk/mkdocs-material/tree/master/src/partials
9+
10+
We symlink to these "third party" files from the `overrides` folder.
Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
<!--
2+
Copyright (c) 2016-2023 Martin Donath <[email protected]>
3+
4+
Permission is hereby granted, free of charge, to any person obtaining a copy
5+
of this software and associated documentation files (the "Software"), to
6+
deal in the Software without restriction, including without limitation the
7+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8+
sell copies of the Software, and to permit persons to whom the Software is
9+
furnished to do so, subject to the following conditions:
10+
11+
The above copyright notice and this permission notice shall be included in
12+
all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
17+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20+
IN THE SOFTWARE.
21+
-->
22+
23+
<!-- Determine base classes -->
24+
{% set class = "md-header" %}
25+
{% if "navigation.tabs.sticky" in features %}
26+
{% set class = class ~ " md-header--lifted" %}
27+
{% endif %}
28+
29+
<!-- Header -->
30+
<header class="{{ class }}" data-md-component="header">
31+
<nav
32+
class="md-header__inner md-grid"
33+
aria-label="{{ lang.t('header') }}"
34+
>
35+
36+
<!-- Link to home -->
37+
<a
38+
href="{{ config.extra.homepage | d(nav.homepage.url, true) | url }}"
39+
title="{{ config.site_name | e }}"
40+
class="md-header__button md-logo"
41+
aria-label="{{ config.site_name }}"
42+
data-md-component="logo"
43+
>
44+
{% include "partials/logo.html" %}
45+
</a>
46+
47+
<!-- Button to open drawer -->
48+
<label class="md-header__button md-icon" for="__drawer">
49+
{% include ".icons/material/menu" ~ ".svg" %}
50+
</label>
51+
52+
<!-- Header title -->
53+
<div class="md-header__title" data-md-component="header-title">
54+
<div class="md-header__ellipsis">
55+
<div class="md-header__topic">
56+
<span class="md-ellipsis">
57+
{{ config.site_name }}
58+
</span>
59+
</div>
60+
<div class="md-header__topic" data-md-component="header-topic">
61+
<span class="md-ellipsis">
62+
{% if page.meta and page.meta.title %}
63+
{{ page.meta.title }}
64+
{% else %}
65+
{{ page.title }}
66+
{% endif %}
67+
</span>
68+
</div>
69+
</div>
70+
</div>
71+
72+
<!-- Color palette -->
73+
{% if not config.theme.palette is mapping %}
74+
<form class="md-header__option" data-md-component="palette">
75+
{% for option in config.theme.palette %}
76+
{% set scheme = option.scheme | d("default", true) %}
77+
<input
78+
class="md-option"
79+
data-md-color-media="{{ option.media }}"
80+
data-md-color-scheme="{{ scheme | replace(' ', '-') }}"
81+
data-md-color-primary="{{ option.primary | replace(' ', '-') }}"
82+
data-md-color-accent="{{ option.accent | replace(' ', '-') }}"
83+
{% if option.toggle %}
84+
aria-label="{{ option.toggle.name }}"
85+
{% else %}
86+
aria-hidden="true"
87+
{% endif %}
88+
type="radio"
89+
name="__palette"
90+
id="__palette_{{ loop.index }}"
91+
/>
92+
{% if option.toggle %}
93+
<label
94+
class="md-header__button md-icon"
95+
title="{{ option.toggle.name }}"
96+
for="__palette_{{ loop.index0 or loop.length }}"
97+
hidden
98+
>
99+
{% include ".icons/" ~ option.toggle.icon ~ ".svg" %}
100+
</label>
101+
{% endif %}
102+
{% endfor %}
103+
</form>
104+
{% endif %}
105+
106+
<!-- Site language selector -->
107+
{% if config.extra.alternate %}
108+
<div class="md-header__option">
109+
<div class="md-select">
110+
{% set icon = config.theme.icon.alternate or "material/translate" %}
111+
<button
112+
class="md-header__button md-icon"
113+
aria-label="{{ lang.t('select.language') }}"
114+
>
115+
{% include ".icons/" ~ icon ~ ".svg" %}
116+
</button>
117+
<div class="md-select__inner">
118+
<ul class="md-select__list">
119+
{% for alt in config.extra.alternate %}
120+
<li class="md-select__item">
121+
<a
122+
href="{{ alt.link | url }}"
123+
hreflang="{{ alt.lang }}"
124+
class="md-select__link"
125+
>
126+
{{ alt.name }}
127+
</a>
128+
</li>
129+
{% endfor %}
130+
</ul>
131+
</div>
132+
</div>
133+
</div>
134+
{% endif %}
135+
136+
<!-- Button to open search modal -->
137+
{% if "material/search" in config.plugins %}
138+
<label class="md-header__button md-icon" for="__search">
139+
{% include ".icons/material/magnify.svg" %}
140+
</label>
141+
142+
<!-- Search interface -->
143+
{% include "partials/search.html" %}
144+
{% endif %}
145+
146+
<!-- Repository information -->
147+
{% if config.repo_url %}
148+
<div class="md-header__source">
149+
{% include "partials/source.html" %}
150+
</div>
151+
{% endif %}
152+
</nav>
153+
154+
<!-- Navigation tabs (sticky) -->
155+
{% if "navigation.tabs.sticky" in features %}
156+
{% if "navigation.tabs" in features %}
157+
{% include "partials/tabs.html" %}
158+
{% endif %}
159+
{% endif %}
160+
</header>
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<!--
2+
Copyright (c) 2016-2023 Martin Donath <[email protected]>
3+
4+
Permission is hereby granted, free of charge, to any person obtaining a copy
5+
of this software and associated documentation files (the "Software"), to
6+
deal in the Software without restriction, including without limitation the
7+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8+
sell copies of the Software, and to permit persons to whom the Software is
9+
furnished to do so, subject to the following conditions:
10+
11+
The above copyright notice and this permission notice shall be included in
12+
all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
17+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20+
IN THE SOFTWARE.
21+
-->
22+
23+
<!-- Determine class according to configuration -->
24+
{% set class = "md-nav md-nav--primary" %}
25+
{% if "navigation.tabs" in features %}
26+
{% set class = class ~ " md-nav--lifted" %}
27+
{% endif %}
28+
{% if "toc.integrate" in features %}
29+
{% set class = class ~ " md-nav--integrated" %}
30+
{% endif %}
31+
32+
<!-- Main navigation -->
33+
<nav
34+
class="{{ class }}"
35+
aria-label="{{ lang.t('nav') }}"
36+
data-md-level="0"
37+
>
38+
39+
<!-- Site title -->
40+
<label class="md-nav__title" for="__drawer">
41+
<a
42+
href="{{ config.extra.homepage | d(nav.homepage.url, true) | url }}"
43+
title="{{ config.site_name | e }}"
44+
class="md-nav__button md-logo"
45+
aria-label="{{ config.site_name }}"
46+
data-md-component="logo"
47+
>
48+
{% include "partials/logo.html" %}
49+
</a>
50+
{{ config.site_name }}
51+
</label>
52+
53+
<!-- Repository information -->
54+
{% if config.repo_url %}
55+
<div class="md-nav__source">
56+
{% include "partials/source.html" %}
57+
</div>
58+
{% endif %}
59+
60+
<!-- Render item list -->
61+
<ul class="md-nav__list" data-md-scrollfix>
62+
{% for nav_item in nav %}
63+
{% set path = "__nav_" ~ loop.index %}
64+
{% set level = 1 %}
65+
{% include "partials/nav-item.html" %}
66+
{% endfor %}
67+
</ul>
68+
</nav>

0 commit comments

Comments
 (0)