From de3a745e1af2e441de868c2aa4849102d376acb5 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+orbitalquark@users.noreply.github.com> Date: Sun, 11 Apr 2021 09:34:17 -0400 Subject: Initial pass reformatting all code. Use clang-format, LuaFormatter, and 100 character limit on lines. --- scripts/fill_layout.lua | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'scripts/fill_layout.lua') diff --git a/scripts/fill_layout.lua b/scripts/fill_layout.lua index a60584dc..a1b236cd 100755 --- a/scripts/fill_layout.lua +++ b/scripts/fill_layout.lua @@ -1,10 +1,9 @@ #!/usr/bin/lua --- Filters the given file through markdown, inserts it into the template --- specified by stdin by replacing simple {{ variable }} tags, and outputs the --- result to stdout. +-- Filters the given file through markdown, inserts it into the template specified by stdin by +-- replacing simple {{ variable }} tags, and outputs the result to stdout. --- Filter the file through markdown using TOC generation in order to get header --- anchors, but ignore the actual TOC. +-- Filter the file through markdown using TOC generation in order to get header anchors, but +-- ignore the actual TOC. local p = io.popen('markdown -f toc -T ' .. arg[1]) local html = p:read('*a'):match('^.-\n\n(.+)$') html = html:gsub('([^<]+)'), - content = html:gsub('%%', '%%%%') -} -io.write(io.stdin:read('*a'):gsub('{{ (%S+) }}', tags)) +local tags = {['page.title'] = html:match('([^<]+)'), content = html} +io.write((io.stdin:read('*a'):gsub('{{ (%S+) }}', tags))) -- cgit v1.2.3