From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id C85F6138350 for ; Mon, 3 Feb 2020 00:07:46 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C56AEE088C; Mon, 3 Feb 2020 00:07:45 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 97442E088C for ; Mon, 3 Feb 2020 00:07:45 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 8FB5234E4E8 for ; Mon, 3 Feb 2020 00:07:44 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 3418D114 for ; Mon, 3 Feb 2020 00:07:43 +0000 (UTC) From: "Ulrich Müller" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Müller" Message-ID: <1580688079.563f4c60d694a0ce2e053a88fdf11f1f88e63dcd.ulm@gentoo> Subject: [gentoo-commits] proj/devmanual:master commit in: / X-VCS-Repository: proj/devmanual X-VCS-Files: Makefile devbook.xsl offline.css X-VCS-Directories: / X-VCS-Committer: ulm X-VCS-Committer-Name: Ulrich Müller X-VCS-Revision: 563f4c60d694a0ce2e053a88fdf11f1f88e63dcd X-VCS-Branch: master Date: Mon, 3 Feb 2020 00:07:43 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: c182781a-e5aa-48fb-9546-bff0f015fb9b X-Archives-Hash: 3bb1829b65d12bcbef08702ddcdb996e commit: 563f4c60d694a0ce2e053a88fdf11f1f88e63dcd Author: Ulrich Müller gentoo org> AuthorDate: Tue Jan 28 19:40:51 2020 +0000 Commit: Ulrich Müller gentoo org> CommitDate: Mon Feb 3 00:01:19 2020 +0000 URL: https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=563f4c60 Support offline browsing. Pass an "offline" flag to devbook.xsl, which disables loading of external assets and loads a simple CSS instead. This will replace the fragile patching in the app-doc/devmanual ebuild. offline.css was originally contributed (as fallback.css) by Lucas Ramage in bug 617724. Signed-off-by: Ulrich Müller gentoo.org> Makefile | 5 ++++- devbook.xsl | 55 +++++++++++++++++++++++++++++++++++++------------------ offline.css | 19 +++++++++++++++++++ 3 files changed, 60 insertions(+), 19 deletions(-) diff --git a/Makefile b/Makefile index 3fb4c52..ef2c735 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,9 @@ HTMLS := $(subst text.xml,index.html,$(XMLS)) ECLASS_HTMLS := $(wildcard eclass-reference/*/index.html) IMAGES := $(patsubst %.svg,%.png,$(SVGS)) +# Nonzero value disables external assets for offline browsing. +OFFLINE = 0 + all: prereq validate build documents.js prereq: @@ -49,7 +52,7 @@ documents.js: bin/build_search_documents.py $(XMLS) # .SECONDEXPANSION: %.html: $$(dir $$@)text.xml devbook.xsl xsl/*.xsl $$(subst text.xml,index.html,$$(wildcard $$(dir $$@)*/text.xml)) - xsltproc devbook.xsl $< > $@ + xsltproc --param offline "$(OFFLINE)" devbook.xsl $< > $@ validate: prereq @xmllint --noout --dtdvalid devbook.dtd $(XMLS) \ diff --git a/devbook.xsl b/devbook.xsl index 3ff6502..faf9796 100644 --- a/devbook.xsl +++ b/devbook.xsl @@ -14,6 +14,10 @@ + + + @@ -451,13 +455,21 @@ <xsl:value-of select="/guide/chapter[1]/title"/> – Gentoo Development Guide - - + + + + + + + + +
+
@@ -561,6 +573,7 @@
+
@@ -581,20 +594,24 @@
-
-
-
-
-

Questions or comments?

- Please feel free to contact us. + +
+
+
+
+

Questions or comments?

+ Please feel free to contact us. +
-
+
- + + +
Copyright (C) 2001-2020 Gentoo Authors
@@ -608,11 +625,13 @@
- - - - - + + + + + + + diff --git a/offline.css b/offline.css new file mode 100644 index 0000000..42f94e9 --- /dev/null +++ b/offline.css @@ -0,0 +1,19 @@ +body { + margin: 40px auto; + max-width: 650px; + line-height: 1.6; + font-size: 18px; + color: #454545; + background-color: #fafafa; + padding: 0 10px; +} + +header, footer { + padding: 0.75em 1em; + margin: 0; + background-color: #e1e1e1; +} + +h1, h2, h3, h4, h5, h6 { + line-height: 1.2; +}