Skip to content

plumvillage/newsletter

Repository files navigation

Newsletter / Lá thư Làng Mai

Single source publishing project using Eleventy and PagedJS.

A deploy is running here: lathu.langmai.org

Setup for local development

The media archive (5.5GiB) is required but not part of this repository. Please request it from the Newsletter team and extract it via: tar -xf LTLM_2024_2023_and_2022_Media_Archive.tar

Then run ./setup.sh

Run npm start and browse to http://localhost:8080/.

Generating PDF files

node generatePDF.js

Deployment

npm run deploy

Useful resources

Other tools considered

Bugs & ToDos

  • Eleventy Image processing is not parallel.
  • Sometimes paragraphs (and images) do not break correctly to the next page. See src/media/documentation/BugTextFragment.webp. The fragment ends up in the top right corner (or outside) of the page.
  • The pages with the fade-in gradients over the background images crash Adobe Reader, but only if they had been compressed before with Ghostscript; the uncompressed original works fine! In other words, there is something Ghostscript adds in the compression of those pages that cause the crash. I confirmed that it does not depend on the number of stops of the linear-gradient. It also does not depend on the whether or not I use PDF version 1.7 or 1.5.

Bulk conversation from source ODT (or DOCX...) to Markdown using Pandoc

for i in *.odt
do
	pandoc --from odt --to markdown --wrap=none -i "$i" -o "${i%odt}md"
done

Text Harmonisations to Remember/Conventions

VS Code allows for regex replace submatch, e.g.: ([a-zA-Z])" > $1”

  • Sr > Sr.
  • Br > Br.
  • (replace double spaces)

  • ... > …
  • ... > …
  • ' > ’
  • ' > ’ (a pandoc markdown conversion thing)
  • " > “”
  • "([\p{Letter}]) > “$1
  • ”. > .”
  • **(.*)** > ## $1
  • file:///media/data/dev/newsletter/src/media/originals/(.*) > {% image "$1" %}

Terminal Foo

/media/data/dev/newsletter/src/media/originals/article2024 find * | grep -i "Done" | grep -E -i "jpg|jpeg|png" | grep -v "/." find -iname ".*" -delete find -iname ".DS_Store" -delete