From 6f8f13b48dfefd93a26e7e0840aba84e1dc3f141 Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Fri, 25 Feb 2022 21:35:29 -0500 Subject: [PATCH 1/4] Manual.md: make heading levels match Table of Contents --- Manual.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Manual.md b/Manual.md index 8ec755499bbe..a3d3adb99cea 100644 --- a/Manual.md +++ b/Manual.md @@ -815,10 +815,10 @@ not a particular package is present in `makedepends` or `hostmakedepends`, that package shouldn't be added as a build time dependency. -#### Repositories +### Repositories -##### Repositories defined by Branch +#### Repositories defined by Branch The global repository takes the name of the current branch, except if the name of the branch is master. Then the resulting @@ -826,7 +826,7 @@ repository will be at the global scope. The usage scenario is that the user can update multiple packages in a second branch without polluting his local repository. -##### Package defined Repositories +#### Package defined Repositories The second way to define a repository is by setting the `repository` variable in a template. This way the maintainer can define repositories for a specific @@ -1916,7 +1916,7 @@ If it is running under another architecture it tries to use the host's `install- utility. -### initramfs-regenerate +#### initramfs-regenerate The initramfs-regenerate trigger will trigger the regeneration of all kernel initramfs images after package installation or removal. The trigger must be From f2083ed9177ec94195691fc96f9b5989f776ff98 Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Fri, 25 Feb 2022 21:36:12 -0500 Subject: [PATCH 2/4] manual/: Add script to generate mdbook of Manual.md --- .gitignore | 1 + manual/book.toml | 13 + manual/generate_mdbook.py | 107 ++++++++ manual/src/SUMMARY.md | 1 + manual/src/theme/book.js | 104 ++++++++ manual/src/theme/css/general.css | 419 +++++++++++++++++++++++++++++++ manual/src/theme/css/print.css | 54 ++++ manual/src/theme/favicon.png | Bin 0 -> 5800 bytes manual/src/theme/index.hbs | 157 ++++++++++++ 9 files changed, 856 insertions(+) create mode 100644 manual/book.toml create mode 100644 manual/generate_mdbook.py create mode 100644 manual/src/SUMMARY.md create mode 100644 manual/src/theme/book.js create mode 100644 manual/src/theme/css/general.css create mode 100644 manual/src/theme/css/print.css create mode 100644 manual/src/theme/favicon.png create mode 100644 manual/src/theme/index.hbs diff --git a/.gitignore b/.gitignore index 958f644eee94..52806ca91964 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ etc/conf.* etc/virtual etc/xbps.d/custom .xbps-checkvers*.plist +/manual/book/ diff --git a/manual/book.toml b/manual/book.toml new file mode 100644 index 000000000000..5ef5064d8928 --- /dev/null +++ b/manual/book.toml @@ -0,0 +1,13 @@ +[book] +authors = ["The Void Linux Team"] +multilingual = false +src = "src" +title = "XBPS Source Packages Manual" + +[preprocessor.gen_manual] +command = "python3 generate_mdbook.py" + +[output.html] +# TODO: this should be a submodule or something +# to avoid de-syncing with void-docs/src/theme +theme = "src/theme" diff --git a/manual/generate_mdbook.py b/manual/generate_mdbook.py new file mode 100644 index 000000000000..d8a5f5421625 --- /dev/null +++ b/manual/generate_mdbook.py @@ -0,0 +1,107 @@ +#!/usr/bin/env python3 + +from dataclasses import asdict, dataclass, field +import json +from pathlib import Path +import re +import sys +from typing import Optional + + +HEADING_RE = re.compile(r"###? (?:\w|\d)") +ANCHOR_RE = re.compile(r'') +REL_LINK_RE = re.compile(r"\[(.*)\]\(\./(.*)\)") + + +@dataclass +class Chapter: + name: str + content: str + path: str + source_path: str + number: Optional[list[int]] = None + sub_items: list['Chapter'] = field(default_factory=list) + parent_names: list[str] = field(default_factory=list) + + +@dataclass +class Section: + Chapter: Chapter + + +@dataclass +class Book: + sections: list[Section] + + +def slugify(s: str) -> str: + return s.lower().replace(" ", "-").replace(".", "-").replace("`", "") + + +if __name__ == "__main__": + if len(sys.argv) > 1: + if sys.argv[1] == "supports": + raise SystemExit + + manual = Path("Manual.md").read_text().split("\n") + + sections = [] + curr_chapter = [] + hlevel = None + heading = None + fn = None + in_section = False + + for line in manual: + line = REL_LINK_RE.sub(r"[\1](https://github.com/void-linux/void-packages/blob/master/\2)", line) + + if HEADING_RE.match(line): + if in_section: + if ANCHOR_RE.search(curr_chapter[-1]): + del curr_chapter[-1] + + sections.append( + Section( + Chapter( + name=heading, + number=num, + content="\n".join(curr_chapter), + path=fn, + source_path=fn, + ) + ) + ) + curr_chapter = ["#" + line.lstrip("#")] + hlevel, heading = line.split(" ", maxsplit=1) + fn = f"./{slugify(heading)}.md" + + match len(hlevel): + # intro/help + case 2: + num = None + # other "top" level headings + case 3: + num = [ len(sections) ] + case _: + continue + + in_section = True + elif in_section: + curr_chapter.append(line.replace("####", "##", 1)) + + # get the last section + sections.append( + Section( + Chapter( + name=heading, + number=num, + content="\n".join(curr_chapter), + path=fn, + source_path=fn, + ) + ) + ) + + # mdBook requires this key in the emitted json, for reasons unknown + book = asdict(Book(sections)) | {"__non_exhaustive": None} + print(json.dumps(book)) diff --git a/manual/src/SUMMARY.md b/manual/src/SUMMARY.md new file mode 100644 index 000000000000..73fa82d6e79c --- /dev/null +++ b/manual/src/SUMMARY.md @@ -0,0 +1 @@ + diff --git a/manual/src/theme/book.js b/manual/src/theme/book.js new file mode 100644 index 000000000000..853247bfc4c9 --- /dev/null +++ b/manual/src/theme/book.js @@ -0,0 +1,104 @@ +"use strict"; + +// Fix back button cache problem +window.onunload = function () { }; + +(function sidebar() { + var html = document.querySelector("html"); + var sidebar = document.getElementById("sidebar"); + var sidebarLinks = document.querySelectorAll('#sidebar a'); + var sidebarToggleButton = document.getElementById("sidebar-toggle"); + var firstContact = null; + + function showSidebar() { + html.classList.remove('sidebar-hidden') + html.classList.add('sidebar-visible'); + Array.from(sidebarLinks).forEach(function (link) { + link.setAttribute('tabIndex', 0); + }); + sidebarToggleButton.setAttribute('aria-expanded', true); + sidebar.setAttribute('aria-hidden', false); + try { localStorage.setItem('mdbook-sidebar', 'visible'); } catch (e) { } + } + + function hideSidebar() { + html.classList.remove('sidebar-visible') + html.classList.add('sidebar-hidden'); + Array.from(sidebarLinks).forEach(function (link) { + link.setAttribute('tabIndex', -1); + }); + sidebarToggleButton.setAttribute('aria-expanded', false); + sidebar.setAttribute('aria-hidden', true); + try { localStorage.setItem('mdbook-sidebar', 'hidden'); } catch (e) { } + } + + // Toggle sidebar + sidebarToggleButton.addEventListener('click', function sidebarToggle() { + if (html.classList.contains("sidebar-hidden")) { + showSidebar(); + } else if (html.classList.contains("sidebar-visible")) { + hideSidebar(); + } else { + if (getComputedStyle(sidebar)['transform'] === 'none') { + hideSidebar(); + } else { + showSidebar(); + } + } + }); + + document.addEventListener('touchstart', function (e) { + firstContact = { + x: e.touches[0].clientX, + time: Date.now() + }; + }, { passive: true }); + + document.addEventListener('touchmove', function (e) { + if (!firstContact) + return; + + var curX = e.touches[0].clientX; + var xDiff = curX - firstContact.x, + tDiff = Date.now() - firstContact.time; + + if (tDiff < 250 && Math.abs(xDiff) >= 150) { + if (xDiff >= 0 && firstContact.x < Math.min(document.body.clientWidth * 0.25, 300)) + showSidebar(); + else if (xDiff < 0 && curX < 300) + hideSidebar(); + + firstContact = null; + } + }, { passive: true }); + + // Scroll sidebar to current active section + var activeSection = sidebar.querySelector(".active"); + if (activeSection) { + sidebar.scrollTop = activeSection.offsetTop; + } +})(); + +(function chapterNavigation() { + document.addEventListener('keydown', function (e) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { return; } + if (window.search && window.search.hasFocus()) { return; } + + switch (e.key) { + case 'ArrowRight': + e.preventDefault(); + var nextButton = document.querySelector('.nav-chapters.next'); + if (nextButton) { + window.location.href = nextButton.href; + } + break; + case 'ArrowLeft': + e.preventDefault(); + var previousButton = document.querySelector('.nav-chapters.previous'); + if (previousButton) { + window.location.href = previousButton.href; + } + break; + } + }); +})(); diff --git a/manual/src/theme/css/general.css b/manual/src/theme/css/general.css new file mode 100644 index 000000000000..e0255a8281b1 --- /dev/null +++ b/manual/src/theme/css/general.css @@ -0,0 +1,419 @@ +body { + font-family: 'Ubuntu', sans-serif; + font-size: 1rem; + line-height: 1.5; + color: #333; + margin: 0; + background-color: #ffffff; +} +h1, h2, h3, h4, h5, h6 { color: #333; } +a { + color: #478061; + text-decoration: none; +} +a:hover { + color: #333; + text-decoration: underline; +} + +code { + background: #fdf6e3; + padding: 2px 4px; + border-radius: 4px; + white-space: pre-wrap; + overflow-wrap: break-word; +} +pre code { + padding: 0; + border-radius: 0; +} +pre { + padding: .5em; + margin: 1em 0; + background: #fdf6e3; + border: 1px solid #ccc; + border-radius: 4px; +} + +blockquote { + margin: 20px 0; + padding: 0 20px; + padding-left: 1em; + background: #ebf4ef; + border: 1px solid #d1e6da; + border-left: none; + border-right: none; +} + +li.js-unavailable { + background-color: #f6cf68; + border-radius: 10px; + margin-left: 1em; + padding-left: 1em; + padding-right: 1em; +} + +table { + border-collapse: collapse; + display: block; + overflow-y: auto; +} +table td { + padding: 3px 20px; + border: 1px #fafafa solid; +} +table thead { + background: #fafafa; +} +table thead td { + font-weight: 700; + border: none; +} +table thead tr { +} +/* Alternate background colors for rows */ +table tbody tr:nth-child(2n) { + background: #fafafa; +} + +svg { + position: relative; + top: .125em; + width: 1em; + height: auto; +} + +.hidden { + display: none; +} + +.icon-button { + border: none; + background: none; + cursor: pointer; + padding: 1em; +} + +/* void navigation */ + +#void-nav { + width: 100%; + min-height: 50px; + background: #478061; + font-size: 14px; + + display: flex; + flex-direction: row; + flex-wrap: wrap; +} +#void-nav button, +#void-nav label { + fill: #fff; + height: 50px; + display: block; + line-height: 50px; + padding: 0 15px; + font-size: 1.2em; +} +#void-nav ul { + list-style: none; + margin: 0; + padding: 0; +} + +#void-nav ul#nav-right { + margin-left: auto; +} + +#void-nav ul li { + display: inline-block; +} +#void-nav ul li a { + color: #fff; + display: block; + padding: 0 15px; + line-height: 50px; + font-size: 1.2em; + text-decoration: none +} +#void-nav ul li a:hover, +#void-nav ul li a:focus, +#void-nav button:hover, +#void-nav button:focus, +#void-nav label:hover, +#void-nav label:focus { + background: #000; +} + +#skip-to-content { + position: absolute; + left: -999px; + top: -999px; +} + +#skip-to-content:active, +#skip-to-content:focus { + position: relative; + left: 0; + top: 0; +} + +/* sidebar */ + +.sidebar-hidden #sidebar { + display: none; +} +#sidebar { + padding: .5em; + background: #fafafa; + font-size: 0.875em; +} +#sidebar ol { + list-style: none; + margin: 0; +} +#sidebar ol.chapter { + padding: 0; + line-height: 2.2em; +} +#sidebar ol.section { + padding-left: 20px; + line-height: 1.9em; +} +#sidebar a { + color: #000; + display: block; +} +#sidebar a:hover { + color: #478061; + text-decoration: none; +} +#sidebar a.active { + color: #478061; +} + +#sidebar-toggle { + display: none; +} + +/* search */ + +#searchbar { + width: 100%; + padding: 10px 16px; + margin: 5px 0; + border-radius: 3px; + border: 1px solid #aaa; +} +#searchresults-header { + font-weight: bold; + font-size: 1em; + padding: 18px 0 0 5px; +} +ul#searchresults { + list-style: none; + padding-left: 20px; +} +ul#searchresults li { + margin: 10px 0px; + padding: 2px; + border-radius: 2px; +} +ul#searchresults span.teaser { + display: block; + clear: both; + margin: 5px 0 0 20px; + font-size: 0.8em; +} + +/* chapter navigation */ + +#nav-wide-wrapper { + max-width: 800px; + margin: 0 auto; + margin-top: 50px; +} +.previous { + float: left; +} +.next { + float: right; + right: 15px; +} +.nav-chapters { + fill: #ccc; + text-align: center; + text-decoration: none; + display: block; + max-width: 150px; + min-width: 90px; +} +.nav-chapters:hover { + text-decoration: none; + fill: #333 +} + +.nav-chapters svg { + margin: 0 auto; + width: 1.5em; +} + +/* layout */ + +body { + box-sizing: border-box; +} +#content { + display: flex; + flex-direction: row; + width: 100%; +} +#page-wrapper { + --content-padding: 10px; + padding: 0 var(--content-padding); + width: calc(100% - var(--content-padding) * 2); +} +#search-wrapper, +#page-wrapper main { + width: 100%; + max-width: 800px; + margin: 0 auto; +} +#sidebar { + max-width: 300px; + flex-shrink: 0; +} + +/* 300px + 800px + 2*90px + 15px */ +@media only screen and (min-width: 1295px) { + .sidebar-visible #nav-wide-wrapper { + max-width: none; + margin: 0; + } + .sidebar-visible .nav-chapters { + background: none; + position: fixed; + top: 50px; + bottom: 0; + margin: 0; + justify-content: center; + align-content: center; + display: flex; + flex-direction: column; + } +} +/* 800px + 2*90px + 15px */ +@media only screen and (min-width: 995px) { + .sidebar-hidden #nav-wide-wrapper { + max-width: none; + margin: 0; + } + .sidebar-hidden .nav-chapters { + background: none; + position: fixed; + top: 50px; + bottom: 0; + margin: 0; + justify-content: center; + align-content: center; + display: flex; + flex-direction: column; + } + table { + display: table; + } +} + +@media (prefers-color-scheme: dark) { + body { + color: #ccc; + background-color: #222; + } + h1, h2, h3, h4, h5, h6 { color: #ccc; } + a { + color: #62b086; + } + a:hover { + color: #ccc; + } + + code { + background: inherit; + } + pre { + background: #353535; + border: 1px solid #111; + } + + blockquote { + background: inherit; + border-left: .2em solid #ccc; + border-right: none; + border-top: none; + border-bottom: none; + padding-top: .5em; + padding-bottom: .5em; + padding-left: 1em; + padding-right: 1em; + margin-left: 1em; + } + blockquote code { + color: #62b086; + } + li.js-unavailable { + background-color: #f6cf68; + color: #000000; + border-radius: 10px; + margin-left: 1em; + padding-left: 1em; + padding-right: 1em; + } + table td { + border: 1px #2c2c2c solid; + } + table thead { + background: #2c2c2c; + } + table tbody tr:nth-child(2n) { + background: #2c2c2c; + } + + /* nav */ + #void-nav ul li a:hover, + #void-nav ul li a:focus, + #void-nav button:hover, + #void-nav button:focus, + #void-nav label:hover, + #void-nav label:focus { + background: #222; + } + + #void-nav { + background: #295340; + } + + /* sidebar */ + #sidebar { + background: #252525; + } + #sidebar a { + color: #ccc; + } + #sidebar a:hover { + color: #62b086; + } + #sidebar a.active { + color: #62b086; + } + + /* search */ + #searchbar { + background-color: #222; + color: #ccc; + } + + /* chapter navigation */ + .nav-chapters:hover { + fill: #fff + } +} diff --git a/manual/src/theme/css/print.css b/manual/src/theme/css/print.css new file mode 100644 index 000000000000..717ccb80ed2c --- /dev/null +++ b/manual/src/theme/css/print.css @@ -0,0 +1,54 @@ + +#sidebar, +#menu-bar, +.nav-chapters, +.mobile-nav-chapters { + display: none; +} + +#page-wrapper.page-wrapper { + transform: none; + margin-left: 0px; + overflow-y: initial; +} + +#content { + max-width: none; + margin: 0; + padding: 0; +} + +.page { + overflow-y: initial; +} + +code { + background-color: #666666; + border-radius: 5px; + + /* Force background to be printed in Chrome */ + -webkit-print-color-adjust: exact; +} + +pre > .buttons { + z-index: 2; +} + +a, a:visited, a:active, a:hover { + color: #4183c4; + text-decoration: none; +} + +h1, h2, h3, h4, h5, h6 { + page-break-inside: avoid; + page-break-after: avoid; +} + +pre, code { + page-break-inside: avoid; + white-space: pre-wrap; +} + +svg { + display: none !important; +} diff --git a/manual/src/theme/favicon.png b/manual/src/theme/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..fd3ec045d08445cdd73c7413e01a89754827593f GIT binary patch literal 5800 zcmV;Z7FX$sP)E`C_b8aA?wO9+1dw$!Xc_U0yr4h z7uZKt`yuofWC-9iU6NFEiy-wVn-DeuA0fO$ihm|0x!!r-*%*t(QX&0Fp&(%=U=vqe zGxDjChmm5m7&!rDG;lm=qxj8E;1%E{;3b23w*S`tYbQ;bRBu5mC)nf6^HA+WhewD^ zRMj(puK`0sOs8JawSv?rx?=Ny&3~SG;>^Yn^YN8lZ=R~Es>nxqA59>|nFtesFNU2{ zC)6qW1j--rcr;cN+ZuL4J)zf{C;n9YcuC2Hz!YG3*!g6^4n>y=a^JAju*ZvvijrX` z)LnX&dG3Ga{vrJu`dzH(G~k%9^YM|5qB371a#!isOWzJVnM~;w=2^6A(f)aPdEY^} z4A?L1d@SMtOV!g~#>U5<4m+8y$Z7M$YvLmf<|m4t2jqvHPmri+6~Z;KF|jpa=h6{5 zX`TnyJa}Lv6}b+f957+$6EZ7}XRahKB)s+{i=v?4{uye^_wyEgc&HXq3Iv3W9LO0Lin#Bircy|D2hn-7r zK}FX&;!H0cQ~FGpd4y&jRh2|dqC!M|1MCx49=(_p!Yu>044f6#E09pk$)sFfj za84NddlHJi2%HxyjJ+DPb|_CWuDG6x-a-0hVjn#~kmCedTUk>%J$UU9NmM6_5gq~h zg_*~mf*|*K5pQPfYq1@{=!HzYHa<~Q9;VMgzM$x{DU~A(ja$@y1Ixf0WMbD*g4&)aHs_5$Y>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;Fa#S%fLx%;|7v6 z%+t&Sx8gttovrEW#J+c9pRo<(_XYjAA(zT+bILr;q$}^_I-n%%TtX%Va*u;|O)eJt z=cIX>ndnxG0iB}+*J?6Hs8{rU;O3R?g4e@NrXzCNJk3mS%a1phAA?Szch(AJN}a+2 z2j`|`?jPO>JDINN73OJX()AY~l1h5hNw;4*FzkGM<}wmD}BW-{mmVBfHF z>V$uQt`LzWgOA#}D&5n*_tNXl(~|M78!0gBPsNiGU>xb!AYm4xeFCgOWVtb^<;#At z@U0MY@tr-&Ji8NhqxoCR;L)ny$*LS9$g#jE?A+!)23}NjEh5i}n&(!ycfUnI=Q)PK z9&MfukO^+Z0hrXGj%N<_kb?vrCNNClbEHSA0U%A=Xf#QBC+aq!Uf>f&HVfVc57_`_ my~EB8%iIStI!$X&;{O3r3)blbBiM}q0000 + + + + + {{ title }} + + + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + +
+ {{#if search_enabled}} + + {{/if}} + +
+ {{{ content }}} +
+ + +
+
+ + {{#if livereload}} + + + {{/if}} + + {{#if search_js}} + + + + {{/if}} + + + + From b99ad3b9a590592371ce7dbc8b2ffa53a6ad5ca3 Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Fri, 1 Apr 2022 15:24:18 -0400 Subject: [PATCH 3/4] manual/: add linkcheck, CI for checking Manual.md changes --- .github/workflows/manual.yml | 25 +++++++++++++++++++++++++ manual/book.toml | 6 +++++- manual/ci/format.sh | 22 ++++++++++++++++++++++ 3 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/manual.yml create mode 100755 manual/ci/format.sh diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml new file mode 100644 index 000000000000..3e4ce6a2cf61 --- /dev/null +++ b/.github/workflows/manual.yml @@ -0,0 +1,25 @@ +name: Check Manual Changes + +on: + pull_request: + paths: + - 'Manual.md' + - 'manual/**' + +jobs: + only: + name: Check formatting and links + runs-on: ubuntu-latest + container: + image: ghcr.io/void-linux/void-linux:latest-mini-x86_64-musl + steps: + - name: Prepare container + run: | + xbps-install -Syu || xbps-install -yu xbps + xbps-install -yu + xbps-install -y mdBook mdbook-linkcheck vmdfmt git + - uses: actions/checkout@v1 + with: + fetch-depth: 200 + - run: ./manual/ci/format.sh + diff --git a/manual/book.toml b/manual/book.toml index 5ef5064d8928..4272409788e3 100644 --- a/manual/book.toml +++ b/manual/book.toml @@ -5,9 +5,13 @@ src = "src" title = "XBPS Source Packages Manual" [preprocessor.gen_manual] -command = "python3 generate_mdbook.py" +command = "python3 manual/generate_mdbook.py" [output.html] # TODO: this should be a submodule or something # to avoid de-syncing with void-docs/src/theme theme = "src/theme" + +[output.linkcheck] +optional = true +follow-web-links = true diff --git a/manual/ci/format.sh b/manual/ci/format.sh new file mode 100755 index 000000000000..e47ec8fba57d --- /dev/null +++ b/manual/ci/format.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +echo "Checking links" +RUST_LOG=linkcheck=debug mdbook build manual +LINKCHECK=$? + +# Format them +printf "Formatting tree" +vmdfmt -l -w Manual.md + +# Check Status +if [ ! -z "$(git status --porcelain)" ] ; then + git diff + echo "Working directory not clean, files to be formatted:" + git status + VMDFMT=1 +fi + +# Generate exit value +if [ ! -z $VMDFMT ] || [ ! $LINKCHECK -eq 0 ] ; then + exit 2 +fi From 572b3884ddbf2ac998fb4d53f87690e59aedb37f Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Sat, 2 Apr 2022 01:05:46 -0400 Subject: [PATCH 4/4] manual/src/theme: update theme --- manual/book.toml | 4 + manual/src/theme/book.js | 15 + manual/src/theme/css/chrome.css | 484 +++++++++++++++++++++++++++++ manual/src/theme/css/general.css | 177 +++-------- manual/src/theme/css/variables.css | 107 +++++++ manual/src/theme/index.hbs | 246 ++++++++++----- 6 files changed, 829 insertions(+), 204 deletions(-) create mode 100644 manual/src/theme/css/chrome.css create mode 100644 manual/src/theme/css/variables.css diff --git a/manual/book.toml b/manual/book.toml index 4272409788e3..4ae4312c2d2e 100644 --- a/manual/book.toml +++ b/manual/book.toml @@ -11,6 +11,10 @@ command = "python3 manual/generate_mdbook.py" # TODO: this should be a submodule or something # to avoid de-syncing with void-docs/src/theme theme = "src/theme" +default-theme = "void-light" +preferred-dark-theme = "void-dark" +edit-url-template = "https://github.com/void-linux/void-packages/edit/master/Manual.md" +limit-results = 100 [output.linkcheck] optional = true diff --git a/manual/src/theme/book.js b/manual/src/theme/book.js index 853247bfc4c9..d1a280f9eca3 100644 --- a/manual/src/theme/book.js +++ b/manual/src/theme/book.js @@ -3,6 +3,21 @@ // Fix back button cache problem window.onunload = function () { }; +(function theme() { + var html = document.querySelector("html"); + var themeToggleButton = document.getElementById("theme-toggle"); + + themeToggleButton.addEventListener('click', function sidebarToggle() { + if (html.classList.contains("void-light")) { + html.classList.replace("void-light", "void-dark"); + localStorage.setItem('mdbook-theme', "void-dark"); + } else { + html.classList.replace("void-dark", "void-light"); + localStorage.setItem('mdbook-theme', "void-light"); + } + }); +})(); + (function sidebar() { var html = document.querySelector("html"); var sidebar = document.getElementById("sidebar"); diff --git a/manual/src/theme/css/chrome.css b/manual/src/theme/css/chrome.css new file mode 100644 index 000000000000..544e7718ed9d --- /dev/null +++ b/manual/src/theme/css/chrome.css @@ -0,0 +1,484 @@ +/* CSS for UI elements (a.k.a. chrome) */ + +@import 'variables.css'; + +::-webkit-scrollbar { + background: var(--bg); +} +::-webkit-scrollbar-thumb { + background: var(--scrollbar); +} +html { + scrollbar-color: var(--scrollbar) var(--bg); +} +#searchresults a, +.content a:link, +a:visited, +a > .hljs { + color: var(--links); +} + +/* Menu Bar */ + +#menu-bar, +#menu-bar-hover-placeholder { + z-index: 101; + margin: auto calc(0px - var(--page-padding)); +} +#menu-bar { + position: relative; + display: flex; + flex-wrap: wrap; + background-color: var(--bg); + border-bottom-color: var(--bg); + border-bottom-width: 1px; + border-bottom-style: solid; +} +#menu-bar.sticky, +.js #menu-bar-hover-placeholder:hover + #menu-bar, +.js #menu-bar:hover, +.js.sidebar-visible #menu-bar { + position: -webkit-sticky; + position: sticky; + top: 0 !important; +} +#menu-bar-hover-placeholder { + position: sticky; + position: -webkit-sticky; + top: 0; + height: var(--menu-bar-height); +} +#menu-bar.bordered { + border-bottom-color: var(--table-border-color); +} +#menu-bar i, #menu-bar .icon-button { + position: relative; + padding: 0 8px; + z-index: 10; + line-height: var(--menu-bar-height); + cursor: pointer; + transition: color 0.5s; +} +@media only screen and (max-width: 420px) { + #menu-bar i, #menu-bar .icon-button { + padding: 0 5px; + } +} + +.icon-button { + border: none; + background: none; + padding: 0; + color: inherit; +} +.icon-button i { + margin: 0; +} + +.right-buttons { + margin: 0 15px; +} +.right-buttons a { + text-decoration: none; +} + +.left-buttons { + display: flex; + margin: 0 5px; +} +.no-js .left-buttons { + display: none; +} + +.menu-title { + display: inline-block; + font-weight: 200; + font-size: 2.4rem; + line-height: var(--menu-bar-height); + text-align: center; + margin: 0; + flex: 1; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.js .menu-title { + cursor: pointer; +} + +.menu-bar, +.menu-bar:visited, +.nav-chapters, +.nav-chapters:visited, +.mobile-nav-chapters, +.mobile-nav-chapters:visited, +.menu-bar .icon-button, +.menu-bar a i { + color: var(--icons); +} + +.menu-bar i:hover, +.menu-bar .icon-button:hover, +.nav-chapters:hover, +.mobile-nav-chapters i:hover { + color: var(--icons-hover); +} + +/* Nav Icons */ + +.nav-chapters { + font-size: 2.5em; + text-align: center; + text-decoration: none; + + position: fixed; + top: 0; + bottom: 0; + margin: 0; + max-width: 150px; + min-width: 90px; + + display: flex; + justify-content: center; + align-content: center; + flex-direction: column; + + transition: color 0.5s, background-color 0.5s; +} + +.nav-chapters:hover { + text-decoration: none; + transition: color 0.15s, color 0.15s; +} + +.nav-wrapper { + margin-top: 50px; + display: none; +} + +.mobile-nav-chapters { + font-size: 2.5em; + text-align: center; + text-decoration: none; + width: 90px; + border-radius: 5px; + background-color: var(--sidebar-bg); +} + +.previous { + float: left; +} + +.next { + float: right; + right: var(--page-padding); +} + +@media only screen and (max-width: 1080px) { + .nav-wide-wrapper { display: none; } + .nav-wrapper { display: block; } +} + +@media only screen and (max-width: 1380px) { + .sidebar-visible .nav-wide-wrapper { display: none; } + .sidebar-visible .nav-wrapper { display: block; } +} + +/* Inline code */ + +:not(pre) > .hljs { + display: inline; + padding: 0.1em 0.3em; + border-radius: 3px; +} + +:not(pre):not(a) > .hljs { + color: var(--inline-code-color); + overflow-x: initial; +} + +a:hover > .hljs { + text-decoration: underline; +} + +pre { + position: relative; +} +pre > .buttons { + position: absolute; + z-index: 100; + right: 5px; + top: 5px; + + color: var(--sidebar-fg); + cursor: pointer; +} +pre > .buttons :hover { + color: var(--sidebar-active); +} +pre > .buttons i { + margin-left: 8px; +} +pre > .buttons button { + color: inherit; + background: transparent; + border: none; + cursor: inherit; +} +pre > .result { + margin-top: 10px; +} + +/* Search */ + +#searchresults a { + text-decoration: none; +} + +mark { + border-radius: 2px; + padding: 0 3px 1px 3px; + margin: 0 -3px -1px -3px; + background-color: var(--search-mark-bg); + transition: background-color 300ms linear; + cursor: pointer; +} + +mark.fade-out { + background-color: rgba(0,0,0,0) !important; + cursor: auto; +} + +.searchbar-outer { + margin-left: auto; + margin-right: auto; + max-width: var(--content-max-width); +} + +#searchbar { + width: 100%; + margin: 5px auto 0px auto; + padding: 10px 16px; + transition: box-shadow 300ms ease-in-out; + border: 1px solid var(--searchbar-border-color); + border-radius: 3px; + background-color: var(--searchbar-bg); + color: var(--searchbar-fg); +} +#searchbar:focus, +#searchbar.active { + box-shadow: 0 0 3px var(--searchbar-shadow-color); +} + +.searchresults-header { + font-weight: bold; + font-size: 1em; + padding: 18px 0 0 5px; + color: var(--searchresults-header-fg); +} + +.searchresults-outer { + margin-left: auto; + margin-right: auto; + max-width: var(--content-max-width); + border-bottom: 1px dashed var(--searchresults-border-color); +} + +ul#searchresults { + list-style: none; + padding-left: 20px; +} +ul#searchresults li { + margin: 10px 0px; + padding: 2px; + border-radius: 2px; +} +ul#searchresults li.focus { + background-color: var(--searchresults-li-bg); +} +ul#searchresults span.teaser { + display: block; + clear: both; + margin: 5px 0 0 20px; + font-size: 0.8em; +} +ul#searchresults span.teaser em { + font-weight: bold; + font-style: normal; +} + +/* Sidebar */ + +.sidebar { + position: fixed; + left: 0; + top: 0; + bottom: 0; + width: var(--sidebar-width); + font-size: 0.875em; + box-sizing: border-box; + -webkit-overflow-scrolling: touch; + overscroll-behavior-y: contain; + background-color: var(--sidebar-bg); + color: var(--sidebar-fg); +} +.sidebar-resizing { + -moz-user-select: none; + -webkit-user-select: none; + -ms-user-select: none; + user-select: none; +} +.js:not(.sidebar-resizing) .sidebar { + transition: transform 0.3s; /* Animation: slide away */ +} +.sidebar code { + line-height: 2em; +} +/* .sidebar .sidebar-scrollbox { + overflow-y: auto; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + padding: 10px 10px; +} */ +.sidebar .sidebar-resize-handle { + position: absolute; + cursor: col-resize; + width: 0; + right: 0; + top: 0; + bottom: 0; +} +.js .sidebar .sidebar-resize-handle { + cursor: col-resize; + width: 5px; +} +.sidebar-hidden .sidebar { + transform: translateX(calc(0px - var(--sidebar-width))); +} +.sidebar::-webkit-scrollbar { + background: var(--sidebar-bg); +} +.sidebar::-webkit-scrollbar-thumb { + background: var(--scrollbar); +} + +.chapter { + list-style: none outside none; + padding-left: 0; + line-height: 2.2em; +} + +.chapter ol { + width: 100%; +} + +.chapter li { + display: flex; + color: var(--sidebar-non-existant); +} +.chapter li a { + display: block; + padding: 0; + text-decoration: none; + color: var(--sidebar-fg); +} + +.chapter li a:hover { + color: var(--sidebar-active); +} + +.chapter li a.active { + color: var(--sidebar-active); +} + +.chapter li > a.toggle { + cursor: pointer; + display: block; + margin-left: auto; + padding: 0 10px; + user-select: none; + opacity: 0.68; +} + +.chapter li > a.toggle div { + transition: transform 0.5s; +} + +/* collapse the section */ +.chapter li:not(.expanded) + li > ol { + display: none; +} + +.chapter li.chapter-item { + line-height: 1.5em; + margin-top: 0.6em; +} + +.chapter li.expanded > a.toggle div { + transform: rotate(90deg); +} + +.spacer { + width: 100%; + height: 3px; + margin: 5px 0px; +} +.chapter .spacer { + background-color: var(--sidebar-spacer); +} + +@media (-moz-touch-enabled: 1), (pointer: coarse) { + .chapter li a { padding: 5px 0; } + .spacer { margin: 10px 0; } +} + +.section { + list-style: none outside none; + padding-left: 20px; + line-height: 1.9em; +} + +/* Theme Menu Popup */ + +.theme-popup { + position: absolute; + left: 10px; + top: var(--menu-bar-height); + z-index: 1000; + border-radius: 4px; + font-size: 0.7em; + color: var(--fg); + background: var(--theme-popup-bg); + border: 1px solid var(--theme-popup-border); + margin: 0; + padding: 0; + list-style: none; + display: none; +} +.theme-popup .default { + color: var(--icons); +} +.theme-popup .theme { + width: 100%; + border: 0; + margin: 0; + padding: 2px 10px; + line-height: 25px; + white-space: nowrap; + text-align: left; + cursor: pointer; + color: inherit; + background: inherit; + font-size: inherit; +} +.theme-popup .theme:hover { + background-color: var(--theme-hover); +} +.theme-popup .theme:hover:first-child, +.theme-popup .theme:hover:last-child { + border-top-left-radius: inherit; + border-top-right-radius: inherit; +} diff --git a/manual/src/theme/css/general.css b/manual/src/theme/css/general.css index e0255a8281b1..8d52e7b5073c 100644 --- a/manual/src/theme/css/general.css +++ b/manual/src/theme/css/general.css @@ -1,23 +1,25 @@ +@import 'variables.css'; + body { font-family: 'Ubuntu', sans-serif; font-size: 1rem; line-height: 1.5; - color: #333; + color: var(--fg); margin: 0; - background-color: #ffffff; + background-color: var(--bg); } -h1, h2, h3, h4, h5, h6 { color: #333; } -a { - color: #478061; +h1, h2, h3, h4, h5, h6 { color: var(--fg); } +a, a:visited { + color: var(--links); text-decoration: none; } -a:hover { - color: #333; +a:hover, a:visited:hover { + color: var(--links-hover); text-decoration: underline; } code { - background: #fdf6e3; + background: var(--inline-code-color); padding: 2px 4px; border-radius: 4px; white-space: pre-wrap; @@ -30,8 +32,8 @@ pre code { pre { padding: .5em; margin: 1em 0; - background: #fdf6e3; - border: 1px solid #ccc; + background: var(--inline-code-color); + border: 1px solid var(--code-border); border-radius: 4px; } @@ -39,41 +41,43 @@ blockquote { margin: 20px 0; padding: 0 20px; padding-left: 1em; - background: #ebf4ef; - border: 1px solid #d1e6da; + background: var(--quote-bg); + border: 1px solid var(--quote-border); border-left: none; border-right: none; } +blockquote code { + background: var(--quote-code-bg); +} + li.js-unavailable { - background-color: #f6cf68; - border-radius: 10px; - margin-left: 1em; - padding-left: 1em; - padding-right: 1em; + background-color: #f6cf68; + border-radius: 10px; + margin-left: 1em; + padding-left: 1em; + padding-right: 1em; } table { border-collapse: collapse; display: block; overflow-y: auto; + border: 1px var(--table-border-color) solid; } table td { padding: 3px 20px; - border: 1px #fafafa solid; } table thead { - background: #fafafa; + background: var(--table-header-bg); + color: var(--table-header-fg); } table thead td { font-weight: 700; - border: none; -} -table thead tr { } -/* Alternate background colors for rows */ table tbody tr:nth-child(2n) { - background: #fafafa; + /* Alternate background colors for rows */ + background: var(--table-alternate-bg); } svg { @@ -99,17 +103,19 @@ svg { #void-nav { width: 100%; min-height: 50px; - background: #478061; + background: var(--nav-bg); font-size: 14px; display: flex; flex-direction: row; flex-wrap: wrap; } +#void-nav a, #void-nav button, #void-nav label { - fill: #fff; + fill: var(--nav-fg); height: 50px; + min-height: 100%; display: block; line-height: 50px; padding: 0 15px; @@ -129,7 +135,7 @@ svg { display: inline-block; } #void-nav ul li a { - color: #fff; + color: var(--nav-fg); display: block; padding: 0 15px; line-height: 50px; @@ -158,6 +164,13 @@ svg { top: 0; } +#icon-theme-light { + display: var(--theme-toggle-light); +} +#icon-theme-dark { + display: var(--theme-toggle-dark); +} + /* sidebar */ .sidebar-hidden #sidebar { @@ -165,7 +178,7 @@ svg { } #sidebar { padding: .5em; - background: #fafafa; + background: var(--sidebar-bg); font-size: 0.875em; } #sidebar ol { @@ -181,19 +194,19 @@ svg { line-height: 1.9em; } #sidebar a { - color: #000; + color: var(--sidebar-fg); display: block; } #sidebar a:hover { - color: #478061; + color: var(--sidebar-active); text-decoration: none; } #sidebar a.active { - color: #478061; + color: var(--sidebar-active); } #sidebar-toggle { - display: none; + display: none; } /* search */ @@ -203,7 +216,7 @@ svg { padding: 10px 16px; margin: 5px 0; border-radius: 3px; - border: 1px solid #aaa; + border: 1px solid var(--searchbar-border-color); } #searchresults-header { font-weight: bold; @@ -241,7 +254,7 @@ ul#searchresults span.teaser { right: 15px; } .nav-chapters { - fill: #ccc; + fill: var(--nav-arrow-fg); text-align: center; text-decoration: none; display: block; @@ -250,7 +263,7 @@ ul#searchresults span.teaser { } .nav-chapters:hover { text-decoration: none; - fill: #333 + fill: var(--nav-fg-hover); } .nav-chapters svg { @@ -323,97 +336,3 @@ body { display: table; } } - -@media (prefers-color-scheme: dark) { - body { - color: #ccc; - background-color: #222; - } - h1, h2, h3, h4, h5, h6 { color: #ccc; } - a { - color: #62b086; - } - a:hover { - color: #ccc; - } - - code { - background: inherit; - } - pre { - background: #353535; - border: 1px solid #111; - } - - blockquote { - background: inherit; - border-left: .2em solid #ccc; - border-right: none; - border-top: none; - border-bottom: none; - padding-top: .5em; - padding-bottom: .5em; - padding-left: 1em; - padding-right: 1em; - margin-left: 1em; - } - blockquote code { - color: #62b086; - } - li.js-unavailable { - background-color: #f6cf68; - color: #000000; - border-radius: 10px; - margin-left: 1em; - padding-left: 1em; - padding-right: 1em; - } - table td { - border: 1px #2c2c2c solid; - } - table thead { - background: #2c2c2c; - } - table tbody tr:nth-child(2n) { - background: #2c2c2c; - } - - /* nav */ - #void-nav ul li a:hover, - #void-nav ul li a:focus, - #void-nav button:hover, - #void-nav button:focus, - #void-nav label:hover, - #void-nav label:focus { - background: #222; - } - - #void-nav { - background: #295340; - } - - /* sidebar */ - #sidebar { - background: #252525; - } - #sidebar a { - color: #ccc; - } - #sidebar a:hover { - color: #62b086; - } - #sidebar a.active { - color: #62b086; - } - - /* search */ - #searchbar { - background-color: #222; - color: #ccc; - } - - /* chapter navigation */ - .nav-chapters:hover { - fill: #fff - } -} diff --git a/manual/src/theme/css/variables.css b/manual/src/theme/css/variables.css new file mode 100644 index 000000000000..ea306becc5fb --- /dev/null +++ b/manual/src/theme/css/variables.css @@ -0,0 +1,107 @@ + +/* Globals */ + +:root { + --sidebar-width: 300px; + --page-padding: 15px; + --content-max-width: 750px; + --menu-bar-height: 50px; + --void-green: #478061; + --void-dark-green: #62b086; + --void-light: #fafafa; + --void-dark: #252525; +} + +/* Themes */ + +.void-light { + --bg: #ffffff; + --fg: #333; + + --sidebar-bg: var(--void-light); + --sidebar-fg: var(--fg); + --sidebar-active: var(--links); + + --nav-bg: var(--void-green); + --nav-fg: var(--bg); + --nav-arrow-fg: var(--fg); + --nav-fg-hover: #000; + + --scrollbar: var(--sidebar-fg); + + --icons: #737480; + --icons-hover: #b7b9cc; + + --links: var(--void-green); + --links-hover: var(--fg); + + --inline-code-color: #fdf6e3; + --code-border: #ccc; + + --theme-toggle-light: none; + --theme-toggle-dark: inherit; + + --quote-bg: #ebf4ef; + --quote-border: #d1e6da; + --quote-code-bg: var(--inline-code-color); + + --table-border-color: var(--void-green); + --table-header-bg: var(--void-green); + --table-header-fg: #fff; + --table-alternate-bg: var(--void-light); + + --searchbar-border-color: #aaa; + --searchbar-bg: var(--bg); + --searchbar-fg: var(--fg); + --searchbar-shadow-color: #d4c89f; + --searchresults-header-fg: #666; + --searchresults-border-color: #888; + --searchresults-li-bg: #252932; + --search-mark-bg: #e3b171; +} + +.void-dark { + --bg: #222; + --fg: #ccc; + + --sidebar-bg: #252525; + --sidebar-fg: var(--fg); + --sidebar-active: var(--links); + + --nav-bg: #295340; + --nav-fg: var(--fg); + --nav-arrow-fg: var(--fg); + --nav-fg-hover: #fff; + + --scrollbar: var(--sidebar-fg); + + --icons: #737480; + --icons-hover: #b7b9cc; + + --links: var(--void-dark-green); + --links-hover: var(--fg); + + --inline-code-color: #353535; + --code-border: #111; + + --theme-toggle-light: inherit; + --theme-toggle-dark: none; + + --quote-bg: #293d35; + --quote-border: #22362e; + --quote-code-bg: #2a2a2a; + + --table-border-color: var(--void-green); + --table-header-bg: var(--void-green); + --table-header-fg: #fff; + --table-alternate-bg: #2c2c2c; + + --searchbar-border-color: #aaa; + --searchbar-bg: var(--bg); + --searchbar-fg: var(--fg); + --searchbar-shadow-color: #d4c89f; + --searchresults-header-fg: #666; + --searchresults-border-color: #888; + --searchresults-li-bg: #252932; + --search-mark-bg: #e3b171; +} diff --git a/manual/src/theme/index.hbs b/manual/src/theme/index.hbs index 239c9c5728a1..27401b487870 100644 --- a/manual/src/theme/index.hbs +++ b/manual/src/theme/index.hbs @@ -1,33 +1,72 @@ - - - - - {{ title }} - - - - - - - - - - - + + + + + {{ title }} + {{#if is_print }} + + {{/if}} + {{#if base_url}} + + {{/if}} + + + + + + + + + + + + + + + + + + + + +
- +
+ -
- {{#if search_enabled}} -