slipway-theme 0.1.0

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.
Files changed (96) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +21 -0
  3. data/_includes/analytics.html +12 -0
  4. data/_includes/author-card.html +29 -0
  5. data/_includes/author-ids.html +2 -0
  6. data/_includes/author-url.html +11 -0
  7. data/_includes/breadcrumbs.html +67 -0
  8. data/_includes/byline.html +14 -0
  9. data/_includes/compat.html +11 -0
  10. data/_includes/component-css.html +5 -0
  11. data/_includes/copy-page.html +5 -0
  12. data/_includes/date.html +90 -0
  13. data/_includes/dir.html +4 -0
  14. data/_includes/edit-sources.html +25 -0
  15. data/_includes/feedback.html +12 -0
  16. data/_includes/footer-custom.html +5 -0
  17. data/_includes/footer.html +16 -0
  18. data/_includes/head-custom.html +5 -0
  19. data/_includes/head.html +52 -0
  20. data/_includes/header.html +38 -0
  21. data/_includes/i18n/ar.html +43 -0
  22. data/_includes/i18n/de.html +43 -0
  23. data/_includes/i18n/en.html +43 -0
  24. data/_includes/i18n/es.html +43 -0
  25. data/_includes/i18n/fa.html +43 -0
  26. data/_includes/i18n/fr.html +43 -0
  27. data/_includes/i18n/he.html +42 -0
  28. data/_includes/i18n/it.html +43 -0
  29. data/_includes/i18n/ja.html +43 -0
  30. data/_includes/i18n/nl.html +43 -0
  31. data/_includes/i18n/pt.html +43 -0
  32. data/_includes/i18n/ru.html +43 -0
  33. data/_includes/i18n/tr.html +43 -0
  34. data/_includes/i18n/zh.html +43 -0
  35. data/_includes/i18n-builtin.html +8 -0
  36. data/_includes/icons/github.svg +1 -0
  37. data/_includes/icons/linkedin.svg +1 -0
  38. data/_includes/icons/mastodon.svg +1 -0
  39. data/_includes/icons/twitter.svg +1 -0
  40. data/_includes/icons/x.svg +1 -0
  41. data/_includes/icons/youtube.svg +1 -0
  42. data/_includes/jsonld.html +41 -0
  43. data/_includes/lang-switcher.html +15 -0
  44. data/_includes/layout-url.html +8 -0
  45. data/_includes/llms-item.html +19 -0
  46. data/_includes/num.html +3 -0
  47. data/_includes/post-item.html +4 -0
  48. data/_includes/related-posts.html +37 -0
  49. data/_includes/search.html +13 -0
  50. data/_includes/seo.html +42 -0
  51. data/_includes/series.html +47 -0
  52. data/_includes/skip-link.html +1 -0
  53. data/_includes/t.html +4 -0
  54. data/_includes/taxonomy.html +22 -0
  55. data/_includes/term.html +7 -0
  56. data/_includes/theme-init.html +1 -0
  57. data/_includes/theme-var.html +4 -0
  58. data/_includes/theme-vars.html +17 -0
  59. data/_layouts/archive.html +32 -0
  60. data/_layouts/author.html +31 -0
  61. data/_layouts/base.html +19 -0
  62. data/_layouts/default.html +4 -0
  63. data/_layouts/doc.html +89 -0
  64. data/_layouts/feed.html +37 -0
  65. data/_layouts/glossary.html +23 -0
  66. data/_layouts/home.html +96 -0
  67. data/_layouts/llms-full.html +54 -0
  68. data/_layouts/llms.html +32 -0
  69. data/_layouts/not-found.html +27 -0
  70. data/_layouts/page.html +13 -0
  71. data/_layouts/post.html +72 -0
  72. data/_layouts/search-index.html +12 -0
  73. data/_layouts/sitemap.html +24 -0
  74. data/_layouts/sourcemap.html +28 -0
  75. data/_layouts/tags.html +24 -0
  76. data/_layouts/translation-status.html +44 -0
  77. data/assets/css/components/glossary.css +21 -0
  78. data/assets/css/fonts.css +47 -0
  79. data/assets/css/nav.css +104 -0
  80. data/assets/css/print.css +70 -0
  81. data/assets/css/slipway.css +952 -0
  82. data/assets/css/tokens.css +57 -0
  83. data/assets/fonts/LICENSES/InstrumentSerif-OFL.txt +93 -0
  84. data/assets/fonts/LICENSES/SourceSerif4-OFL.txt +93 -0
  85. data/assets/fonts/LICENSES/Vazirmatn-OFL.txt +93 -0
  86. data/assets/fonts/instrument-serif-latin-400-italic.woff2 +0 -0
  87. data/assets/fonts/instrument-serif-latin-400-normal.woff2 +0 -0
  88. data/assets/fonts/source-serif-4-latin-wght-italic.woff2 +0 -0
  89. data/assets/fonts/source-serif-4-latin-wght-normal.woff2 +0 -0
  90. data/assets/fonts/vazirmatn-arabic-wght-normal.woff2 +0 -0
  91. data/assets/images/social.png +0 -0
  92. data/assets/js/copy-code.js +53 -0
  93. data/assets/js/edit-prompt.js +23 -0
  94. data/assets/js/search.js +114 -0
  95. data/assets/js/theme-toggle.js +66 -0
  96. metadata +156 -0
