From 1ef52910df3a560d24a1d92e6fe7621a751d6859 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Thu, 8 Mar 2012 13:44:53 -0500 Subject: Moved Manual into `doc/` root directory. --- doc/gen_manual.lua | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'doc/gen_manual.lua') diff --git a/doc/gen_manual.lua b/doc/gen_manual.lua index fcdf0b14..47c1bb8c 100644 --- a/doc/gen_manual.lua +++ b/doc/gen_manual.lua @@ -5,7 +5,7 @@ local HTML = [[ %(title) - + @@ -36,13 +36,13 @@ local template = {} -- Get manual pages. local pages = {} local lfs = require 'lfs' -for file in lfs.dir('manual/') do +for file in lfs.dir('.') do if file:find('^%d+_.-%.md$') then pages[#pages + 1] = file end end table.sort(pages) -pages[#pages + 1] = '../../README.md' -pages[#pages + 1] = '../../CHANGELOG.md' -pages[#pages + 1] = '../../THANKS.md' +pages[#pages + 1] = '../README.md' +pages[#pages + 1] = '../CHANGELOG.md' +pages[#pages + 1] = '../THANKS.md' -- Create the header and footer. local p = io.popen('markdown header.md') @@ -53,7 +53,7 @@ template.footer = p:read('*all') p:close() -- Create the navigation list. -local navfile = 'manual/.nav.md' +local navfile = '.nav.md' local f = io.open(navfile, 'wb') for _, page in ipairs(pages) do local name = page:match('^%A+(.-)%.md$'):gsub('(%l)(%u)', '%1 %2') @@ -61,7 +61,7 @@ for _, page in ipairs(pages) do f:write('* [', name, '](', page:gsub('%.md$', '.html'), ')\n') end f:close() -p = io.popen('markdown "'..navfile..'"') +p = io.popen('markdown '..navfile) template.nav = p:read('*all') p:close() @@ -69,11 +69,11 @@ p:close() for _, page in ipairs(pages) do local name = page:match('^%A+(.-)%.md$'):gsub('(%l)(%u)', '%1 %2') template.title = name..' - Textadept Manual' - p = io.popen('markdown -f toc -T "manual/'..page..'"') + p = io.popen('markdown -f toc -T '..page) template.toc, template.main = p:read('*all'):match('^(.-\n\n)(.+)$') p:close() if page:find('^%.%./') then page = page:match('^%A+(.+)$') end - f = io.open('manual/'..page:gsub('%.md$', '.html'), 'wb') + f = io.open(page:gsub('%.md$', '.html'), 'wb') local html = HTML:gsub('%%%(([^)]+)%)', template) f:write(html) f:close() -- cgit v1.2.3