From 357f332d1d9e6e0f3952a9584ebbe41a71cbf5bd Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sun, 9 Jun 2024 13:52:18 +0100 Subject: Add license and version information in the notebook --- ChangeLog.md | 1 + TODO.md | 1 - bin/compile-notes | 8 +++++++- content/notes/00-intro/notes.md | 2 +- structure/notes/00-preamble.md | 32 ++++++++++++++++++++++++++++++++ 5 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 structure/notes/00-preamble.md diff --git a/ChangeLog.md b/ChangeLog.md index 4f5ac8a..bfe3e24 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -4,6 +4,7 @@ ### Features +* [x] Add license and version information in the notebook. * [x] Add the repository URL into the documentation. * [x] Improvements towards localization. diff --git a/TODO.md b/TODO.md index fd6e5d8..17726b2 100644 --- a/TODO.md +++ b/TODO.md @@ -3,7 +3,6 @@ ## Basic * [ ] Notebook: - * [ ] Add license and version information in the notebook. * [ ] Add link to the notebook in the main book HTML. * [ ] Slides: * [ ] Move `slides` to `content/slides`? diff --git a/bin/compile-notes b/bin/compile-notes index 6760925..02a9420 100755 --- a/bin/compile-notes +++ b/bin/compile-notes @@ -30,6 +30,12 @@ for file in $BASEDIR/$STRUCTURE/00*.yml; do echo "---" >> $OUTPUT.md done +# Markdown headers +for file in $BASEDIR/$STRUCTURE/00*.md; do + cat $file >> $OUTPUT.md + echo "" >> $OUTPUT.md +done + # Content find content/notes -type f | grep '\.md$' | sort | while read file; do cat $file >> $OUTPUT.md @@ -37,7 +43,7 @@ find content/notes -type f | grep '\.md$' | sort | while read file; do done # Bibliography section -cat $BASEDIR/templates/book/bibliography.md >> $OUTPUT.md +cat $BASEDIR/templates/notes/bibliography.md >> $OUTPUT.md # Revision information sed -i -e "s|%%revision%%|$REVISION|g" -e "s|%%date%%|$DATE|g" $OUTPUT.md diff --git a/content/notes/00-intro/notes.md b/content/notes/00-intro/notes.md index 79d3f49..518cdab 100644 --- a/content/notes/00-intro/notes.md +++ b/content/notes/00-intro/notes.md @@ -1,3 +1,3 @@ -# Caderno de anotações {#index} +# Caderno de anotações {#anotacoes .unnumbered} Exemplo de caderno de anotações. diff --git a/structure/notes/00-preamble.md b/structure/notes/00-preamble.md new file mode 100644 index 0000000..37d097e --- /dev/null +++ b/structure/notes/00-preamble.md @@ -0,0 +1,32 @@ + + + + + +```{r echo=FALSE, results='asis'} +if (knitr::is_html_output()) { + cat('# Início {#index .unnumbered}') + cat("\n") + cat('') + cat("\n") + cat("

Sobre

") + cat("\n") + cat('') + cat(readLines('DISCLAIMER'), sep='\n') + cat('') + cat('

') + cat('Cardeno Vivo - Versão ') + cat(readLines('.metadata/revision.txt'), sep='\n') + cat(' - compilada em ') + cat(readLines('.metadata/date.txt'), sep='\n') + cat('.') + cat('

') + 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=' ')) + cat('

') + cat(readLines('LICENSE'), sep='\n') + cat('

') +} +``` -- cgit v1.2.3