From f596aa50b367b903ab77251872a9dcb8820dffee Mon Sep 17 00:00:00 2001 From: sceox Date: Tue, 30 Nov 2021 20:42:35 -0800 Subject: [PATCH] Switch to lowdown for markdown conversion Lowdown is fairly simple while supporting the PHP Extra extensions. It also comes with extensive documentation in its man pages, for example the whole language is described in lowdown(5). See https://kristaps.bsd.lv/lowdown/ This fixes a big TODO (anchor links for the table of contents on the webring page). --- README.md | 42 +++++---------------------- md/webring.md | 79 ++++++++++++++++++++++++++++++++++++++++----------- publish.sh | 2 +- 3 files changed, 70 insertions(+), 53 deletions(-) diff --git a/README.md b/README.md index 5aa270c..79ac523 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +# Anarchy Planet web site + This repo is to generate a static site for anarchyplanet.org to replace the existing site. The goal is to generate the site from markdown files by converting the markdown to html and applying minimal @@ -17,41 +19,11 @@ a single directory, but sceox is welcome to change publish.sh to a make script. :) You can see this method in action (maybe! if we didn't break it) at -[https://testing.anarchyplanet.org](https://testing.anarchyplanet.org) and [https://testing.anarchyplanet.org/webring.html](https://testing.anarchyplanet.org/webring.html). +[https://testing.anarchyplanet.org](https://testing.anarchyplanet.org). +## TODOs -# TODOs - -## TODO choose a markdown converter (or a method to fix discount's shortcomings) - -We are currently using -[discount](http://www.pell.portland.or.us/~orc/Code/markdown/), -however discount 2.2.2 (included in Debian repos) is not properly -handling the conversion of anchor links (not a deal breaker but not -great). For example, it converts: - -```markdown -Anarchy Planet Sites{#planet} --------------------- -``` - -to: - -```html -
  • Anarchy Planet Sites
  • -``` - -when it should convert it to: - -```html -

    Anarchy Planet Sites

    -``` - -Pandoc handles this perfectly; however it is a large package with many -features we don't need. However, one advantage to pandoc is that it -can also handle .muse files :) - -## TODO discuss and decide on sections +### TODO discuss and decide on sections notnull's proposals for the sections are: @@ -60,11 +32,11 @@ notnull's proposals for the sections are: - webring (instead of 'others') - contact (probably just a mailto: link) -## TODO write copy for sections +### TODO write copy for sections What rocinante has done on [anarchist news](https://anarchistnews.org/content/anarchy-planet) is already pretty great. Maybe these could be more verbose, but maybe they are fine the way they are! -## TODO we need a favicon +### TODO we need a favicon diff --git a/md/webring.md b/md/webring.md index 7ffa454..19d0b4b 100644 --- a/md/webring.md +++ b/md/webring.md @@ -1,5 +1,5 @@ Webring -====== +======= This is our links page to all the other active hubs of anarchist (and other comrades) activity online (and hopefully not online) that we are @@ -10,20 +10,20 @@ ideas](http://anarchy101.org/1/what-is-anarchism#2). [Please email us any links](mailto:planet@anarchyplanet.org?subject=Link%20request) that should be added and we will take a look. -- [Anarchy Planet Sites](#planet) -- [Outer Anarchy Planet Sites](#outerplanet) -- [Periodical Galaxy](#periodicals) -- [Publisher Galaxy](#publisher) -- [Location Galaxy](#location) -- [@ Blogs Galaxy](#blogs) -- [@ Forums Galaxy](#blogs) -- [Infoshop Galaxy](#infoshop) -- [Green @ Galaxy](#green) -- [Red @ Galaxy](#red) -- [Student Occupation Galaxy](#red) -- [Prisoner Support Galaxy](#red) +- [Anarchy Planet Sites](#Anarchy%20Planet%20Sites) +- [Outer Anarchy Planet Sites](#Outer%20Anarchy%20Planet%20Sites) +- [Periodical Galaxy](#Periodical%20Galaxy) +- [Publisher Galaxy](#Publisher%20Galaxy) +- [Location Galaxy](#Location%20Galaxy) +- [Anarchist Blogs Galaxy](#Anarchist%20Blogs%20Galaxy) +- [Anarchist Forums Galaxy](#Anarchist%20Forums%20Galaxy) +- [Infoshop Galaxy](#Infoshop%20Galaxy) +- [Green Anarchist Galaxy](#Green%20Anarchist%20Galaxy) +- [Red Anarchist Galaxy](#Red%20Anarchist%20Galaxy) +- [Student Occupation Galaxy](#Student%20Occupation%20Galaxy) +- [Prisoner Support Galaxy](#Prisoner%20Support%20Galaxy) -Anarchy Planet Sites{#planet} +Anarchy Planet Sites -------------------- [The Anvil](http://theanvilreview.org/) @@ -57,7 +57,7 @@ Anarchy Planet Sites{#planet} > Formats to produce typographically accurate, easy to parse, clean > textual treatments of these texts. -Outer Anarchy Planet Sites {#outerplanet} +Outer Anarchy Planet Sites -------------------------- [Anarchy 101](http://anarchy101.org/) @@ -87,8 +87,8 @@ Outer Anarchy Planet Sites {#outerplanet} > A website about Nihilist Anarchy -Periodicals ------------ +Periodical Galaxy +------------------ [Anarchy: A Journal of Desire Armed](http://anarchymag.org) @@ -199,3 +199,48 @@ Periodicals > soy-based ink, runs over one hundred pages, is free of advertisements > and features clean and elegant design showcasing high-quality original > artwork and photographs. + +Publisher Galaxy +---------------- + +Coming soon. + +Location Galaxy +--------------- + +Coming soon. + +Anarchist Blogs Galaxy +---------------------- + +Coming soon. + +Anarchist Forums Galaxy +----------------------- + +Coming soon. + +Infoshop Galaxy +--------------- + +Coming soon. + +Green Anarchist Galaxy +---------------------- + +Coming soon. + +Red Anarchist Galaxy +-------------------- + +Coming soon. + +Student Occupation Galaxy +-------------------------- + +Coming soon. + +Prisoner Support Galaxy +----------------------- + +Coming soon. diff --git a/publish.sh b/publish.sh index 6b87434..689133d 100755 --- a/publish.sh +++ b/publish.sh @@ -9,7 +9,7 @@ for f in $FILES do filename=$(basename -- $f .md) echo "publishing md/$filename.md to $PUB_DIR/$filename.html" - markdown -o tmp/$filename.html $f + lowdown -o tmp/$filename.html $f sed -i 's/^/ /' tmp/$filename.html cp head.html tmp/ # set the title