From be8a7fdcedcbc0287c6aca79e4c8f665d806b45b Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Fri, 25 Feb 2022 21:36:12 -0500 Subject: [PATCH 1/2] manual/: Add script to generate mdbook of Manual.md --- Manual.md | 55 ++++ manual/book.toml | 17 + manual/generate_mdbook.py | 125 ++++++++ manual/src/SUMMARY.md | 1 + manual/src/theme/book.js | 119 +++++++ manual/src/theme/css/chrome.css | 484 +++++++++++++++++++++++++++++ manual/src/theme/css/general.css | 345 ++++++++++++++++++++ manual/src/theme/css/print.css | 79 +++++ manual/src/theme/css/variables.css | 107 +++++++ manual/src/theme/favicon.png | Bin 0 -> 5800 bytes manual/src/theme/index.hbs | 253 +++++++++++++++ 11 files changed, 1585 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/chrome.css create mode 100644 manual/src/theme/css/general.css create mode 100644 manual/src/theme/css/print.css create mode 100644 manual/src/theme/css/variables.css create mode 100644 manual/src/theme/favicon.png create mode 100644 manual/src/theme/index.hbs diff --git a/Manual.md b/Manual.md index 34c737e6df427..44e7487c68c7f 100644 --- a/Manual.md +++ b/Manual.md @@ -1,3 +1,4 @@ + # The XBPS source packages manual This article contains an exhaustive manual of how to create new source @@ -74,8 +75,10 @@ packages for XBPS, the `Void Linux` native packaging system. * [Notes](#notes) * [Contributing via git](#contributing) * [Help](#help) + + ### Introduction The `void-packages` repository contains all the @@ -122,8 +125,10 @@ If everything went fine after running a binary package named `foo-1.0_1..xbps` will be generated in the local repository `hostdir/binpkgs`. + + ### Package build phases Building a package consist of the following phases: @@ -160,8 +165,10 @@ via `make install` or any other compatible method. `xbps-src` supports running just the specified phase, and if it ran successfully, the phase will be skipped later (unless its work directory `${wrksrc}` is removed with `xbps-src clean`). + + ### Package naming conventions @@ -237,8 +244,10 @@ is lowercase. Programs can be split into program packages and library packages. The program package should be named as described above. The library package should be prefixed with "lib" (see section `Libraries`) + + ### Global functions The following functions are defined by `xbps-src` and can be used on any template: @@ -359,8 +368,10 @@ The following functions are defined by `xbps-src` and can be used on any templat This is useful when used in conjunction with `skip_extraction`. > Shell wildcards must be properly quoted, Example: `vmove "usr/lib/*.a"`. + + ### Global variables The following variables are defined by `xbps-src` and can be used on any template: @@ -424,8 +435,10 @@ in this directory such as `${XBPS_BUILDDIR}/${wrksrc}`. - `XBPS_RUST_TARGET` The target architecture triplet used by `rustc` and `cargo`. - `XBPS_BUILD_ENVIRONMENT` Enables continuous-integration-specific operations. Set to `void-packages-ci` if in continuous integration. + + ### Available variables @@ -863,8 +876,10 @@ information on this map. Finally, as a general rule, if a package is built the exact same way whether or not a particular package is present in `makedepends` or `hostmakedepends`, that package shouldn't be added as a build time dependency. + + ### Repositories @@ -889,8 +904,10 @@ The following repository names are valid: * `debug`: Repository for packages containing debug symbols. In almost all cases, these packages are generated automatically. * `nonfree`: Repository for packages that are closed source or have nonfree licenses. + + ### Checking for new upstream releases New upstream versions can be automatically checked using @@ -932,8 +949,10 @@ in url. Defaults to `(|\.x)`. - `disabled` can be set to disable update checking for the package, in cases where checking for updates is impossible or does not make sense. This should be set to a string describing why it is disabled. + + ### Handling patches Sometimes software needs to be patched, most commonly to fix bugs that have @@ -955,8 +974,10 @@ xbps-src will only apply patches named in the `series` file. be used to set the args passed to `patch(1)`. As an example, if `foo.patch` requires special arguments to be passed to `patch(1)` that can't be used when applying other patches, `foo.patch.args` can be created containing those args. + + ### build style scripts The `build_style` variable specifies the build method to build and install a @@ -1083,8 +1104,10 @@ matching the `build_style` name, Example: - `texmf` For texmf zip/tarballs that need to go into /usr/share/texmf-dist. Includes duplicates handling. + + ### build helper scripts The `build_helper` variable specifies shell snippets to be sourced that will create a @@ -1132,8 +1155,10 @@ This aims to fix cross-builds for when the build-style is mixed: e.g. when in a - `rust` specifies environment variables required for cross-compiling crates via cargo and for compiling cargo -sys crates. This helper is added by default for packages that use the `cargo` build style. + + ### Functions The following functions can be defined to change the behavior of how the @@ -1197,8 +1222,10 @@ Current working directory for functions is set as follows: - For post_patch through post_install: `build_wrksrc` if it is defined, otherwise `wrksrc`. + + ### Build options Some packages might be built with different build options to enable/disable @@ -1307,8 +1334,10 @@ Example: `XBPS_PKG_OPTIONS_xorg_server=opt`. The list of supported package build options and its description is defined in the `common/options.description` file. + + ### INSTALL and REMOVE files The INSTALL and REMOVE shell snippets can be used to execute certain actions at a specified @@ -1351,8 +1380,10 @@ be executed via `chroot(2)` won't work correctly. > NOTE: do not use INSTALL/REMOVE scripts to print messages, see the next section for more information. + + ### INSTALL.msg and REMOVE.msg files The `INSTALL.msg` and `REMOVE.msg` files can be used to print a message at post-install @@ -1364,8 +1395,10 @@ subpackages can also have their own `INSTALL.msg` and `REMOVE.msg` files, simply as `srcpkgs//.INSTALL.msg` or `srcpkgs//.REMOVE.msg` respectively. This should only be used for critical messages, like warning users of breaking changes. + + ### Creating system accounts/groups at runtime There's a trigger along with some variables that are specifically to create @@ -1396,8 +1429,10 @@ accounts. > NOTE: The underscore policy does not apply to old packages, due to the inevitable breakage of > changing the username only new packages should follow it. + + ### Writing runit services Void Linux uses [runit](http://smarden.org/runit/) for booting and supervision of services. @@ -1443,8 +1478,10 @@ Examples of when *not* to install systemd units: 1. When doing so changes runtime behavior of the packaged software. 2. When it is done via a compile time flag that also changes build dependencies. + + ### 32bit packages 32bit packages are built automatically when the builder is x86 (32bit), but @@ -1465,8 +1502,10 @@ This expects the basename of the target file, Example: `lib32symlinks="foo"`. - `lib32mode` If unset, only shared/static libraries and pkg-config files will be copied to the **32bit** package. If set to `full` all files will be copied to the 32bit package, unmodified. + + ### Subpackages In the example shown above just a binary package is generated, but with some @@ -1525,8 +1564,10 @@ destdir (`$DESTDIR`) to the `subpackage` destdir (`$PKGDESTDIR`). Subpackages are processed always in alphabetical order; To force a custom order, the `subpackages` variable can be declared with the wanted order. + + ### Some package classes @@ -1709,8 +1750,10 @@ following variables: cache during the install/removal of the package - `font_dirs`: which should be set to the directory where the package installs its fonts + + ### Renaming a package - Create empty package of old name, depending on new package. This is @@ -1721,8 +1764,10 @@ old version and increased revision. - Edit references to package in other templates and common/shlibs. - Don't set `replaces=`, it can result in removing both packages from systems by xbps. + + ### Removing a package Follows a list of things that should be done to help guarantee that a @@ -1752,8 +1797,10 @@ template. All removed subpkgs should be added too. This will uninstall package from systems where it is installed. - Remove the package from the repository index or contact a team member that can do so. + + ### XBPS Triggers XBPS triggers are a collection of snippets of code, provided by the `xbps-triggers` @@ -2151,16 +2198,20 @@ During removal it uses `xmlcatmgr` to remove all catalogs passed to it by the To include this trigger use the `sgml_entries` variable or/and the `xml_entries` variable, as the trigger won't do anything unless either of them are defined. + + ### Void specific documentation When you want document details of package's configuration and usage specific to Void Linux, not covered by upstream documentation, put notes into `srcpkgs//files/README.voidlinux` and install with `vdoc "${FILESDIR}/README.voidlinux"`. + + ### Notes - Make sure that all software is configured to use the `/usr` prefix. @@ -2178,8 +2229,10 @@ the installed files (`./xbps-src show-files pkg`) before pushing new updates. - Make sure that binaries are not stripped by the software, let xbps-src do this; otherwise the `debug` packages won't have debugging symbols. + + ### Contributing via git To get started, [fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo) the void-linux `void-packages` git repository on GitHub and clone it: @@ -2197,8 +2250,10 @@ to pull in new changes: $ git remote add upstream https://github.com/void-linux/void-packages.git $ git pull --rebase upstream master + + ### Help If after reading this `manual` you still need some kind of help, please join diff --git a/manual/book.toml b/manual/book.toml new file mode 100644 index 0000000000000..8f15412495ebc --- /dev/null +++ b/manual/book.toml @@ -0,0 +1,17 @@ +[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" +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 diff --git a/manual/generate_mdbook.py b/manual/generate_mdbook.py new file mode 100644 index 0000000000000..259b067272a0f --- /dev/null +++ b/manual/generate_mdbook.py @@ -0,0 +1,125 @@ +#!/usr/bin/env python3 + +from dataclasses import asdict, dataclass, field +import json +from pathlib import Path +import re +import sys +from typing import Optional + + +BEGCUT_RE = re.compile("") +ENDCUT_RE = re.compile(r"") + +BEGPAGE_RE = re.compile(r"") +ENDPAGE_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] + + +if __name__ == "__main__": + if len(sys.argv) > 1: + if sys.argv[1] == "supports": + raise SystemExit + + doc = Path("Manual.md").read_text() + + # remove TOC anchor links + doc = re.sub(r'', "", doc) + # increase heading levels (Manual.md uses ### as the highest level) + doc = re.sub(r"^##(#+ .+)$", r"\1", doc, flags=re.MULTILINE) + # replace relative links with absolute ones + doc = re.sub( + r"\[(?P[^\]]+)\]\(\./(?P[^)]+)\)", + r"[\g](https://github.com/void-linux/void-packages/blob/master/\g)", + doc + ) + if False: + print(doc) + raise SystemExit + + sections = [] + chapter = [] + num = 1 + heading = "" + filename = "" + in_section = False + in_cut = False + + for lno, line in enumerate(doc.split("\n")): + if BEGCUT_RE.search(line): + in_cut = True + elif in_cut: + if ENDCUT_RE.search(line): + in_cut = False + elif BEGCUT_RE.search(line): + raise SyntaxError( + "missing end-of-cut marker", + ("Manual.md", lno+1, 1, line, lno+1, len(line)) + ) + elif m := BEGPAGE_RE.search(line): + filename = f"{m.group('name')}.md" + in_section = True + elif in_section: + if ENDPAGE_RE.search(line): + sections.append( + Section( + Chapter( + name=heading, + number=[num], + content="\n".join(chapter), + path=filename, + source_path=filename, + ) + ) + ) + num += 1 + heading = "" + chapter = [] + in_section = False + elif line.startswith("# ") and not heading: + _, _, heading = line.partition(" ") + chapter += [line] + elif BEGPAGE_RE.search(line): + raise SyntaxError( + "missing end-of-page marker", + ("Manual.md", lno+1, 1, line, lno+1, len(line)) + ) + else: + chapter += [line] + + # get the last section + sections.append( + Section( + Chapter( + name=heading, + number=[num], + content="\n".join(chapter), + path=filename, + source_path=filename, + ) + ) + ) + + # 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 0000000000000..73fa82d6e79c1 --- /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 0000000000000..d1a280f9eca34 --- /dev/null +++ b/manual/src/theme/book.js @@ -0,0 +1,119 @@ +"use strict"; + +// 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"); + 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/chrome.css b/manual/src/theme/css/chrome.css new file mode 100644 index 0000000000000..544e7718ed9d2 --- /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 new file mode 100644 index 0000000000000..740ad0d140ef6 --- /dev/null +++ b/manual/src/theme/css/general.css @@ -0,0 +1,345 @@ +@import 'variables.css'; + +body { + font-family: 'Ubuntu', sans-serif; + font-size: 1rem; + line-height: 1.5; + color: var(--fg); + margin: 0; + background-color: var(--bg); +} +h1, h2, h3, h4, h5, h6 { color: var(--fg); } +a, a:visited { + color: var(--links); + text-decoration: none; +} +a:hover, a:visited:hover { + color: var(--links-hover); + text-decoration: underline; +} + +code { + background: var(--inline-code-color); + 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: var(--inline-code-color); + border: 1px solid var(--code-border); + border-radius: 4px; +} + +blockquote { + margin: 20px 0; + padding: 0 20px; + padding-left: 1em; + 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; +} + +table { + border-collapse: collapse; + display: block; + overflow-y: auto; + border: 1px var(--table-border-color) solid; +} +table td { + padding: 3px 20px; +} +table thead { + background: var(--table-header-bg); + color: var(--table-header-fg); +} +table thead td { + font-weight: 700; +} +table tbody tr:nth-child(2n) { + /* Alternate background colors for rows */ + background: var(--table-alternate-bg); +} + +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: var(--nav-bg); + font-size: 14px; + + display: flex; + flex-direction: row; + flex-wrap: wrap; +} +#void-nav a, +#void-nav button, +#void-nav label { + fill: var(--nav-fg); + height: 50px; + min-height: 100%; + 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: var(--nav-fg); + 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; +} + +#icon-theme-light { + display: var(--theme-toggle-light); +} +#icon-theme-dark { + display: var(--theme-toggle-dark); +} + +/* sidebar */ + +.sidebar-hidden #sidebar { + display: none; +} +#sidebar { + padding: .5em; + background: var(--sidebar-bg); + font-size: 0.875em; + min-height: calc(100vh - 50px - 14px); +} +#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: var(--sidebar-fg); + display: block; +} +#sidebar a:hover { + color: var(--sidebar-active); + text-decoration: none; +} +#sidebar a.active { + color: var(--sidebar-active); +} + +#sidebar-toggle { + display: none; +} + +/* search */ + +#searchbar { + width: 100%; + padding: 10px 16px; + margin: 5px 0; + border-radius: 3px; + border: 1px solid var(--searchbar-border-color); +} +#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: var(--nav-arrow-fg); + text-align: center; + text-decoration: none; + display: block; + max-width: 150px; + min-width: 90px; +} +.nav-chapters:hover { + text-decoration: none; + fill: var(--nav-fg-hover); +} + +.nav-chapters svg { + margin: 0 auto; + width: 1.5em; +} +.mobile-nav-chapters { + fill: var(--nav-arrow-fg); +} +.mobile-nav-chapters:hover { + fill: var(--nav-fg-hover); +} + +/* 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; + } +} diff --git a/manual/src/theme/css/print.css b/manual/src/theme/css/print.css new file mode 100644 index 0000000000000..2970c2b6c7aba --- /dev/null +++ b/manual/src/theme/css/print.css @@ -0,0 +1,79 @@ + +#sidebar, +#menu-bar, +#void-nav, +.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: #ddd; + border-radius: 5px; + + /* Force background to be printed in Chrome */ + -webkit-print-color-adjust: exact; +} + + +pre { + background-color: #ddd; + + /* 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; +} + +table { + color: black; + border-color: black; + background-color: unset; +} + +table thead tr { + color: black; + background-color: unset; +} + +table tbody tr { + background-color: unset; +} + diff --git a/manual/src/theme/css/variables.css b/manual/src/theme/css/variables.css new file mode 100644 index 0000000000000..ea306becc5fb5 --- /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/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 za84NddlH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QDV;;k~!tmRpqxKmUHY$ggOTbd@W|h>;-o@=~g~32CcmZ(huZP z*L6c#Qwwcx)EU3~eu4M#)*FBy(zhOz4WA(Vc*X4b_Rmu4fY3MAopJ5OU-3Ne55Ngw z=hAzSi$E3cm4<;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 is_print }} + + {{/if}} + {{#if base_url}} + + {{/if}} + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + + + + +
+ + + {{#if search_enabled}} + + {{/if}} + + + + +
+ {{{ content }}} +
+ + + + +
+
+ + {{#if livereload}} + + + {{/if}} + + {{#if search_js}} + + + + {{/if}} + + + {{#if is_print}} + + {{/if}} + + From 5912abd4cda57677c792f459b2c1267516357ae6 Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Fri, 1 Apr 2022 15:24:18 -0400 Subject: [PATCH 2/2] manual/: add linkcheck, CI for checking Manual.md changes --- .github/workflows/manual.yml | 28 ++++++++++++++++++++++++++++ common/travis/manual-ci.sh | 10 ++++++++++ manual/book.toml | 7 ++++++- 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/manual.yml create mode 100755 common/travis/manual-ci.sh diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml new file mode 100644 index 0000000000000..dc7847e26545f --- /dev/null +++ b/.github/workflows/manual.yml @@ -0,0 +1,28 @@ +name: Check Manual Changes + +on: + pull_request: + paths: + - 'Manual.md' + - 'manual/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + manual: + name: Check links + runs-on: ubuntu-latest + container: + image: ghcr.io/void-linux/void-musl:20231230R1 + steps: + - name: Prepare container + run: | + xbps-install -Syu || xbps-install -Syu xbps + xbps-install -yu + xbps-install -y git bash mdBook mdbook-linkcheck + - name: Clone and checkout + uses: classabbyamp/treeless-checkout-action@v1 + - run: ./common/travis/manual-ci.sh + diff --git a/common/travis/manual-ci.sh b/common/travis/manual-ci.sh new file mode 100755 index 0000000000000..34281e42bf12a --- /dev/null +++ b/common/travis/manual-ci.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +echo "Checking links" +RUST_LOG=linkcheck=debug mdbook build manual +LINKCHECK=$? + +# Generate exit value +if [ ! $LINKCHECK -eq 0 ] ; then + exit 2 +fi diff --git a/manual/book.toml b/manual/book.toml index 8f15412495ebc..2a98cbe327af3 100644 --- a/manual/book.toml +++ b/manual/book.toml @@ -5,7 +5,7 @@ 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 @@ -15,3 +15,8 @@ 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 +follow-web-links = true +exclude = [ "https://docs.github.com/en/get-started/quickstart/fork-a-repo" ]