@@ -0,0 +1,57 @@
1
+ /* Generated from tokens/theme.tokens.json by tools/theme/tokens-build.mjs. Do not edit. */
2
+ @layer reset, tokens, base, components, utilities;
3
+
4
+ @layer tokens {
5
+ :root {
6
+ color-scheme: light dark;
7
+ --sl-color-canvas: light-dark(#e9e1d6, #262425);
8
+ --sl-color-surface: light-dark(#efe8de, #2d2a2b);
9
+ --sl-color-text: light-dark(#3b3330, #b9b2b0);
10
+ --sl-color-heading: light-dark(#3b3330, #cac4c2);
11
+ --sl-color-muted: light-dark(#65574f, #9a9392);
12
+ --sl-color-line: light-dark(#c9b8ad, #443f40);
13
+ --sl-color-rose: light-dark(#7a4f4f, #b58d90);
14
+ --sl-color-rose-fill: light-dark(#7a4f4f, #7a5558);
15
+ --sl-color-on-rose-fill: light-dark(#f6efe8, #efe8e8);
16
+ --sl-color-rose-hover: color-mix(in oklch, var(--sl-color-rose), var(--sl-color-text) 18%);
17
+ --sl-font-display: "Instrument Serif", Georgia, "Times New Roman", serif;
18
+ --sl-font-body: "Source Serif 4", Georgia, serif;
19
+ --sl-font-ui: system-ui, -apple-system, "Segoe UI", sans-serif;
20
+ --sl-font-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
21
+ --sl-font-persian: Vazirmatn, "Source Serif 4", Tahoma, sans-serif;
22
+ --sl-font-arabic: Vazirmatn, "Source Serif 4", "Geeza Pro", "Segoe UI", Tahoma, sans-serif;
23
+ --sl-font-hebrew: "Noto Sans Hebrew", "Arial Hebrew", "Segoe UI", Arial, sans-serif;
24
+ --sl-step-sm: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
25
+ --sl-step-base: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
26
+ --sl-step-lg: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
27
+ --sl-step-xl: clamp(1.625rem, 1.4rem + 1.1vw, 2.25rem);
28
+ --sl-step-2xl: clamp(2.125rem, 1.7rem + 2vw, 3.25rem);
29
+ --sl-step-3xl: clamp(2.75rem, 2rem + 3.5vw, 4.75rem);
30
+ --sl-space-1: 0.25rem;
31
+ --sl-space-2: 0.5rem;
32
+ --sl-space-3: 0.75rem;
33
+ --sl-space-4: 1rem;
34
+ --sl-space-6: 1.5rem;
35
+ --sl-space-8: 2rem;
36
+ --sl-space-12: 3rem;
37
+ --sl-space-16: 4rem;
38
+ --sl-radius-compact: 0.375rem;
39
+ --sl-radius-card: 0.75rem;
40
+ --sl-measure: 42rem;
41
+ --sl-measure-narrow: 34rem;
42
+ --sl-measure-wide: 64rem;
43
+ --sl-rule: 1px;
44
+ --sl-button-bg: light-dark(#7a4f4f, #7a5558);
45
+ --sl-button-fg: light-dark(#f6efe8, #efe8e8);
46
+ --sl-button-radius: 0.375rem;
47
+ --sl-motion-fast: 150ms;
48
+ }
49
+
50
+ :root[data-theme="light"] {
51
+ color-scheme: light;
52
+ }
53
+
54
+ :root[data-theme="dark"] {
55
+ color-scheme: dark;
56
+ }
57
+ }
@@ -0,0 +1,93 @@
1
+ Copyright 2022 The Instrument Serif Project Authors (https://github.com/Instrument/instrument-serif) InstrumentSerif-Italic.ttf: Copyright 2022 The Instrument Serif Project Authors (https://github.com/Instrument/instrument-serif)
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ http://scripts.sil.org/OFL
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,93 @@
1
+ Google Inc.
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ http://scripts.sil.org/OFL
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,93 @@
1
+ Copyright 2015 The Vazirmatn Project Authors (https://github.com/rastikerdar/vazirmatn)
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ http://scripts.sil.org/OFL
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.
Binary file
@@ -0,0 +1,53 @@
1
+ (function () {
2
+ var LABELS = {
3
+ en: { copy: "Copy", done: "Copied", fail: "Press Ctrl+C" },
4
+ fa: { copy: "کپی", done: "کپی شد", fail: "Ctrl+C را بزنید" }
5
+ };
6
+
7
+ var DATA = { copy: "copy", done: "copied", fail: "copyFailed" };
8
+
9
+ function label(lang, state, data) {
10
+ if (data && data[DATA[state]]) return data[DATA[state]];
11
+ var set = LABELS[String(lang || "en").slice(0, 2).toLowerCase()] || LABELS.en;
12
+ return set[state];
13
+ }
14
+
15
+ function bind(btn, lang, data, orig, act) {
16
+ btn.onclick = function() {
17
+ var clip = navigator.clipboard;
18
+ var p = clip && clip.writeText ? act(clip) : Promise.reject();
19
+ p.then(
20
+ function() { btn.textContent = label(lang, "done", data); },
21
+ function() { btn.textContent = label(lang, "fail", data); }
22
+ );
23
+ setTimeout(function() { btn.textContent = orig; }, 2e3);
24
+ };
25
+ }
26
+
27
+ function attach(pre, lang, data) {
28
+ var doc = document, wrap = doc.createElement("div"), btn = doc.createElement("button");
29
+ wrap.className = "sl-code";
30
+ btn.type = "button";
31
+ btn.className = "sl-copy";
32
+ var orig = btn.textContent = label(lang, "copy", data);
33
+ bind(btn, lang, data, orig, function(c) { return c.writeText(pre.textContent); });
34
+ pre.parentNode.insertBefore(wrap, pre);
35
+ wrap.appendChild(pre);
36
+ wrap.appendChild(btn);
37
+ }
38
+
39
+ function init() {
40
+ var doc = document, lang = doc.documentElement.lang, data = doc.body && doc.body.dataset;
41
+ var pre = doc.querySelectorAll("main pre"), btn = doc.querySelector(".sl-copy-page");
42
+ for (var i = 0; i < pre.length; i++) attach(pre[i], lang, data);
43
+ if (btn) {
44
+ btn.removeAttribute("hidden");
45
+ bind(btn, lang, data, btn.textContent, function(c) {
46
+ return fetch(btn.dataset.copyPage).then(function(r) { return r.text(); }).then(function(t) { return c.writeText(t); });
47
+ });
48
+ }
49
+ }
50
+
51
+ globalThis.slipwayCopy = { label: label };
52
+ if (typeof document !== "undefined" && document.querySelectorAll) init();
53
+ })();
@@ -0,0 +1,23 @@
1
+ /* "Edit with your agent": a button on each heading with data-source copies a prompt with the file,
2
+ line, and section text (to the next heading of its level). */
3
+ (function () {
4
+ function build(tpl, src, text) {
5
+ text = text.replace(/\s+/g, " ").trim();
6
+ return tpl.replace("{source}", src).replace("{text}", function () { return text; }) + " ";
7
+ }
8
+
9
+ globalThis.slipwayEdit = { build: build };
10
+ if (!globalThis.document || !navigator.clipboard) return;
11
+ var o = document.body.dataset;
12
+ document.querySelectorAll("[data-edit-prompt] [data-source]").forEach(function (h) {
13
+ var d = h.closest("[data-edit-prompt]").dataset, b = document.createElement("button"), t = h.textContent, e = h;
14
+ while ((e = e.nextElementSibling) && e.tagName != "NAV" && !(/^H\d/.test(e.tagName) && e.tagName <= h.tagName)) t += " " + e.textContent;
15
+ b.className = "sl-edit";
16
+ b.textContent = d.editLabel;
17
+ b.onclick = function () {
18
+ navigator.clipboard.writeText(build(d.editPrompt, h.dataset.source, t)).then(function () { b.textContent = o.copied; }, function () { b.textContent = o.copyFailed; });
19
+ setTimeout(function () { b.textContent = d.editLabel; }, 2000);
20
+ };
21
+ h.appendChild(b);
22
+ });
23
+ })();
@@ -0,0 +1,114 @@
1
+ /* Client-side search over the language's search.json. The field is hidden until this script runs, so a page
2
+ needs no JavaScript to be read. Persian-aware: ي/ك become ی/ک, ZWNJ and diacritics are dropped, digits are
3
+ Latin. */
4
+ (function () {
5
+ function normalize(text) {
6
+ return String(text || "")
7
+ .replace(/[يىئ]/g, "ی")
8
+ .replace(/[كڪ]/g, "ک")
9
+ .replace(/[\u200c\u200d\u0640\u0610-\u061a\u064b-\u065f\u0670\u06d6-\u06ed]/g, "")
10
+ .replace(/[۰-۹]/g, function (d) { return d.charCodeAt(0) - 0x6f0; })
11
+ .replace(/[٠-٩]/g, function (d) { return d.charCodeAt(0) - 0x660; })
12
+ .toLowerCase();
13
+ }
14
+
15
+ function words(text) {
16
+ return normalize(text).split(/[^\p{L}\p{N}]+/u).filter(Boolean);
17
+ }
18
+
19
+ function field(item, name) {
20
+ var key = "_" + name;
21
+ if (item[key] === undefined) item[key] = " " + words(item[name]).join(" ");
22
+ return item[key];
23
+ }
24
+
25
+ /* Every query word must appear somewhere; title beats description beats text, and word starts beat the middle. */
26
+ function search(index, query, limit) {
27
+ var terms = words(query);
28
+ if (!terms.length) return [];
29
+ var found = [];
30
+ for (var i = 0; i < index.length; i++) {
31
+ var item = index[i];
32
+ var score = 0;
33
+ for (var t = 0; t < terms.length; t++) {
34
+ var s = 0;
35
+ var parts = [["title", 6], ["description", 3], ["text", 1]];
36
+ for (var p = 0; p < parts.length; p++) {
37
+ var haystack = field(item, parts[p][0]);
38
+ if (haystack.indexOf(" " + terms[t]) >= 0) s += parts[p][1] * 2;
39
+ else if (haystack.indexOf(terms[t]) >= 0) s += parts[p][1];
40
+ }
41
+ if (!s) { score = 0; break; }
42
+ score += s;
43
+ }
44
+ if (score) found.push({ item: item, score: score });
45
+ }
46
+ found.sort(function (a, b) { return b.score - a.score; });
47
+ return found.slice(0, limit || 8).map(function (r) { return r.item; });
48
+ }
49
+
50
+ function init() {
51
+ var form = document.querySelector("[data-search]");
52
+ if (!form || typeof fetch !== "function") return;
53
+ var input = form.querySelector("input");
54
+ var panel = form.querySelector(".sl-search-panel");
55
+ var status = form.querySelector(".sl-search-status");
56
+ var list = form.querySelector(".sl-search-results");
57
+ var index = null;
58
+ var loading = null;
59
+ var persian = document.body.classList.contains("sl-fa-digits");
60
+
61
+ function load() {
62
+ if (!loading) {
63
+ loading = fetch(form.getAttribute("data-search"))
64
+ .then(function (r) { return r.json(); })
65
+ .then(function (data) { index = data; form.hidden = false; return data; });
66
+ }
67
+ return loading;
68
+ }
69
+
70
+ function digits(n) {
71
+ return persian ? String(n).replace(/\d/g, function (d) { return "۰۱۲۳۴۵۶۷۸۹".charAt(d); }) : String(n);
72
+ }
73
+
74
+ function show(results) {
75
+ list.textContent = "";
76
+ panel.hidden = !input.value.trim();
77
+ if (panel.hidden) return;
78
+ status.textContent = results.length ? form.getAttribute("data-count").replace("{n}", digits(results.length)) : form.getAttribute("data-none");
79
+ results.forEach(function (item) {
80
+ var li = document.createElement("li");
81
+ var a = document.createElement("a");
82
+ var note = document.createElement("span");
83
+ a.href = item.url;
84
+ a.textContent = item.title;
85
+ note.textContent = item.description || item.text.slice(0, 100);
86
+ li.appendChild(a);
87
+ li.appendChild(note);
88
+ list.appendChild(li);
89
+ });
90
+ }
91
+
92
+ function links() { return Array.prototype.slice.call(list.querySelectorAll("a")); }
93
+
94
+ input.addEventListener("input", function () { show(index ? search(index, input.value) : []); });
95
+ input.addEventListener("focus", function () { load().then(function () { show(search(index, input.value)); }, function () {}); });
96
+ form.addEventListener("submit", function (event) {
97
+ event.preventDefault();
98
+ var first = links()[0];
99
+ if (first) location.href = first.href;
100
+ });
101
+ form.addEventListener("keydown", function (event) {
102
+ var items = links();
103
+ var at = items.indexOf(document.activeElement);
104
+ if (event.key === "Escape") { panel.hidden = true; input.focus(); }
105
+ else if (event.key === "ArrowDown" && items.length) { event.preventDefault(); items[Math.min(at + 1, items.length - 1)].focus(); }
106
+ else if (event.key === "ArrowUp" && at >= 0) { event.preventDefault(); (items[at - 1] || input).focus(); }
107
+ });
108
+ document.addEventListener("click", function (event) { if (!form.contains(event.target)) panel.hidden = true; });
109
+ load().then(function () {}, function () {});
110
+ }
111
+
112
+ globalThis.slipwaySearch = { normalize: normalize, search: search };
113
+ if (typeof document !== "undefined" && document.querySelector) init();
114
+ })();
@@ -0,0 +1,66 @@
1
+ /* Theme toggle: auto (system) -> light -> dark. The choice is kept in localStorage and applied as
2
+ data-theme on <html> (see _includes/theme-init.html, which applies it before first paint). */
3
+ (function () {
4
+ var KEY = "slipway-theme";
5
+ var MODES = ["auto", "light", "dark"];
6
+
7
+ function resolveMode(stored) {
8
+ return stored === "light" || stored === "dark" ? stored : "auto";
9
+ }
10
+
11
+ function nextMode(mode) {
12
+ return MODES[(MODES.indexOf(mode) + 1) % MODES.length];
13
+ }
14
+
15
+ function read() {
16
+ try {
17
+ return resolveMode(localStorage.getItem(KEY));
18
+ } catch (e) {
19
+ return "auto";
20
+ }
21
+ }
22
+
23
+ function write(mode) {
24
+ try {
25
+ if (mode === "auto") localStorage.removeItem(KEY);
26
+ else localStorage.setItem(KEY, mode);
27
+ } catch (e) {}
28
+ }
29
+
30
+ function apply(mode) {
31
+ var root = document.documentElement;
32
+ if (mode === "auto") delete root.dataset.theme;
33
+ else root.dataset.theme = mode;
34
+ }
35
+
36
+ function change(mode) {
37
+ var reduced = typeof matchMedia === "function" && matchMedia("(prefers-reduced-motion: reduce)").matches;
38
+ if (typeof document.startViewTransition === "function" && !reduced) document.startViewTransition(function () { apply(mode); });
39
+ else apply(mode);
40
+ }
41
+
42
+ function init() {
43
+ var mode = read();
44
+ var buttons = document.querySelectorAll("[data-theme-toggle]");
45
+ function label() {
46
+ var fallback = mode.charAt(0).toUpperCase() + mode.slice(1);
47
+ for (var i = 0; i < buttons.length; i++) {
48
+ var data = buttons[i].dataset;
49
+ buttons[i].textContent = (data && data["label" + fallback]) || fallback;
50
+ }
51
+ }
52
+ for (var i = 0; i < buttons.length; i++) {
53
+ buttons[i].hidden = false;
54
+ buttons[i].addEventListener("click", function () {
55
+ mode = nextMode(mode);
56
+ write(mode);
57
+ change(mode);
58
+ label();
59
+ });
60
+ }
61
+ label();
62
+ }
63
+
64
+ globalThis.slipwayTheme = { resolveMode: resolveMode, nextMode: nextMode };
65
+ if (typeof document !== "undefined") init();
66
+ })();