From 4c3d15b34865ec4bce4f6b62a3b4a5382d0064b5 Mon Sep 17 00:00:00 2001 From: Yorhel Date: Sun, 24 Mar 2019 11:07:06 +0100 Subject: [PATCH] Replace "updates" with summarized and more useful "announcements" --- .gitignore | 1 - Makefile | 16 +++---- dat/index.md | 116 ++++++++++++++++++++++++++++++++++++++++++++ mkfeed.pl | 76 +++++++++++++++++++++++++++++ updates.pl | 133 --------------------------------------------------- 5 files changed, 200 insertions(+), 142 deletions(-) create mode 100644 dat/index.md create mode 100755 mkfeed.pl delete mode 100755 updates.pl diff --git a/.gitignore b/.gitignore index a621492..e9471d1 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,6 @@ dat/globster/daemon.md dat/globster/daemon.pod dat/globster/launch.md dat/globster/launch.pod -dat/index.md dat/ncdc/changes.log dat/ncdc/changes.md dat/ncdc/man.md diff --git a/Makefile b/Makefile index 914e96f..2721dcd 100644 --- a/Makefile +++ b/Makefile @@ -62,9 +62,8 @@ PAGES=\ "yxml/man.md https://g.blicky.net/yxml.git/plain/yxml.md" -# Files generated by updates.pl -UPDATES=\ - dat/index.md\ +# Files generated by mkfeed.pl +FEEDS=\ pub/feed.atom\ pub/globster/feed.atom\ pub/ncdc/feed.atom\ @@ -86,18 +85,18 @@ POD_MD := $(shell for i in ${PAGES}; do echo "$$i" | grep -Eo '^[^ ]+\.pod' CHANGES_MD := $(shell for i in ${PAGES}; do echo "$$i" | grep -Eo '^[^ ]+\.log' | sed -E 's/(.+)\.log$$/dat\/\1.md/'; done) # All fetched & generated files -CLEAN := ${FETCH} ${POD_MD} ${CHANGES_MD} ${HTML_OUT} ${UPDATES} +CLEAN := ${FETCH} ${POD_MD} ${CHANGES_MD} ${HTML_OUT} ${FEEDS} .PHONY: all clean -all: .gitignore ${HTML_OUT} ${UPDATES} +all: .gitignore ${HTML_OUT} ${FEEDS} -${UPDATES}: updates.pl - @echo "UPDATE $@" +${FEEDS}: mkfeed.pl dat/index.md + @echo "FEED $@" @mkdir -p $$(dirname "$@") - @./updates.pl "$@" >"$@" + @./mkfeed.pl "$@" "$@" ${FETCH}: dat/%: @@ -122,6 +121,7 @@ ${CHANGES_MD}: dat/%.md: dat/%.log mkchangelog.pl @./mkchangelog.pl "$*" "${shell for i in ${PAGES}; do case "$$i" in "$*.log "*) echo "$$i" | sed -E 's/[^ ]+ +[^ ]+ +//';; esac; done}" <"$<" >"$@" +# TODO: Add --strip-comments to pandoc when I have a version that supports it. ${HTML_OUT}: pub/%.html: dat/%.md template.html @echo "HTML $*" @mkdir -p $$(dirname "$@") diff --git a/dat/index.md b/dat/index.md new file mode 100644 index 0000000..9c49e43 --- /dev/null +++ b/dat/index.md @@ -0,0 +1,116 @@ +% Yorhel's Projects + +This site is an attempt to publish and organise my various open source programs +and libraries on one central location. + + +## Announcements Atom feed + +`2019-03-23` - Bug tracker migration to Gitea +: The bug trackers that used to be embedded in this website have now been + migrated to [Gitea](https://code.blicky.net/) issues. The bug trackers of the + following projects can now be found at these new locations: + + - Ncdu: [/yorhel/ncdu/issues](https://code.blicky.net/yorhel/ncdu/issues) + - Ncdc: [/yorhel/ncdc/issues](https://code.blicky.net/yorhel/ncdc/issues) + - Yxml: [/yorhel/yxml/issues](https://code.blicky.net/yorhel/yxml/issues) + +`2019-02-04` - ncdu 1.14 released +: This release adds mtime display & sorting, a limited form of + --follow-symlinks, can display larger file counts in the file browser and + fixes a few bugs you weren't likely to trigger anyway. [Ncdu + homepage](/ncdu) - [Changelog](/ncdu/changes). + +`2018-02-23` - nginx-confgen 1.2 released +: This release significantly improves the parser to accept more syntax and + fixes string quoting, variable formatting and escape sequences. + [Homepage](/nginx-confgen) - [Changelog](/nginx-confgen/changes). + +`2018-02-18` - TUWF 1.2 released +: This release includes a large number of API additions to improve ergonmics + and adds support for a build-in web server, JSON requests/responses and a + whole lot more. [Homepage](/tuwf) - [Changelog](/tuwf/changes). + +`2018-01-29` - ncdu 1.13 released +: This release adds color support and an extended information mode, keeping + track of file mode, ownership and modification times. Also fixes a few + bugs. [Ncdu homepage](/ncdu) - [Changelog](/ncdu/changes). + + diff --git a/mkfeed.pl b/mkfeed.pl new file mode 100755 index 0000000..817b05c --- /dev/null +++ b/mkfeed.pl @@ -0,0 +1,76 @@ +#!/usr/bin/perl + +# Announcements are read from dat/index.md; Each announcement must have the following format: +# `$date` - $title $meta +# : $body +# +# The $meta and $body are optional. $meta must be in the form: +# or +# +# $fields can be: +# tags: comma-separated list of tags, these are used to determine whether an +# announcement belongs to a particular feed. +# link: Path that the announcement should link to, absent = '/' + +use TUWF::XML ':xml'; +use POSIX 'strftime'; +use IPC::Open2; + +$sub = (shift =~ m{pub/(?:([^/]+)/)?feed.atom} ? $1 : ''); + +$/=undef; +my $body = <>; +my @annuncements; +while($body =~ /`([0-9]{4}-[0-9]{2}-[0-9]{2})` - ([^\n]+)\n(: .+\n(?:\n| .+\n)*)?/mg) { + my($date, $title, $data) = ($1,$2,$3); + $data =~ s/^:/ /; + $data =~ s/^ //mg; + $data =~ s/\s+$//; + $meta = $title =~ s/ *