app-doc/devmanual: Fix assets for offline browsing
authorLucas Ramage <ramage.lucas@protonmail.com>
Sat, 5 Jan 2019 23:34:05 +0000 (23:34 +0000)
committerUlrich Müller <ulm@gentoo.org>
Sun, 23 Jun 2019 18:10:00 +0000 (20:10 +0200)
Closes: https://bugs.gentoo.org/617724
Closes: https://github.com/gentoo/gentoo/pull/10974
Signed-off-by: Lucas Ramage <ramage.lucas@protonmail.com>
[sed tweaks converted to patch]
Package-Manager: Portage-2.3.67, Repoman-2.3.15
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
app-doc/devmanual/devmanual-9999.ebuild
app-doc/devmanual/files/devmanual-fallback.patch [new file with mode: 0644]
app-doc/devmanual/metadata.xml

index b71b47820054b1537df4093523c5b38b53b2b8e5..8ad5f06a357ecfa0d938d3fa153475226192b87a 100644 (file)
@@ -1,7 +1,7 @@
 # Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=6
+EAPI=7
 
 inherit readme.gentoo-r1
 
@@ -10,7 +10,7 @@ HOMEPAGE="https://devmanual.gentoo.org/"
 
 if [[ ${PV} == *9999 ]]; then
        inherit git-r3
-       EGIT_REPO_URI="git://anongit.gentoo.org/proj/devmanual.git"
+       EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/devmanual.git"
 else
        SRC_URI="https://dev.gentoo.org/~hwoarang/distfiles/${P}.tar.gz"
        KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x64-macos"
@@ -18,11 +18,16 @@ fi
 
 LICENSE="CC-BY-SA-3.0"
 SLOT="0"
-IUSE=""
+IUSE="+fallback"
 
-DEPEND="dev-libs/libxslt
+BDEPEND="dev-libs/libxslt
        media-gfx/imagemagick[truetype,svg,png]"
 
+src_prepare() {
+       default
+       use fallback && eapply "${FILESDIR}"/${PN}-fallback.patch
+}
+
 src_compile() {
        # Imagemagick uses inkscape (if present) to delegate
        # svg conversions.
diff --git a/app-doc/devmanual/files/devmanual-fallback.patch b/app-doc/devmanual/files/devmanual-fallback.patch
new file mode 100644 (file)
index 0000000..789451d
--- /dev/null
@@ -0,0 +1,60 @@
+Fix assets for offline browsing.
+https://bugs.gentoo.org/617724
+
+--- a/devbook.xsl
++++ b/devbook.xsl
+@@ -439,11 +439,9 @@
+           <xsl:with-param name="append">../</xsl:with-param>
+         </xsl:call-template>
+       </xsl:variable>
+-      <link rel="stylesheet" href="{$relative_path_depth_recursion}devmanual.css" type="text/css" />
++      <link rel="stylesheet" href="{$relative_path_depth_recursion}fallback.css" type="text/css" />
+       <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+       <meta name="description" content="The Gentoo Devmanual is a technical manual which covers topics such as writing ebuilds and eclasses, and policies that developers should be abiding by." />
+-      <link href="https://assets.gentoo.org/tyrian/bootstrap.min.css" rel="stylesheet" media="screen" />
+-      <link href="https://assets.gentoo.org/tyrian/tyrian.min.css" rel="stylesheet" media="screen" />
+       <link rel="icon" href="https://www.gentoo.org/favicon.ico" type="image/x-icon" />
+     </head>
+     <body>
+@@ -476,9 +474,6 @@
+               </div>
+               <div class="logo">
+                 <a href="/" title="Back to the homepage" class="site-logo">
+-                  <object data="https://assets.gentoo.org/tyrian/site-logo.svg" type="image/svg+xml">
+-                    <img src="https://assets.gentoo.org/tyrian/site-logo.png" alt="Gentoo Linux Logo" />
+-                  </object>
+                 </a>
+                 <span class="site-label">Development Guide</span>
+               </div>
+@@ -566,8 +561,6 @@
+           </div>
+         </div>
+       </footer>
+-      <script src="https://assets.gentoo.org/tyrian/jquery.min.js"></script>
+-      <script src="https://assets.gentoo.org/tyrian/bootstrap.min.js"></script>
+     </body>
+     </html>
+   </xsl:template>
+--- /dev/null
++++ b/fallback.css
+@@ -0,0 +1,20 @@
++body {
++    margin: 40px auto;
++    max-width: 650px;
++    line-height: 1.6;
++    font-size: 18px;
++    color: #454545;
++    padding: 0 10px;
++}
++
++h1,h2,h3,h4,h5,h6 {
++    line-height: 1.2;
++}
++
++.divider,
++.footerlinks,
++.navbar-toggle,
++.site-title,
++.tyrian-navbar {
++    display: none;
++}
index 182bdeb954f4197dd20438a8b02e993835c33dfd..6179f6436327e7dc96236b638ba6d0629710c53e 100644 (file)
@@ -12,4 +12,7 @@
                        devmanual@gentoo.org
                </description>
        </maintainer>
+       <use>
+               <flag name="fallback">Use alternative minimal stylesheet instead of tyrian theme.</flag>
+       </use>
 </pkgmetadata>