diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2024-06-10 14:09:41 +0100 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2024-06-10 14:09:41 +0100 |
commit | d5f4b967422ed898d15aa5941f777155ddb3e3c5 (patch) | |
tree | 83c0c34e47c4e707fea6b1316bc4a3408485446f /structure/book/en/00-preamble.md | |
parent | 0f0f4bbd9c6cba0fbf196de47e2baed7741391c3 (diff) | |
download | bookup-d5f4b967422ed898d15aa5941f777155ddb3e3c5.tar.gz bookup-d5f4b967422ed898d15aa5941f777155ddb3e3c5.tar.bz2 |
Feat: towards localization support
Diffstat (limited to 'structure/book/en/00-preamble.md')
-rw-r--r-- | structure/book/en/00-preamble.md | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/structure/book/en/00-preamble.md b/structure/book/en/00-preamble.md new file mode 100644 index 0000000..b11b806 --- /dev/null +++ b/structure/book/en/00-preamble.md @@ -0,0 +1,55 @@ +<!-- Bookdown HTML before-body file --> + +<!-- Hack to generate a proper cover and fix the missing index.html file --> +<!-- See https://stackoverflow.com/questions/58340924/bookdown-generates-index-file-with-a-chapter-title-instead-of-index-html-when --> +<!-- See https://bookdown.org/yihui/rmarkdown-cookbook/document-metadata.html --> +```{r echo=FALSE, results='asis'} +if (knitr::is_html_output()) { + cat('# Start {#index .unnumbered}') + cat("\n") + cat('<img src="images/cover.png">') + cat("\n") + cat("<h2>Sobre</h2>") + cat("\n") + cat('<em>') + cat(readLines('DISCLAIMER'), sep='\n') + cat('</em>') + cat('<br/><br/>') + cat('Living Book - Version <strong><em>') + cat(readLines('.metadata/revision.txt'), sep='\n') + cat('</em></strong> - compiled at <strong><em>') + cat(readLines('.metadata/date.txt'), sep='\n') + cat('</em></strong>.') + cat('<br/>') + cat('Older versions available in the <a href="/archive">archive</a>.') + cat('<br/>') + cat('Notebook available <a href="/notes">here</a>.') + cat('<br/><br/>') + cat(readLines('snippets/project.txt')) + cat(' - ') + cat(readLines('snippets/volume.txt')) + cat('<br/>') + cat('Published by ') + cat(rmarkdown::metadata$publisher) + cat('<br/>') + cat('Published at ') + cat(readLines('snippets/url.txt'), sep='\n') + cat('<br/><br/>') + cat(readLines('snippets/keywords.txt'), sep='\n') + cat("\n") + cat("<h2>Credits</h2>") + cat("\n") + cat(paste(rmarkdown::metadata$title, "<br/>", "Copyleft ©", readLines('.metadata/year.txt'), rmarkdown::metadata$author, readLines('snippets/contact.txt'), sep=' ')) + cat('<br/><br/>') + cat(readLines('LICENSE'), sep='\n') + cat('<br/><br/>') + cat(readLines('snippets/cover.txt'), sep='\n') + cat("<h2>Versão PDF</h2>") + cat("\n") + cat('Download the PDF <a href="book.pdf">here</a>, or browse it below:') + cat("\n") + cat('<br/><br/>') + cat('<embed src="book.pdf" width="100%" height="375" type="application/pdf">') + cat('<br/><br/>') +} +``` |