Skip to content

Commit

Permalink
Add an 'About' page to the doctranscript pdfs
Browse files Browse the repository at this point in the history
  • Loading branch information
thvitt committed May 9, 2020
1 parent c06712c commit 111cffe
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 1 deletion.
2 changes: 2 additions & 0 deletions render-multi-pages.js
Expand Up @@ -56,6 +56,8 @@ if (process.argv.length !== 4) {
}
}

await page.evaluate(s => transcriptGeneration.addAboutPage(s), job.sigil);

if (!debug) {
// console.log("Saving PDF ", job.pdfname, " ...")
await page.pdf({
Expand Down
2 changes: 1 addition & 1 deletion src/main/web
Submodule web updated 1 files
+29 −0 css/render.css
11 changes: 11 additions & 0 deletions svg_rendering/page/js-gen/transcript-generation.js
Expand Up @@ -199,6 +199,17 @@ var transcriptGeneration = (function () {
return serializedSvg;
};

transcriptGeneration.addAboutPage = function addAboutPage(sigil) {
var template = document.getElementById('aboutpage').innerHTML;
const options = {sigil: sigil, generated: new Date().toISOString()};
for (const option in options) {
template = template.replace(RegExp('\{' + option + '\}', 'g'), options[option])
}
const aboutElement = document.createElement('article');
document.body.append(aboutElement);
aboutElement.outerHTML = template;
}


transcriptGeneration.createToPhantom = function createToPhantom(transcript, links) {
transcriptGeneration.createDiplomaticSvg(transcript, function (diploSvg) {
Expand Down
79 changes: 79 additions & 0 deletions svg_rendering/page/transcript-generation.html
Expand Up @@ -59,4 +59,83 @@
<img src="img/usedMarker.svg" alt="Preload usedMarker.svg" />
</div>
</body>

<script type="text/template" id="aboutpage">
<section class="aboutpage">
<article class="title">
<img src="img/faustlogo.svg" alt="Faustedition" style="width: 10em;" />
<h2 class="author">Johann Wolfgang Goethe</h2>
<h1>Faust</h1>
<h3>Historisch-Kritische Edition</h3>
<h2>{sigil}</h2>
</article>

<article class="legende">
<h1>Legende</h1>

<table>
<tr><th colspan="2"></th></tr>
<tr class="hand-g" style="font-family: 'Gentium Plus'">
<td>Serifen</td>
<td>Goethe</td>
</tr>
<tr>
<td>Grotesk</td>
<td>Schreiber*in</td>
</tr>
<tr class="hand-xx" style="font-family: 'Ubuntu Mono'">
<td>Schreibmaschine</td>
<td>zeitgenössische Hand</td>
</tr>

<tr>
<th colspan="2"></th>
</tr>
<tr style="font-style: normal">
<td>recte</td>
<td>deutsche Schrift</td>
</tr>
<tr style="font-style: italic">
<td>kursiv</td>
<td>lateinische Schrift</td>
</tr>

<tr>
<th colspan="2"></th>
</tr>
<tr style="color: black">
<td>schwarz</td>
<td>schwarze Tinte</td>
</tr>
<tr style="color:#A02020">
<td>rot</td>
<td>Rötel, rote Tinte</td>
</tr>
<tr style="color: #5050C0">
<td>blau</td>
<td>blaue Tinte</td>
</tr>
<tr style="color: #808080;">
<td>grau</td>
<td>Bleistift</td>
</tr>
</table>
</article>

<article>
<h1>Zitierempfehlung</h1>
<p>
Johann Wolfgang Goethe: Faust. Historisch-kritische Edition.
Herausgegeben von Anne Bohnenkamp, Silke Henke und Fotis Jannidis
unter Mitarbeit von Gerrit Brüning, Katrin Henzel, Christoph Leijser, Gregor Middell, Dietmar Pravida, Thorsten Vitt und Moritz Wissenbach.
Version alpha. Frankfurt am Main / Weimar / Würzburg 2018 – 2020,
<span>{sigil} – Dokumentarisches Transkript</span>
<!-- , <span>URL: <a href="{url}">{url}</a></span> -->
</p>

<div class="generated">Generiert: {generated}</div>
</article>
</section>
</script>

</html>

0 comments on commit 111cffe

Please sign in to comment.