From nobody Sun Apr 24 07:56:38 2022 X-Original-To: dev-commits-doc-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A9DAF1A8B156 for ; Sun, 24 Apr 2022 07:56:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KmL7p4NVfz3Qmk; Sun, 24 Apr 2022 07:56:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650786998; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YXMAxXbTYO+1RwwjGvOe57PI0PI0hP4fsPWjBQlIZHE=; b=du8RjEJjqi+WGG3Gp/r9Kf3evr9z0wL4USJq5UD5QrvAmly6l09k0ECpF4nh7k48bvWHk0 l5Mrx56De9palfD3ddverkE1pXNCqxZ86FJjjcTxco2RH8fESBEd8XQYmQq3MkOJ4zTEkv V9EihUmD8J90mwVqjAiugiRkQ/jEes+VSta/CERxQnrBcPBKVGP0HsZgt0kc0TshoiZ3JZ jG0nrzJudBw6kGSM3Rs2QaGmSH8igqkFysF6uJTbfILhaPVz7maOAHVT28+5Eg6Vsi0JJi 65cQROnvn1NvD1BH6pEqY4YzvXQJdur6LArNHWBCjHk3/KU27JH27aJ3lyJEqA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 761EB227B9; Sun, 24 Apr 2022 07:56:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 23O7ucET063841; Sun, 24 Apr 2022 07:56:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 23O7ucl8063840; Sun, 24 Apr 2022 07:56:38 GMT (envelope-from git) Date: Sun, 24 Apr 2022 07:56:38 GMT Message-Id: <202204240756.23O7ucl8063840@gitrepo.freebsd.org> To: doc-committers@FreeBSD.org, dev-commits-doc-all@FreeBSD.org From: Sergio Carlavilla Delgado Subject: git: 07c328f62a - main - Add search to book chapters menu and improve UX List-Id: Commit messages for all branches of the doc repository List-Archive: https://lists.freebsd.org/archives/dev-commits-doc-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-doc-all@freebsd.org X-BeenThere: dev-commits-doc-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: carlavilla X-Git-Repository: doc X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 07c328f62adb94ef7b8e19be96c5f703a371c565 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650786998; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YXMAxXbTYO+1RwwjGvOe57PI0PI0hP4fsPWjBQlIZHE=; b=UiubsmJwHOVqAErb2gCa6YvmBV9Eu/2byW3wVEwZeybUJqAOhCFKd7bb/Pz6V75Gdal0Ck HPFSxwvh2ljT18jZG4jClm2NCSHgBWMcj9lbLf/YyrGdil3q1B00N8E/R/YdtlxJwMKjq5 nZH4cUGUKo7F+dK24WjYLhfrS2KYEJUfCSqaI/e8oudY5rxg0q1jhK1yHqPQguF4pbbk7p 2+h0n89mDCQ8e0dhmGdh7scgjR49Q2nAKOCCvnIrFEiXS3Uwvt5tIODitwQkAel+jvMIAM hVJhbQWCK571rOLUPYoUVF3elNbygWDYXqwuCJjO7Hhk2SKRgTOEw9duJWu3og== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1650786998; a=rsa-sha256; cv=none; b=Q44+updaBC2uic4B/zPt/2jYLvFXOFJi7Rrxjs5QO44iB41TcxBo6jaydhlLNcjTgYUYia XiwxsZlE2/PQ+uG9c9eYN5PVBGJc0bKkKCK4KfkZxDMt5e5rIQpxYdHGBTm3/zsBoCvTIP bXAgX9FGTuAPngf1BZ0WJ6cHeLUOBAClOElgUvJxFrC4y+xKVD7K+GBa6BEOD26xWz//6o 1f0T5ZfMJwOFwxRNYr0DVYx0c89hdwooONH6TCM9Hf54mZRhcYxOP64e8sIZLc4E8IntIL 3ksq5ObcIHDSUOElFxLskTS5Vcy45yJN31JaHP4uGxLhBoxHTN2cSqmJ++Mpkw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by carlavilla: URL: https://cgit.FreeBSD.org/doc/commit/?id=07c328f62adb94ef7b8e19be96c5f703a371c565 commit 07c328f62adb94ef7b8e19be96c5f703a371c565 Author: Sergio Carlavilla Delgado AuthorDate: 2022-04-24 07:54:53 +0000 Commit: Sergio Carlavilla Delgado CommitDate: 2022-04-24 07:56:27 +0000 Add search to book chapters menu and improve UX - Add a search input to search inside the book chapters - Reduce the line height - Change font type to use Inter in admonitions title - Add single page version to Resources menu --- documentation/themes/beastie/assets/js/search.js | 62 ++++++++++++++++++++++ .../beastie/assets/styles/documentation.scss | 13 +++++ .../themes/beastie/assets/styles/global.scss | 13 ++++- documentation/themes/beastie/i18n/bn-bd.toml | 3 ++ documentation/themes/beastie/i18n/da.toml | 3 ++ documentation/themes/beastie/i18n/de.toml | 3 ++ documentation/themes/beastie/i18n/el.toml | 3 ++ documentation/themes/beastie/i18n/en.toml | 3 ++ documentation/themes/beastie/i18n/es.toml | 3 ++ documentation/themes/beastie/i18n/fr.toml | 3 ++ documentation/themes/beastie/i18n/hu.toml | 3 ++ documentation/themes/beastie/i18n/it.toml | 3 ++ documentation/themes/beastie/i18n/ja.toml | 3 ++ documentation/themes/beastie/i18n/ko.toml | 3 ++ documentation/themes/beastie/i18n/mn.toml | 3 ++ documentation/themes/beastie/i18n/nl.toml | 3 ++ documentation/themes/beastie/i18n/pl.toml | 3 ++ documentation/themes/beastie/i18n/pt-br.toml | 3 ++ documentation/themes/beastie/i18n/ru.toml | 3 ++ documentation/themes/beastie/i18n/tr.toml | 3 ++ documentation/themes/beastie/i18n/zh-cn.toml | 3 ++ documentation/themes/beastie/i18n/zh-tw.toml | 3 ++ .../themes/beastie/layouts/books/list.html | 12 ++--- .../themes/beastie/layouts/books/single.html | 12 ++--- .../themes/beastie/layouts/partials/site-head.html | 6 +++ 25 files changed, 160 insertions(+), 15 deletions(-) diff --git a/documentation/themes/beastie/assets/js/search.js b/documentation/themes/beastie/assets/js/search.js new file mode 100644 index 0000000000..cab7098d09 --- /dev/null +++ b/documentation/themes/beastie/assets/js/search.js @@ -0,0 +1,62 @@ +/* +BSD 2-Clause License + +Copyright (c) 2001-2022, The FreeBSD Documentation Project +Copyright (c) 2021-2022, Sergio Carlavilla +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +;(function () { + 'use strict' + + var searchBookInput = document.querySelector("#search-book"); + var menuContents = document.querySelector("#MenuContents"); + searchBookInput.addEventListener('keyup', search); + + function search() { + var menuElements = menuContents.children[0]; + + Array.from(menuElements.children).map(element => { + var menuContent = element.textContent || element.innerText; + var check = element.getElementsByTagName("input"); + + if (menuContent.toUpperCase().includes(searchBookInput.value.toUpperCase())) { + element.classList.remove("hidden"); + if (check && check[0]) { + if (searchBookInput.value) { + check[0].checked = true; + } else { + check[0].checked = false; + } + } + } else { + element.classList.add("hidden"); + if (check && check[0]) { + check[0].checked = false; + } + } + }); + } + +})(); diff --git a/documentation/themes/beastie/assets/styles/documentation.scss b/documentation/themes/beastie/assets/styles/documentation.scss index d0c8d3bcb8..28e15c5544 100644 --- a/documentation/themes/beastie/assets/styles/documentation.scss +++ b/documentation/themes/beastie/assets/styles/documentation.scss @@ -88,6 +88,17 @@ padding-left: .5rem; } + #search-book { + margin: 0 0 .75rem .75rem; + border: 1px solid #CCC; + border-radius: 4px; + box-shadow: inset 0 1px 3px #DDD; + box-sizing: border-box; + background-color: #FCFCFD; + color: #444; + width: 95%; + } + input.toggle ~ .icon::after { display: inline-block; font: 1rem FontAwesome; @@ -114,6 +125,7 @@ position: sticky; overflow: auto; max-height: calc(90vh); + line-height: 2; ul { margin: 0 0 0 .75rem; @@ -241,6 +253,7 @@ li { margin: 0; + margin-bottom: .5rem; list-style: none; a { diff --git a/documentation/themes/beastie/assets/styles/global.scss b/documentation/themes/beastie/assets/styles/global.scss index e2172bbcf9..157cfd669c 100644 --- a/documentation/themes/beastie/assets/styles/global.scss +++ b/documentation/themes/beastie/assets/styles/global.scss @@ -47,7 +47,7 @@ html { html, body { text-rendering: optimizeLegibility; - line-height: calc(1ex / 0.32); + line-height: 1.5; } body { @@ -269,6 +269,15 @@ ul.language-list { font-weight: 700; } +h1, +h2, +h3, +h4, +h5, +h6 { + margin: 0; +} + h1, h2, h3, @@ -561,6 +570,7 @@ table.stretch { &:after { content: attr(title); + font-family: 'Inter var', sans-serif; font-weight: bolder; padding: 0 .5em; margin: -.05em; @@ -657,6 +667,7 @@ table.stretch { .title { font-weight: bolder; + font-family: 'Inter var', sans-serif; } .content { diff --git a/documentation/themes/beastie/i18n/bn-bd.toml b/documentation/themes/beastie/i18n/bn-bd.toml index 5cb974ed89..1e8a387b99 100644 --- a/documentation/themes/beastie/i18n/bn-bd.toml +++ b/documentation/themes/beastie/i18n/bn-bd.toml @@ -49,6 +49,9 @@ other = "Last modified on" [by] other = "by" +[search] +other = "Search" + # --------------------------------------------------- # Header # --------------------------------------------------- diff --git a/documentation/themes/beastie/i18n/da.toml b/documentation/themes/beastie/i18n/da.toml index 5cb974ed89..1e8a387b99 100644 --- a/documentation/themes/beastie/i18n/da.toml +++ b/documentation/themes/beastie/i18n/da.toml @@ -49,6 +49,9 @@ other = "Last modified on" [by] other = "by" +[search] +other = "Search" + # --------------------------------------------------- # Header # --------------------------------------------------- diff --git a/documentation/themes/beastie/i18n/de.toml b/documentation/themes/beastie/i18n/de.toml index d6f2b53c6b..649bca3856 100644 --- a/documentation/themes/beastie/i18n/de.toml +++ b/documentation/themes/beastie/i18n/de.toml @@ -49,6 +49,9 @@ other = "Last modified on" [by] other = "by" +[search] +other = "Search" + # --------------------------------------------------- # Header # --------------------------------------------------- diff --git a/documentation/themes/beastie/i18n/el.toml b/documentation/themes/beastie/i18n/el.toml index b35d5319ac..1fdffc4fa8 100644 --- a/documentation/themes/beastie/i18n/el.toml +++ b/documentation/themes/beastie/i18n/el.toml @@ -49,6 +49,9 @@ other = "Last modified on" [by] other = "by" +[search] +other = "Search" + # --------------------------------------------------- # Header # --------------------------------------------------- diff --git a/documentation/themes/beastie/i18n/en.toml b/documentation/themes/beastie/i18n/en.toml index 5cb974ed89..1e8a387b99 100644 --- a/documentation/themes/beastie/i18n/en.toml +++ b/documentation/themes/beastie/i18n/en.toml @@ -49,6 +49,9 @@ other = "Last modified on" [by] other = "by" +[search] +other = "Search" + # --------------------------------------------------- # Header # --------------------------------------------------- diff --git a/documentation/themes/beastie/i18n/es.toml b/documentation/themes/beastie/i18n/es.toml index 1467813b32..68784326b1 100644 --- a/documentation/themes/beastie/i18n/es.toml +++ b/documentation/themes/beastie/i18n/es.toml @@ -49,6 +49,9 @@ other = "Last modified on" [by] other = "by" +[search] +other = "Search" + # --------------------------------------------------- # Header # --------------------------------------------------- diff --git a/documentation/themes/beastie/i18n/fr.toml b/documentation/themes/beastie/i18n/fr.toml index 4a573c7e21..5678dbd984 100644 --- a/documentation/themes/beastie/i18n/fr.toml +++ b/documentation/themes/beastie/i18n/fr.toml @@ -49,6 +49,9 @@ other = "Last modified on" [by] other = "by" +[search] +other = "Search" + # --------------------------------------------------- # Header # --------------------------------------------------- diff --git a/documentation/themes/beastie/i18n/hu.toml b/documentation/themes/beastie/i18n/hu.toml index 5ad8d6c679..81d267b112 100644 --- a/documentation/themes/beastie/i18n/hu.toml +++ b/documentation/themes/beastie/i18n/hu.toml @@ -49,6 +49,9 @@ other = "Last modified on" [by] other = "by" +[search] +other = "Search" + # --------------------------------------------------- # Header # --------------------------------------------------- diff --git a/documentation/themes/beastie/i18n/it.toml b/documentation/themes/beastie/i18n/it.toml index f30f752e4c..21f45fe7ef 100644 --- a/documentation/themes/beastie/i18n/it.toml +++ b/documentation/themes/beastie/i18n/it.toml @@ -49,6 +49,9 @@ other = "Last modified on" [by] other = "by" +[search] +other = "Search" + # --------------------------------------------------- # Header # --------------------------------------------------- diff --git a/documentation/themes/beastie/i18n/ja.toml b/documentation/themes/beastie/i18n/ja.toml index 1573ecb41b..85dd24fdd9 100644 --- a/documentation/themes/beastie/i18n/ja.toml +++ b/documentation/themes/beastie/i18n/ja.toml @@ -49,6 +49,9 @@ other = "最終更新日" [by] other = "by" +[search] +other = "Search" + # --------------------------------------------------- # Header # --------------------------------------------------- diff --git a/documentation/themes/beastie/i18n/ko.toml b/documentation/themes/beastie/i18n/ko.toml index 5cb974ed89..1e8a387b99 100644 --- a/documentation/themes/beastie/i18n/ko.toml +++ b/documentation/themes/beastie/i18n/ko.toml @@ -49,6 +49,9 @@ other = "Last modified on" [by] other = "by" +[search] +other = "Search" + # --------------------------------------------------- # Header # --------------------------------------------------- diff --git a/documentation/themes/beastie/i18n/mn.toml b/documentation/themes/beastie/i18n/mn.toml index 888f7fc406..f46f1e08d7 100644 --- a/documentation/themes/beastie/i18n/mn.toml +++ b/documentation/themes/beastie/i18n/mn.toml @@ -49,6 +49,9 @@ other = "Last modified on" [by] other = "by" +[search] +other = "Search" + # --------------------------------------------------- # Header # --------------------------------------------------- diff --git a/documentation/themes/beastie/i18n/nl.toml b/documentation/themes/beastie/i18n/nl.toml index 3313d57718..279a9b8237 100644 --- a/documentation/themes/beastie/i18n/nl.toml +++ b/documentation/themes/beastie/i18n/nl.toml @@ -49,6 +49,9 @@ other = "Last modified on" [by] other = "by" +[search] +other = "Search" + # --------------------------------------------------- # Header # --------------------------------------------------- diff --git a/documentation/themes/beastie/i18n/pl.toml b/documentation/themes/beastie/i18n/pl.toml index 5cb974ed89..1e8a387b99 100644 --- a/documentation/themes/beastie/i18n/pl.toml +++ b/documentation/themes/beastie/i18n/pl.toml @@ -49,6 +49,9 @@ other = "Last modified on" [by] other = "by" +[search] +other = "Search" + # --------------------------------------------------- # Header # --------------------------------------------------- diff --git a/documentation/themes/beastie/i18n/pt-br.toml b/documentation/themes/beastie/i18n/pt-br.toml index e111baa28a..ff00ae1f00 100644 --- a/documentation/themes/beastie/i18n/pt-br.toml +++ b/documentation/themes/beastie/i18n/pt-br.toml @@ -49,6 +49,9 @@ other = "Última alteração em" [by] other = "por" +[search] +other = "Search" + # --------------------------------------------------- # Header # --------------------------------------------------- diff --git a/documentation/themes/beastie/i18n/ru.toml b/documentation/themes/beastie/i18n/ru.toml index bc98d2c4ed..a4bd2f44b6 100644 --- a/documentation/themes/beastie/i18n/ru.toml +++ b/documentation/themes/beastie/i18n/ru.toml @@ -49,6 +49,9 @@ other = "Last modified on" [by] other = "by" +[search] +other = "Search" + # --------------------------------------------------- # Header # --------------------------------------------------- diff --git a/documentation/themes/beastie/i18n/tr.toml b/documentation/themes/beastie/i18n/tr.toml index 5cb974ed89..1e8a387b99 100644 --- a/documentation/themes/beastie/i18n/tr.toml +++ b/documentation/themes/beastie/i18n/tr.toml @@ -49,6 +49,9 @@ other = "Last modified on" [by] other = "by" +[search] +other = "Search" + # --------------------------------------------------- # Header # --------------------------------------------------- diff --git a/documentation/themes/beastie/i18n/zh-cn.toml b/documentation/themes/beastie/i18n/zh-cn.toml index ed7eef5539..25cd823f7c 100644 --- a/documentation/themes/beastie/i18n/zh-cn.toml +++ b/documentation/themes/beastie/i18n/zh-cn.toml @@ -49,6 +49,9 @@ other = "Last modified on" [by] other = "by" +[search] +other = "Search" + # --------------------------------------------------- # Header # --------------------------------------------------- diff --git a/documentation/themes/beastie/i18n/zh-tw.toml b/documentation/themes/beastie/i18n/zh-tw.toml index acc3b77e58..d67e1ac68e 100644 --- a/documentation/themes/beastie/i18n/zh-tw.toml +++ b/documentation/themes/beastie/i18n/zh-tw.toml @@ -49,6 +49,9 @@ other = "最後修改於" [by] other = "由" +[search] +other = "Search" + # --------------------------------------------------- # Header # --------------------------------------------------- diff --git a/documentation/themes/beastie/layouts/books/list.html b/documentation/themes/beastie/layouts/books/list.html index 7a50dcf830..a9fcae0cbc 100644 --- a/documentation/themes/beastie/layouts/books/list.html +++ b/documentation/themes/beastie/layouts/books/list.html @@ -6,6 +6,7 @@