Styling, no-split and syntax highlighting for texi

This commit is contained in:
Florian Dold 2017-06-16 03:20:02 +02:00
parent 0e6c4ba898
commit 7f9e6272fd
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B
6 changed files with 193 additions and 1 deletions

View File

@ -16,6 +16,8 @@ man_MANS = \
taler-exchange-wirewatch.1 \
taler.conf.5
AM_MAKEINFOHTMLFLAGS = --no-split --css-ref=docstyle.css --css-ref=brown-paper.css
DISTCLEANFILES = \
taler-exchange.cps \
taler-exchange.dvi
@ -24,7 +26,8 @@ info_TEXINFOS = \
taler-exchange.texi
extra_TEXINFOS = \
fdl-1.3.texi \
agpl.texi
agpl.texi \
syntax.texi
EXTRA_DIST = \
coding-style.txt \
$(man_MANS) \

63
doc/brown-paper.css Normal file
View File

@ -0,0 +1,63 @@
/*
Brown Paper style from goldblog.com.ua (c) Zaripov Yura <yur4ik7@ukr.net>
*/
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-literal {
color:#005599;
font-weight:bold;
}
.hljs,
.hljs-subst {
color: #363c69;
}
.hljs-string,
.hljs-title,
.hljs-section,
.hljs-type,
.hljs-attribute,
.hljs-symbol,
.hljs-bullet,
.hljs-built_in,
.hljs-addition,
.hljs-variable,
.hljs-template-tag,
.hljs-template-variable,
.hljs-link,
.hljs-name {
color: #2c009f;
}
.hljs-comment,
.hljs-quote,
.hljs-meta,
.hljs-deletion {
color: #802022;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-literal,
.hljs-doctag,
.hljs-title,
.hljs-section,
.hljs-type,
.hljs-name,
.hljs-strong {
font-weight: bold;
}
.hljs-emphasis {
font-style: italic;
}

76
doc/docstyle.css Normal file
View File

@ -0,0 +1,76 @@
html, body {
font-size: 1em;
text-align: left;
text-decoration: none;
}
html { background-color: #e7e7e7; }
body {
max-width: 74.92em;
margin: 0 auto;
padding: .5em 1em 1em 1em;
background-color: white;
border: .1em solid #c0c0c0;
}
h1, h2, h3, h4 { color: #333; }
h5, h6, dt { color: #222; }
a h3 {
color: #005090;
}
a[href] { color: #005090; }
a[href]:visited { color: #100070; }
a[href]:active, a[href]:hover {
color: #100070;
text-decoration: none;
}
.linkrow {
margin: 3em 0;
}
.linkrow {
text-align: center;
}
div.example { padding: .8em 1.2em .4em; }
pre.example { padding: .8em 1.2em; }
div.example, pre.example {
margin: 1em 0 1em 3% ;
-webkit-border-radius: .3em;
-moz-border-radius: .3em;
border-radius: .3em;
border: 1px solid #d4cbb6;
background-color: #f2efe4;
}
div.example > pre.example {
padding: 0 0 .4em;
margin: 0;
border: none;
}
/* This makes the very long tables of contents in Gnulib and other
manuals easier to read. */
.contents ul, .shortcontents ul { font-weight: bold; }
.contents ul ul, .shortcontents ul ul { font-weight: normal; }
.contents ul { list-style: none; }
/* For colored navigation bars (Emacs manual): make the bar extend
across the whole width of the page and give it a decent height. */
.header, .node { margin: 0 -1em; padding: 0 1em; }
.header p, .node p { line-height: 2em; }
/* For navigation links */
.node a, .header a { display: inline-block; line-height: 2em; }
.node a:hover, .header a:hover { background: #f2efe4; }
table.cartouche {
border-collapse: collapse;
border-color: darkred;
border-style: solid;
border-width: 3px;
}

2
doc/highlight.pack.js Normal file

File diff suppressed because one or more lines are too long

44
doc/syntax.texi Normal file
View File

@ -0,0 +1,44 @@
@c Syntax highlighting for texinfo's HTML output
@html
<script src="highlight.pack.js"></script>
<script>
var hls = [];
var syntaxAuto = true;
addEventListener("DOMContentLoaded", function() {
// Highlight blocks with fixed language
for (let x of hls) {
let next = x[0].nextElementSibling;
console.log("next", next);
let blocks = next.querySelectorAll("pre.example");
for (let i = 0; i < blocks.length; i++) {
blocks[i].classList.add("language-" + x[1]);
hljs.highlightBlock(blocks[i]);
}
}
// auto-detect other blocks if not disabled
if (syntaxAuto) {
let blocks = document.querySelectorAll("pre.example");
for (let i = 0; i < blocks.length; i++) {
hljs.highlightBlock(blocks[i]);
}
}
});
</script>
@end html
@macro setsyntax{lang}
@html
<script>
hls.push([document.currentScript, "\lang\"]);
</script>
@end html
@end macro
@macro setsyntaxnoauto{}
@html
<script>
syntaxAuto = false;
</script>
@end html
@end macro

View File

@ -6,6 +6,8 @@
@paragraphindent 0
@exampleindent 4
@include syntax.texi
@copying
This manual is for the GNU Taler Exchange
(version @value{VERSION}, @value{UPDATED}),
@ -306,6 +308,7 @@ If you did not specify a prefix, GNUnet will install to
To download and install the GNU Taler exchange, proceeds as follows:
@setsyntax shell
@example
$ git clone git://taler.net/exchange
$ cd exchange
@ -555,6 +558,7 @@ via an environment variable: @cite{TALER_EXCHANGEDB_POSTGRES_CONFIG}.
via configuration option @cite{db_conn_str}, under section @cite{[exchangedb-BACKEND]}. For example, the demo exchange is configured as follows:
@end itemize
@setsyntax ini
@example
[exchange]
...