From 56cea0dde53544380c8eb48357000b9a272ffbb1 Mon Sep 17 00:00:00 2001 From: Aki Date: Wed, 28 Aug 2024 21:59:30 +0200 Subject: Implemented a very specific generate-index script for the blog --- huh.lua | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100755 huh.lua (limited to 'huh.lua') diff --git a/huh.lua b/huh.lua deleted file mode 100755 index 8f834ab..0000000 --- a/huh.lua +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env lua -local gumbo = require "gumbo" -local config = require "pl.config" -local args = require "pl.lapp" [[ -Generates an HTML document from another HTML document (huh?). - -Options: - -c, --config (default huh.conf) Configuration file - -h, --help Prints this help message to standard output - -Arguments: - (optional string) HTML file to process -]] -local conf = assert(config.read(args.config)) -local document = assert(gumbo.parseFile(args.input or io.stdin)) -local head = assert(gumbo.parseFile(conf.head, {contextElement="head"})) -for _, node in pairs(head.documentElement.childNodes) do - document:adoptNode(node) - document.head:insertBefore(node, document.head.firstChild) -end -document:serialize(io.stdout) -- cgit v1.1