Skip to content

Commit 470e341

Browse files
committed
favicon: added background
1 parent 3bdb04a commit 470e341

4 files changed

Lines changed: 246 additions & 29 deletions

File tree

.github/workflows/page.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
jobs:
88
doc:
99
runs-on: ubuntu-latest
10-
container: ghcr.io/carapace-sh/carapace
10+
container: ghcr.io/carapace-sh/mdbook
1111
steps:
1212
- uses: actions/checkout@v3
1313

docs/src/tabdance.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Tabdance <div style="float:right;"><a href="https://github.com/tab-dance"><img height="26em" src="icons/github.svg" /></a> <a href="https://mastodon.social/@tabdance"><img height="26em" src="icons/mastodon.svg" /></a> <a href="https://discord.com/channels/1275861633528238080"><img height="26em" src="icons/discord.svg" /></a> <a href="https://pixelfed.social/tabdance"><img height="26em" src="icons/pixelfed.svg" /></a> <a href="https://polar.sh/tab-dance"><img height="26em" src="icons/polar.svg" /></a></div>
1+
# Tabdance<span style="font-size: xx-small; vertical-align: bottom">™</span> <div style="float:right;"><a href="https://github.com/tab-dance"><img height="26em" src="icons/github.svg" /></a> <a href="https://mastodon.social/@tabdance"><img height="26em" src="icons/mastodon.svg" /></a> <a href="https://discord.com/channels/1275861633528238080"><img height="26em" src="icons/discord.svg" /></a> <a href="https://pixelfed.social/tabdance"><img height="26em" src="icons/pixelfed.svg" /></a> <a href="https://polar.sh/tab-dance"><img height="26em" src="icons/polar.svg" /></a></div>
22

33

44
<center><img src="./tabdance/tabdance.svg" /></center>

docs/theme/favicon.png

-237 Bytes
Loading

docs/theme/index.hbs

