# ChangeLog
+## v0.5.0 - 2025-11-22
+
+* [x] Changelog support:
+ * [~] Build the recent changes section through a `snippets/changes.md` file?
+ This is partially implemented, but commented.
+ As an alternative (or meanwhile), the notebook can be used.
+ * [x] Alternativelly, build the recent changes using a `snippets/changes.yml`
+ or just `_changes.yml` that gets compilet into a `snippets/changes.md`
+ and into RSS and Atom files that goes in the build.
+ * [x] Add RSS/Atom `rel` elements in the HTML head.
+ * [x] Validate the generated feeds (RSS and Atom).
+ * [x] Add a regular link like "Follow updates in this book".
+ * [x] Document the feature.
+
## v0.4.1 - 2025-11-20
* [x] Add anchors in the notebook HTML preamble.
* [ ] Add the corresponding BibTeX entry.
* [ ] How to cite, by using ~~`@projectName`~~ an example in the PDF
frontmatter.
-* [ ] Recent changes:
- * [ ] Build the recent changes section through a `snippets/changes.md` file?
- This is partially implemented, but commented.
- As an alternative (or meanwhile), the notebook can be used.
- * [ ] Alternativelly, build the recent changes using a `snippets/changes.yml`
- or just `_changes.yml` that gets compilet into a `snippets/changes.md`
- and into a RSS file that goes in the build.
- This RSS them can be linked as a `rel` element in the HTML, along with
- a regular link like "Follow updates in this book".
* [ ] Localization:
* [ ] Make sure to properly localized the build date string.
* [ ] Setup a PO-file workflow for translating the structure and templates?
--- /dev/null
+---
+# Each entry should have the date all supported formats (Atom, RSS and Markdown)
+changelog: Changelog
+version: Version
+versions:
+ - id: 0.5.0
+ date_atom: 2025-11-22T21:30:00-03:00
+ date_rss: 22 Sep 2025 21:30:00 -0300
+ date_markdown: 2025-11-22
+ summary: |
+ * RSS/Atom feed support.
if [ -e "$NOTEBOOK" ]; then
mv $NOTEBOOK $BUILD/notes
fi
+
+# Build changelog
+$DIRNAME/compile-changelog
+
+# Move Atom feed
+if [ -e "$BASEDIR/atom.xml" ]; then
+ mv $BASEDIR/atom.xml $BUILD
+fi
+
+# Move RSS feed
+if [ -e "$BASEDIR/rss.xml" ]; then
+ mv $BASEDIR/rss.xml $BUILD
+fi
--- /dev/null
+#!/usr/bin/env bash
+#
+# Feed compiler
+# Based on https://recursewithless.net/projects/pandoc-feeds.html
+#
+
+# Parameters
+BASENAME="`basename $0 | sed -e 's/\(.\)/\U\1/'`"
+DIRNAME="`dirname $0`"
+BASEDIR="$DIRNAME/.."
+CHANGES="$BASEDIR/_changes.yml"
+CHANGELOG="$BASEDIR/content/notes/00-changelog/changelog.md"
+BOOK="$BASEDIR/_book.yml"
+COMMON="$BASEDIR/_common.yml"
+META="$BASEDIR/.metadata/feed.yml"
+RSS_TMPL="$BASEDIR/templates/rss.xml"
+ATOM_TMPL="$BASEDIR/templates/atom.xml"
+CHANGELOG_TMPL="$BASEDIR/templates/changelog.md"
+CHANGES_TMPL="$BASEDIR/templates/_changes.yml"
+URL="$BASEDIR/snippets/url.txt"
+CONTACT="$BASEDIR/snippets/contact.txt"
+
+# Ensure the changes file exists
+if [ ! -e "$CHANGES" ]; then
+ # Create sample $CHANGES file
+ cp $CHANGES_TMPL $CHANGES
+fi
+
+# Create .metadata/feed.yaml with the needed metadata
+mkdir -p "`dirname $META`"
+echo '---' > $META
+echo "url: $(cat $URL)" >> $META
+echo "email: $(cat $CONTACT)" >> $META
+
+# Generate the Atom feed
+pandoc -M updated="$(LC_ALL=C date --iso-8601='seconds')" \
+ --metadata-file=$META \
+ --metadata-file=$CHANGES \
+ --metadata-file=$BOOK \
+ --metadata-file=$COMMON \
+ --template=$ATOM_TMPL \
+ -t plain \
+ -o atom.xml < /dev/null
+
+# Generate the RSS feed
+pandoc -M updated="$(LC_ALL=C date '+%d %b %Y %T %z')" \
+ --metadata-file=$META \
+ --metadata-file=$CHANGES \
+ --metadata-file=$BOOK \
+ --metadata-file=$COMMON \
+ --template=$RSS_TMPL \
+ -t plain \
+ -o rss.xml < /dev/null
+
+# Generate changelog.md
+mkdir -p "`dirname $CHANGELOG`"
+pandoc \
+ --metadata-file=$META \
+ --metadata-file=$CHANGES \
+ --metadata-file=$BOOK \
+ --metadata-file=$COMMON \
+ --template=$CHANGELOG_TMPL \
+ -t plain \
+ -o $CHANGELOG < /dev/null
+
+# Fix list formatting in the Markdown output
+sed -i -e 's/- /* /' $CHANGELOG
--- /dev/null
+# Changelog {#changelog .unnumbered}
+
+<!-- DO NOT manually edit this file: it's generated from _changes.yml -->
+<!-- Any updates here will be overwritten -->
+
+## Version 0.5.0 - 2025-11-22
+
+* RSS/Atom feed support.
* Adds the compilation metadata:
* Version based on Git tag or commit.
+
* Compilation date.
* Localization support: templates can be easily translated to other languages.
+
+* RSS, Atom and Markdown changelogs.
* `vendor/bookup`: where the Bookup codebase actually resides:
* `content`: Bookup documentation.
* `vendor/{Fuse.js,}`: dependencies.
+* `_changes.yml`: to track changes in your book, used to build RSS and Atom
+ feeds, as well as a ChangeLog in Markdown format.
+<link rel="alternate" type="application/atom+xml" href="/atom.xml" />
+<link rel="alternate" type="application/rss+xml" href="/rss.xml" />
cat('<br/>')
cat('Older versions available in the <a href="/archive">archive</a>.')
cat('<br/>')
+ cat('Follow updates in this book: <a href="/rss.xml">RSS</a> / <a href="/atom.xml">Atom</a>.')
+ cat('<br/>')
cat('Notebook available <a href="/notes">here</a>.')
cat('<br/><br/>')
cat(readLines('snippets/project.txt'))
cat('<br/>')
cat('Versões anteriores disponíveis no <a href="/archive">arquivo</a>.')
cat('<br/>')
+ cat('Acompanhe as atualizações deste livro: <a href="/rss.xml">RSS</a> / <a href="/atom.xml">Atom</a>.')
+ cat('<br/>')
cat('Caderno de anotações disponível <a href="/notes">aqui</a>.')
cat('<br/><br/>')
cat(readLines('snippets/project.txt'))
--- /dev/null
+---
+# Each entry should have the date all supported formats (Atom, RSS and Markdown)
+changelog: Changelog
+version: version
+versions:
+ - id:
+ date_atom:
+ date_rss:
+ date_markdown:
+ summary:
+
+ # Example
+ #- id: 0.1.0
+ # date_atom: 2025-11-22T21:30:00-03:00
+ # date_rss: 22 Sep 2025 21:30:00 -0300
+ # date_markdown: 2025-11-22
+ # summary: |
+ # * Initial version.
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<feed xmlns="http://www.w3.org/2005/Atom">
+ <author>
+ <name>$author$</name>
+ <email>$email$</email>
+ </author>
+ <title>$title$</title>
+ <id>$url$/</id>
+ <link rel="self" href="//$url$/atom.xml" />
+ <updated>$updated$</updated>
+
+ $for(versions)$
+ <entry>
+ <id>$url$/archive/$versions.id$</id>
+ <title>$version$ $versions.id$</title>
+ <updated>$versions.date_atom$</updated>
+ <link href="$url$/archive/$versions.id$" />
+ <summary>$versions.summary$</summary>
+ </entry>
+ $endfor$
+</feed>
--- /dev/null
+# $changelog$ {#changelog .unnumbered}
+
+<!-- DO NOT manually edit this file: it's generated from _changes.yml -->
+<!-- Any updates here will be overwritten -->
+$for(versions)$
+
+## $version$ $versions.id$ - $versions.date_markdown$
+
+$versions.summary$
+$endfor$
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" ?>
+<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
+<channel>
+ <title>$title$</title>
+ <description>$subtitle$</description>
+ <link>$url$/</link>
+ <atom:link href="//$url$/rss.xml" rel="self" type="application/rss+xml" />
+ <lastBuildDate>$updated$</lastBuildDate>
+ <ttl>1440</ttl>
+
+ $for(versions)$
+ <item>
+ <title>$version$ $versions.id$</title>
+ <description>$versions.summary$</description>
+ <link>$url$/archive/$versions.id$</link>
+ <guid>$url$/archive/$versions.id$</guid>
+ <pubDate>$versions.date_rss$</pubDate>
+ </item>
+ $endfor$
+</channel>
+</rss>