Skip to content

Instantly share code, notes, and snippets.

View wlupton's full-sized avatar

William Lupton wlupton

View GitHub Profile
@wlupton
wlupton / README.md
Last active November 11, 2022 14:22
pandoc HTML multi-file writer (example based on https://pandoc.org/MANUAL.html#custom-readers-and-writers sample.lua)

html-multi-writer.lua is a sample pandoc custom writer based on the supplied sample.lua.

You'll need to use the supplied utils.lua (these are stubs and contain only the minimum needed to run the writer) and will need to get logging.lua from https://github.com/wlupton/pandoc-lua-logging.

This is intended as a demo just to show the approach. It is not likely to be directly usable. In particular, all generated YAML files will currently be empty.

With this input (in multi-test.md):

# A section
@wlupton
wlupton / update_dir_mtime.py
Last active October 6, 2016 13:37
Update directory modification times based on modification times of non-directories in sub-tree
#!/usr/bin/env python3
"""Scan the files in a directory sub-tree and set directory modification times
to be the modification time of the newest non directory file within the
sub-tree. This is work around the Office 2016 practice of creating a temporary
file in the same directory as each file when opening that file (which of
course updates the directory modification time."""
import argparse, os, sys, time