From c85b6f185d8721b74e62b3960a5087de2e85ae10 Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Thu, 31 Oct 2024 00:33:16 -0400 Subject: [PATCH] Add language picker --- book.toml | 6 +- theme/index.hbs | 402 ++++++++++++++++++++++++++++++++++++++ theme/language-picker.css | 13 ++ 3 files changed, 420 insertions(+), 1 deletion(-) create mode 100644 theme/index.hbs create mode 100644 theme/language-picker.css diff --git a/book.toml b/book.toml index 49c8aab4..c7e5692e 100644 --- a/book.toml +++ b/book.toml @@ -7,7 +7,11 @@ title = "The Book of sbt" [output.html] theme = "theme" -additional-css = ["src/reference/custom-202410.css", "src/reference/mdbook-admonish.css"] +additional-css = [ + "src/reference/custom-202410.css", + "src/reference/mdbook-admonish.css", + "theme/language-picker.css" +] cname = "www.scala-sbt.org" [preprocessor.variables] diff --git a/theme/index.hbs b/theme/index.hbs new file mode 100644 index 00000000..74af37b9 --- /dev/null +++ b/theme/index.hbs @@ -0,0 +1,402 @@ + + + + + + {{ title }} + {{#if is_print }} + + {{/if}} + {{#if base_url}} + + {{/if}} + + + + {{> head}} + + + + + + {{#if favicon_svg}} + + {{/if}} + {{#if favicon_png}} + + {{/if}} + + + + {{#if print_enable}} + + {{/if}} + + + + {{#if copy_fonts}} + + {{/if}} + + + + + + + + {{#each additional_css}} + + {{/each}} + + {{#if mathjax_support}} + + + {{/if}} + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ {{> header}} + + + + {{#if search_enabled}} + + {{/if}} + + + + +
+
+ {{{ content }}} +
+ + +
+
+ + + +
+ + {{#if live_reload_endpoint}} + + + {{/if}} + + {{#if google_analytics}} + + + {{/if}} + + {{#if playground_line_numbers}} + + {{/if}} + + {{#if playground_copyable}} + + {{/if}} + + {{#if playground_js}} + + + + + + {{/if}} + + {{#if search_js}} + + + + {{/if}} + + + + + + + {{#each additional_js}} + + {{/each}} + + {{#if is_print}} + {{#if mathjax_support}} + + {{else}} + + {{/if}} + {{/if}} + +
+ + \ No newline at end of file diff --git a/theme/language-picker.css b/theme/language-picker.css new file mode 100644 index 00000000..1553ed68 --- /dev/null +++ b/theme/language-picker.css @@ -0,0 +1,13 @@ +#language-list { + left: auto; + right: 10px; +} + +[dir="rtl"] #language-list { + left: 10px; + right: auto; +} + +#language-list a { + color: inherit; +}