Lines changed: 244 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,257 @@
11
<!DOCTYPE HTML>
22
<html lang="{{ language }}" class="{{ default_theme }}" dir="{{ text_direction }}">
33
<head>
4+
<!-- Book generated using mdBook -->
45
<meta charset="UTF-8">
56
<title>Tabdance</title>
7+
{{#if is_print }}
8+
<meta name="robots" content="noindex">
9+
{{/if}}
610
{{#if base_url}}
711
<base href="{{ base_url }}">
812
{{/if}}
913

14+
15+
<!-- Custom HTML head -->
1016
{{> head}}
1117

1218
<meta name="description" content="{{ description }}">
1319
<meta name="viewport" content="width=device-width, initial-scale=1">
1420
<meta name="theme-color" content="#ffffff">
1521

16-
<link rel="shortcut icon" href="{{ path_to_root }}favicon.png">
17-
<link rel="stylesheet" href="{{ path_to_root }}css/variables.css">
18-
<link rel="stylesheet" href="{{ path_to_root }}css/general.css">
19-
<link rel="stylesheet" href="{{ path_to_root }}css/chrome.css">
22+
{{#if favicon_svg}}
23+
<link rel="icon" href="{{ resource "favicon.svg" }}">
24+
{{/if}}
25+
{{#if favicon_png}}
26+
<link rel="shortcut icon" href="{{ resource "favicon.png" }}">
27+
{{/if}}
28+
<link rel="stylesheet" href="{{ resource "css/variables.css" }}">
29+
<link rel="stylesheet" href="{{ resource "css/general.css" }}">
30+
<link rel="stylesheet" href="{{ resource "css/chrome.css" }}">
31+
{{#if print_enable}}
32+
<link rel="stylesheet" href="{{ resource "css/print.css" }}" media="print">
33+
{{/if}}
2034

2135
<!-- Fonts -->
36+
<link rel="stylesheet" href="{{ resource "FontAwesome/css/font-awesome.css" }}">
2237
{{#if copy_fonts}}
23-
<link rel="stylesheet" href="{{ path_to_root }}fonts/fonts.css">
38+
<link rel="stylesheet" href="{{ resource "fonts/fonts.css" }}">
2439
{{/if}}
2540

2641
<!-- Highlight.js Stylesheets -->
27-
<link rel="stylesheet" href="{{ path_to_root }}highlight.css">
28-
<link rel="stylesheet" href="{{ path_to_root }}tomorrow-night.css">
29-
<link rel="stylesheet" href="{{ path_to_root }}ayu-highlight.css">
42+
<link rel="stylesheet" id="highlight-css" href="{{ resource "highlight.css" }}">
43+
<link rel="stylesheet" id="tomorrow-night-css" href="{{ resource "tomorrow-night.css" }}">
44+
<link rel="stylesheet" id="ayu-highlight-css" href="{{ resource "ayu-highlight.css" }}">
3045

3146
<!-- Custom theme stylesheets -->
3247
{{#each additional_css}}
33-
<link rel="stylesheet" href="{{ ../path_to_root }}{{ this }}">
48+
<link rel="stylesheet" href="{{ resource this }}">
3449
{{/each}}
3550

3651
<!-- Mastodon verification -->
3752
<link rel="me" href="https://mastodon.social/@tabdance">
38-
</head>
39-
<body class="no-js">
40-
<div id="body-container">
41-
<!-- Provide site root to javascript -->
53+
54+
{{#if mathjax_support}}
55+
<!-- MathJax -->
56+
<script async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
57+
{{/if}}
58+
59+
<!-- Provide site root and default themes to javascript -->
4260
<script>
43-
var path_to_root = "{{ path_to_root }}";
44-
var default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "{{ preferred_dark_theme }}" : "{{ default_theme }}";
61+
const path_to_root = "{{ path_to_root }}";
62+
const default_light_theme = "{{ default_theme }}";
63+
const default_dark_theme = "{{ preferred_dark_theme }}";
4564
</script>
46-
65+
<!-- Start loading toc.js asap -->
66+
<script src="{{ resource "toc.js" }}"></script>
67+
</head>
68+
<body>
69+
<div id="mdbook-help-container">
70+
<div id="mdbook-help-popup">
71+
<h2 class="mdbook-help-title">Keyboard shortcuts</h2>
72+
<div>
73+
<p>Press <kbd>←</kbd> or <kbd>→</kbd> to navigate between chapters</p>
74+
{{#if search_enabled}}
75+
<p>Press <kbd>S</kbd> or <kbd>/</kbd> to search in the book</p>
76+
{{/if}}
77+
<p>Press <kbd>?</kbd> to show this help</p>
78+
<p>Press <kbd>Esc</kbd> to hide this help</p>
79+
</div>
80+
</div>
81+
</div>
82+
<div id="body-container">
4783
<!-- Work around some values being stored in localStorage wrapped in quotes -->
4884
<script>
4985
try {
50-
var theme = localStorage.getItem('mdbook-theme');
86+
let theme = localStorage.getItem('mdbook-theme');
87+
let sidebar = localStorage.getItem('mdbook-sidebar');
5188
5289
if (theme.startsWith('"') && theme.endsWith('"')) {
5390
localStorage.setItem('mdbook-theme', theme.slice(1, theme.length - 1));
5491
}
92+
93+
{{#if false}}
94+
if (sidebar.startsWith('"') && sidebar.endsWith('"')) {
95+
localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1));
96+
}
97+
{{/if}}
5598
} catch (e) { }
5699
</script>
57100

58101
<!-- Set the theme before any content is loaded, prevents flash -->
59102
<script>
60-
var theme;
103+
const default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? default_dark_theme : default_light_theme;
104+
let theme;
61105
try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
62106
if (theme === null || theme === undefined) { theme = default_theme; }
63-
var html = document.querySelector('html');
107+
const html = document.documentElement;
64108
html.classList.remove('{{ default_theme }}')
65109
html.classList.add(theme);
66-
var body = document.querySelector('body');
67-
body.classList.remove('no-js')
68-
body.classList.add('js');
110+
html.classList.add("js");
111+
</script>
112+
113+
{{#if false}}
114+
<input type="checkbox" id="sidebar-toggle-anchor" class="hidden">
115+
116+
<!-- Hide / unhide sidebar before it is displayed -->
117+
<script>
118+
let sidebar = null;
119+
const sidebar_toggle = document.getElementById("sidebar-toggle-anchor");
120+
if (document.body.clientWidth >= 1080) {
121+
try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
122+
sidebar = sidebar || 'visible';
123+
} else {
124+
sidebar = 'hidden';
125+
}
126+
sidebar_toggle.checked = sidebar === 'visible';
127+
html.classList.remove('sidebar-visible');
128+
html.classList.add("sidebar-" + sidebar);
69129
</script>
70130

131+
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
132+
<!-- populated by js -->
133+
<mdbook-sidebar-scrollbox class="sidebar-scrollbox"></mdbook-sidebar-scrollbox>
134+
<noscript>
135+
<iframe class="sidebar-iframe-outer" src="{{ path_to_root }}toc.html"></iframe>
136+
</noscript>
137+
<div id="sidebar-resize-handle" class="sidebar-resize-handle">
138+
<div class="sidebar-resize-indicator"></div>
139+
</div>
140+
</nav>
141+
{{/if}}
142+
71143
<div id="page-wrapper" class="page-wrapper">
72144

73145
<div class="page">
74146
{{> header}}
75147
<div id="menu-bar-hover-placeholder"></div>
148+
{{#if false}}
149+
<div id="menu-bar" class="menu-bar sticky">
150+
<div class="left-buttons">
151+
<label id="sidebar-toggle" class="icon-button" for="sidebar-toggle-anchor" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar">
152+
<i class="fa fa-bars"></i>
153+
</label>
154+
<button id="theme-toggle" class="icon-button" type="button" title="Change theme" aria-label="Change theme" aria-haspopup="true" aria-expanded="false" aria-controls="theme-list">
155+
<i class="fa fa-paint-brush"></i>
156+
</button>
157+
<ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu">
158+
<li role="none"><button role="menuitem" class="theme" id="default_theme">Auto</button></li>
159+
<li role="none"><button role="menuitem" class="theme" id="light">Light</button></li>
160+
<li role="none"><button role="menuitem" class="theme" id="rust">Rust</button></li>
161+
<li role="none"><button role="menuitem" class="theme" id="coal">Coal</button></li>
162+
<li role="none"><button role="menuitem" class="theme" id="navy">Navy</button></li>
163+
<li role="none"><button role="menuitem" class="theme" id="ayu">Ayu</button></li>
164+
</ul>
165+
{{#if search_enabled}}
166+
<button id="search-toggle" class="icon-button" type="button" title="Search (`/`)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="/ s" aria-controls="searchbar">
167+
<i class="fa fa-search"></i>
168+
</button>
169+
{{/if}}
170+
</div>
171+
172+
<h1 class="menu-title">{{ book_title }}</h1>
173+
174+
<div class="right-buttons">
175+
{{#if print_enable}}
176+
<a href="{{ path_to_root }}print.html" title="Print this book" aria-label="Print this book">
177+
<i id="print-button" class="fa fa-print"></i>
178+
</a>
179+
{{/if}}
180+
{{#if git_repository_url}}
181+
<a href="{{git_repository_url}}" title="Git repository" aria-label="Git repository">
182+
<i id="git-repository-button" class="fa {{git_repository_icon}}"></i>
183+
</a>
184+
{{/if}}
185+
{{#if git_repository_edit_url}}
186+
<a href="{{git_repository_edit_url}}" title="Suggest an edit" aria-label="Suggest an edit">
187+
<i id="git-edit-button" class="fa fa-edit"></i>
188+
</a>
189+
{{/if}}
190+
191+
</div>
192+
</div>
193+
{{/if}}
194+
195+
{{#if search_enabled}}
196+
<div id="search-wrapper" class="hidden">
197+
<form id="searchbar-outer" class="searchbar-outer">
198+
<input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
199+
</form>
200+
<div id="searchresults-outer" class="searchresults-outer hidden">
201+
<div id="searchresults-header" class="searchresults-header"></div>
202+
<ul id="searchresults">
203+
</ul>
204+
</div>
205+
</div>
206+
{{/if}}
207+
208+
<!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
209+
<script>
210+
document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
211+
document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible');
212+
Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) {
213+
link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1);
214+
});
215+
</script>
76216

77217
<div id="content" class="content">
78218
<main>
79219
{{{ content }}}
80220
</main>
221+
222+
<nav class="nav-wrapper" aria-label="Page navigation">
223+
<!-- Mobile navigation buttons -->
224+
{{#previous}}
225+
<a rel="prev" href="{{ path_to_root }}{{link}}" class="mobile-nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
226+
<i class="fa fa-angle-left"></i>
227+
</a>
228+
{{/previous}}
229+
230+
{{#next}}
231+
<a rel="next prefetch" href="{{ path_to_root }}{{link}}" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
232+
<i class="fa fa-angle-right"></i>
233+
</a>
234+
{{/next}}
235+
236+
<div style="clear: both"></div>
237+
</nav>
81238
</div>
82239
</div>
240+
241+
<nav class="nav-wide-wrapper" aria-label="Page navigation">
242+
{{#previous}}
243+
<a rel="prev" href="{{ path_to_root }}{{link}}" class="nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
244+
<i class="fa fa-angle-left"></i>
245+
</a>
246+
{{/previous}}
247+
248+
{{#next}}
249+
<a rel="next prefetch" href="{{ path_to_root }}{{link}}" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
250+
<i class="fa fa-angle-right"></i>
251+
</a>
252+
{{/next}}
253+
</nav>
254+
83255
</div>
84256

85257
{{#if live_reload_endpoint}}
@@ -104,7 +276,7 @@
104276
{{#if google_analytics}}
105277
<!-- Google Analytics Tag -->
106278
<script>
107-
var localAddrs = ["localhost", "127.0.0.1", ""];
279+
const localAddrs = ["localhost", "127.0.0.1", ""];
108280
109281
// make sure we don't activate google analytics if the developer is
110282
// inspecting the book locally...
@@ -120,14 +292,59 @@
120292
</script>
121293
{{/if}}
122294

123-
<script src="{{ path_to_root }}clipboard.min.js"></script>
124-
<script src="{{ path_to_root }}highlight.js"></script>
125-
<script src="{{ path_to_root }}book.js"></script>
295+
{{#if playground_line_numbers}}
296+
<script>
297+
window.playground_line_numbers = true;
298+
</script>
299+
{{/if}}
300+
301+
{{#if playground_copyable}}
302+
<script>
303+
window.playground_copyable = true;
304+
</script>
305+
{{/if}}
306+
307+
{{#if playground_js}}
308+
<script src="{{ resource "ace.js" }}"></script>
309+
<script src="{{ resource "mode-rust.js" }}"></script>
310+
<script src="{{ resource "editor.js" }}"></script>
311+
<script src="{{ resource "theme-dawn.js" }}"></script>
312+
<script src="{{ resource "theme-tomorrow_night.js" }}"></script>
313+
{{/if}}
314+
315+
{{#if search_js}}
316+
<script src="{{ resource "elasticlunr.min.js" }}"></script>
317+
<script src="{{ resource "mark.min.js" }}"></script>
318+
<script src="{{ resource "searcher.js" }}"></script>
319+
{{/if}}
320+
321+
<script src="{{ resource "clipboard.min.js" }}"></script>
322+
<script src="{{ resource "highlight.js" }}"></script>
323+
<script src="{{ resource "book.js" }}"></script>
126324

127325
<!-- Custom JS scripts -->
128326
{{#each additional_js}}
129-
<script src="{{ ../path_to_root }}{{this}}"></script>
327+
<script src="{{ resource this}}"></script>
130328
{{/each}}
329+
330+
{{#if is_print}}
331+
{{#if mathjax_support}}
332+
<script>
333+
window.addEventListener('load', function() {
334+
MathJax.Hub.Register.StartupHook('End', function() {
335+
window.setTimeout(window.print, 100);
336+
});
337+
});
338+
</script>
339+
{{else}}
340+
<script>
341+
window.addEventListener('load', function() {
342+
window.setTimeout(window.print, 100);
343+
});
344+
</script>
345+
{{/if}}
346+
{{/if}}
347+
131348
</div>
132349
</body>
133350
</html>

0 commit comments

Comments
 (0)