branch: elpa/with-editor
commit 05338d893f3879391d7283324364b472e3f4f4d1
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>
make: inject style switcher into generated html manual
---
Makefile | 13 +++++++++++++
with-editor.org | 4 ++--
with-editor.texi | 4 ++--
3 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
index 2df3cf4..602c58c 100644
--- a/Makefile
+++ b/Makefile
@@ -82,13 +82,26 @@ dir: $(PKG).info
@printf "Generating $@\n"
@printf "%s" $^ | xargs -n 1 $(INSTALL_INFO) --dir=$@
+HTML_FIXUP_CSS = '/<link rel="stylesheet" type="text\/css"
href="\/assets\/page.css">/a\
+<link class="s-css-s--style" rel="stylesheet" title="Default"
href="/assets/themes/default.css">\
+\n<link class="s-css-s--style" rel="stylesheet alternate" title="Default high
contrast" href="/assets/themes/default-high-contrast.css">\
+\n<link class="s-css-s--style" rel="stylesheet alternate" title="Solarized
dark xterm" href="/assets/themes/solarized-dark-xterm.css">\
+\n<link class="s-css-s--style" rel="stylesheet alternate" title="Black on
white" href="/assets/themes/black-on-white.css">\
+\n<script src="/assets/js/simple-css-switch.js"></script>'
+HTML_FIXUP_ONLOAD = 's/<body lang="en">/<body lang="en"
onload="simpleCssSwitch()">/'
+HTML_FIXUP_MENU = '/<\/body>/i<div id="s-css-s--menu"><\/div>'
+
%.html: %.texi
@printf "Generating $@\n"
@$(MAKEINFO) --html --no-split $(MANUAL_HTML_ARGS) $<
+ @sed -i -e $(HTML_FIXUP_CSS) -e $(HTML_FIXUP_ONLOAD) -e
$(HTML_FIXUP_MENU) $@
html-dir: $(PKG).texi
@printf "Generating $(PKG)/*.html\n"
@$(MAKEINFO) --html $(MANUAL_HTML_ARGS) $<
+ @for f in $$(find $(PKG) -name '*.html') ; do \
+ sed -i -e $(HTML_FIXUP_CSS) -e $(HTML_FIXUP_ONLOAD) -e
$(HTML_FIXUP_MENU) $$f ; \
+ done
%.pdf: %.texi
@printf "Generating $@\n"
diff --git a/with-editor.org b/with-editor.org
index a67a8b7..bf803e8 100644
--- a/with-editor.org
+++ b/with-editor.org
@@ -7,7 +7,7 @@
#+TEXINFO_DIR_CATEGORY: Emacs
#+TEXINFO_DIR_TITLE: With-Editor: (with-editor).
#+TEXINFO_DIR_DESC: Using the Emacsclient as $EDITOR
-#+SUBTITLE: for version 2.7.0 (v2.7.0-9-gf733034+1)
+#+SUBTITLE: for version 2.7.0 (v2.7.0-10-g93876b6+1)
#+BIND: ox-texinfo+-before-export-hook ox-texinfo+-update-version-strings
#+TEXINFO_DEFFN: t
@@ -29,7 +29,7 @@ additional functionality which makes it useful even for
end-users, who
don't use Magit or another package which uses it internally.
#+TEXINFO: @noindent
-This manual is for With-Editor version 2.7.0 (v2.7.0-9-gf733034+1).
+This manual is for With-Editor version 2.7.0 (v2.7.0-10-g93876b6+1).
#+BEGIN_QUOTE
Copyright (C) 2015-2017 Jonas Bernoulli <[email protected]>
diff --git a/with-editor.texi b/with-editor.texi
index a0cd0dd..c48e806 100644
--- a/with-editor.texi
+++ b/with-editor.texi
@@ -30,7 +30,7 @@ General Public License for more details.
@finalout
@titlepage
@title With-Editor User Manual
-@subtitle for version 2.7.0 (v2.7.0-9-gf733034+1)
+@subtitle for version 2.7.0 (v2.7.0-10-g93876b6+1)
@author Jonas Bernoulli
@page
@vskip 0pt plus 1filll
@@ -59,7 +59,7 @@ additional functionality which makes it useful even for
end-users, who
don't use Magit or another package which uses it internally.
@noindent
-This manual is for With-Editor version 2.7.0 (v2.7.0-9-gf733034+1).
+This manual is for With-Editor version 2.7.0 (v2.7.0-10-g93876b6+1).
@quotation
Copyright (C) 2015-2017 Jonas Bernoulli <jonas@@bernoul.li>