1
0
forked from GitHub/gf-rgl

Make HTML template a bit more generic

This commit is contained in:
John J. Camilleri
2018-11-13 21:46:28 +01:00
parent 20efc48e21
commit 7acbd54f2d
5 changed files with 18 additions and 10 deletions

View File

@@ -2,14 +2,16 @@ TMP=tmp.html
TEMPLATE=../synopsis/template.html TEMPLATE=../synopsis/template.html
ROOT=../.. ROOT=../..
TITLE=$(shell head -n 1 sources.txt)
sources.html: sources.txt $(TEMPLATE) sources.html: sources.txt $(TEMPLATE)
txt2tags --target=html --no-headers --quiet --toc --outfile=$@ --infile=$< txt2tags --target=html --no-headers --quiet --outfile=$@ --infile=$<
pandoc \ pandoc \
--from=html \ --from=html \
--to=html5 \ --to=html5 \
--standalone \ --standalone \
--template=$(TEMPLATE) \ --template=$(TEMPLATE) \
--metadata='title:"More modules in the GF Resource Grammar Library"' \ --metadata='title:"$(TITLE)"' \
--variable='lang:en' \
--variable='rel-root:$(ROOT)/..' \ --variable='rel-root:$(ROOT)/..' \
--output=$(TMP) \ --output=$(TMP) \
$@ $@

View File

@@ -29,6 +29,7 @@ index: index.html
index.txt: MkSynopsis.hs MkExxTable.hs $(INCLUDES) $(EXAMPLES_OUT) $(SRC_FILES) index.txt: MkSynopsis.hs MkExxTable.hs $(INCLUDES) $(EXAMPLES_OUT) $(SRC_FILES)
runghc -i$(ROOT) MkSynopsis.hs runghc -i$(ROOT) MkSynopsis.hs
TITLE=$(shell head -n 1 index.txt)
index.html: index.txt $(TEMPLATE) index.html: index.txt $(TEMPLATE)
txt2tags --target=html --no-headers --quiet --toc --outfile=$@ --infile=$< txt2tags --target=html --no-headers --quiet --toc --outfile=$@ --infile=$<
pandoc \ pandoc \
@@ -36,9 +37,11 @@ index.html: index.txt $(TEMPLATE)
--to=html5 \ --to=html5 \
--standalone \ --standalone \
--template=$(TEMPLATE) \ --template=$(TEMPLATE) \
--css="synopsis.css" \ --metadata='title:"$(TITLE)"' \
--metadata='title:"GF Resource Grammar Library: Synopsis"' \ --variable='lang:en' \
--variable='rel-root:$(ROOT)/..' \ --variable='rel-root:$(ROOT)/..' \
--css="synopsis.css" \
--include-after-body="quicklinks.html" \
--output=$(TMP) \ --output=$(TMP) \
$@ $@
mv $(TMP) $@ mv $(TMP) $@

View File

@@ -7,8 +7,7 @@
==The Prelude module== ==The Prelude module==
The ``Prelude`` defines commonly used utility functions, in particular for The ``Prelude`` defines commonly used utility functions, in particular for strings and booleans.
strings and booleans.
|| Oper | Type | Explanation | || Oper | Type | Explanation |
| ``SS`` | ``Type`` | the type ``{s : Str}`` | ``SS`` | ``Type`` | the type ``{s : Str}``

View File

@@ -0,0 +1 @@
<script src="quicklinks.js"></script>

View File

@@ -28,6 +28,9 @@ $for(header-includes)$
$endfor$ $endfor$
</head> </head>
<body> <body>
$for(include-before)$
$include-before$
$endfor$
<div class="container-fluid my-4"> <div class="container-fluid my-4">
<div class="row"> <div class="row">
@@ -81,7 +84,7 @@ $endif$
<h6 class="text-muted">Documentation</h6> <h6 class="text-muted">Documentation</h6>
<ul class="list-unstyled"> <ul class="list-unstyled">
<li><a href="$rel-root$/doc/gf-shell-reference.html">GF Shell Reference</a></li> <li><a href="$rel-root$/doc/gf-shell-reference.html">GF Shell Reference</a></li>
<li><a href="$rel-root$/lib/doc/synopsis.html">RGL Library Synopsis</a></li> <li><a href="$rel-root$/lib/doc/synopsis/index.html">RGL Library Synopsis</a></li>
<li><a href="$rel-root$/gf-book">The GF Book</a></li> <li><a href="$rel-root$/gf-book">The GF Book</a></li>
<li><a href="$rel-root$/doc/gf-refman.html">Reference Manual</a></li> <li><a href="$rel-root$/doc/gf-refman.html">Reference Manual</a></li>
<li><a href="$rel-root$/doc/tutorial/gf-tutorial.html">Tutorial</a></li> <li><a href="$rel-root$/doc/tutorial/gf-tutorial.html">Tutorial</a></li>
@@ -109,9 +112,9 @@ $endif$
<div> <div>
<div> <div>
</footer> </footer>
$for(include-after)$
<script src="quicklinks.js"></script> $include-after$
$endfor$
<script type="text/javascript"> <script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));