From 8ed61913ab911a3463fc3cd7604c5aff0469ffff Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 18 Nov 2025 13:08:50 -0300 Subject: Feat: improve readability in the HTML frontmatter --- structure/book/en/00-preamble.md | 5 +++++ structure/book/pt-br/00-preamble.md | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/structure/book/en/00-preamble.md b/structure/book/en/00-preamble.md index 146be9b..5bb4c13 100644 --- a/structure/book/en/00-preamble.md +++ b/structure/book/en/00-preamble.md @@ -9,6 +9,7 @@ if (knitr::is_html_output()) { cat("\n") cat('') cat("\n") + cat("

About

") cat("\n") cat('') @@ -38,6 +39,7 @@ if (knitr::is_html_output()) { cat('

') cat(readLines('snippets/keywords.txt'), sep='\n') cat("\n") + cat("

How to cite

") cat("\n") library(stringr) @@ -50,10 +52,12 @@ if (knitr::is_html_output()) { else { archive = '' } + cat('Adapt the following example to your citation standard (APA, ABNT etc) and also to the version you want to cite:

', sep='\n') cat(paste('
', author_cite, '. ', rmarkdown::metadata$title, '. ', readLines('snippets/publisher.txt'), ', ', readLines('.metadata/year.txt'), ' - version ', version, ' - ', readLines('snippets/url.txt'), '/', archive, '
', sep='')) cat("\n") cat("\n") + cat("

Credits

") cat("\n") cat(paste(rmarkdown::metadata$title, "
", "Copyleft ©", readLines('.metadata/year.txt'), rmarkdown::metadata$author, readLines('snippets/contact.txt'), sep=' ')) @@ -61,6 +65,7 @@ if (knitr::is_html_output()) { cat(readLines('LICENSE'), sep='\n') cat('

') cat(readLines('snippets/cover.txt'), sep='\n') + cat("

PDF version

") cat("\n") cat('Download the PDF here, or browse it below:') diff --git a/structure/book/pt-br/00-preamble.md b/structure/book/pt-br/00-preamble.md index c8f693f..8602f0b 100644 --- a/structure/book/pt-br/00-preamble.md +++ b/structure/book/pt-br/00-preamble.md @@ -9,6 +9,7 @@ if (knitr::is_html_output()) { cat("\n") cat('') cat("\n") + cat("

Sobre

") cat("\n") cat('') @@ -38,8 +39,10 @@ if (knitr::is_html_output()) { cat('

') cat(readLines('snippets/keywords.txt'), sep='\n') cat("\n") + cat("

Como citar

") cat("\n") + library(stringr) author = str_split_1(rmarkdown::metadata$author, ' ') author_cite = paste(toupper(author[2]), author[1], sep=', ') @@ -50,9 +53,11 @@ if (knitr::is_html_output()) { else { archive = '' } + cat('Adapte o exemplo a seguir para o seu padrão de citação (ABNT, APA etc) e também para a versão que você quer citar:

', sep='\n') cat(paste('
', author_cite, '. ', rmarkdown::metadata$title, '. ', readLines('snippets/publisher.txt'), ', ', readLines('.metadata/year.txt'), ' - version ', version, ' - ', readLines('snippets/url.txt'), '/', archive, '
', sep='')) cat("\n") + cat("

Créditos

") cat("\n") cat(paste(rmarkdown::metadata$title, "
", "Copyleft ©", readLines('.metadata/year.txt'), rmarkdown::metadata$author, readLines('snippets/contact.txt'), sep=' ')) @@ -60,6 +65,7 @@ if (knitr::is_html_output()) { cat(readLines('LICENSE'), sep='\n') cat('

') cat(readLines('snippets/cover.txt'), sep='\n') + cat("

Versão PDF

") cat("\n") cat('Baixe a versão PDF aqui, ou navegue abaixo:') -- cgit v1.2.3