diff options
author | Aki <please@ignore.pl> | 2024-08-28 21:59:30 +0200 |
---|---|---|
committer | Aki <please@ignore.pl> | 2024-08-28 21:59:30 +0200 |
commit | 56cea0dde53544380c8eb48357000b9a272ffbb1 (patch) | |
tree | 2adcc4625bf6a89c9ecf1cacff4ee17517fb548f /huh.lua | |
parent | 581de1e3c688ef9b4e0e4a13aabe1ad63d5762f0 (diff) | |
download | huh-56cea0dde53544380c8eb48357000b9a272ffbb1.zip huh-56cea0dde53544380c8eb48357000b9a272ffbb1.tar.gz huh-56cea0dde53544380c8eb48357000b9a272ffbb1.tar.bz2 |
Implemented a very specific generate-index script for the blog
Diffstat (limited to 'huh.lua')
-rwxr-xr-x | huh.lua | 21 |
1 files changed, 0 insertions, 21 deletions
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: - <input> (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) |