diff options
author | mitchell <70453897+667e-11@users.noreply.github.com> | 2012-03-10 21:19:26 -0500 |
---|---|---|
committer | mitchell <70453897+667e-11@users.noreply.github.com> | 2012-03-10 21:19:26 -0500 |
commit | b3c26bdc0688aff1a1c5bc4d0f964be244b0039e (patch) | |
tree | b1cd772a56c5e494f81d06ffb1666ce24a786a57 | |
parent | 1ef52910df3a560d24a1d92e6fe7621a751d6859 (diff) |
Replaced doc/gen_manual.lua with new unversioned tool.
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | doc/.footer.md | 1 | ||||
-rw-r--r-- | doc/.header.md (renamed from doc/header.md) | 0 | ||||
-rw-r--r-- | doc/footer.md | 1 | ||||
-rw-r--r-- | doc/gen_manual.lua | 80 | ||||
-rw-r--r-- | doc/markdowndoc.lua | 4 | ||||
-rw-r--r-- | doc/style.css | 116 | ||||
-rw-r--r-- | src/Makefile | 4 |
8 files changed, 6 insertions, 202 deletions
@@ -44,7 +44,7 @@ directory. They are also available [online][]. ## Contact -Contact me by email: mitchell.at.foicica.com. +Contact me by email: mitchell.att.foicica.com. There is also a [mailing list][]. diff --git a/doc/.footer.md b/doc/.footer.md new file mode 100644 index 00000000..dd3c4c8a --- /dev/null +++ b/doc/.footer.md @@ -0,0 +1 @@ +-> (c) 2007-2012 Mitchell mitchell.att.foicica.com <- diff --git a/doc/header.md b/doc/.header.md index 84995ac0..84995ac0 100644 --- a/doc/header.md +++ b/doc/.header.md diff --git a/doc/footer.md b/doc/footer.md deleted file mode 100644 index 1920715b..00000000 --- a/doc/footer.md +++ /dev/null @@ -1 +0,0 @@ --> (c) 2012 Mitchell mitchell.att.foicica.com <- diff --git a/doc/gen_manual.lua b/doc/gen_manual.lua deleted file mode 100644 index 47c1bb8c..00000000 --- a/doc/gen_manual.lua +++ /dev/null @@ -1,80 +0,0 @@ --- Copyright 2007-2012 Mitchell mitchell.att.foicica.com. See LICENSE. - -local HTML = [[ - <!doctype html> - <html> - <head> - <title>%(title)</title> - <link rel="stylesheet" href="style.css" type="text/css" /> - <meta charset="utf-8" /> - </head> - <body> - <div id="content"> - <div id="header"> - %(header) - </div> - <div id="nav"> - <h2>Manual</h2> - %(nav) - </div> - <div id="toc"> - <h2>Contents</h2> - %(toc) - </div> - <div id="main"> - %(main) - </div> - <div id="footer"> - %(footer) - </div> - </div> - </body> - </html> -]] -local template = {} - --- Get manual pages. -local pages = {} -local lfs = require 'lfs' -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' - --- Create the header and footer. -local p = io.popen('markdown header.md') -template.header = p:read('*all') -p:close() -p = io.popen('markdown footer.md') -template.footer = p:read('*all') -p:close() - --- Create the navigation list. -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') - if page:find('^%.%./') then page = page:match('^%A+(.+)$') end - f:write('* [', name, '](', page:gsub('%.md$', '.html'), ')\n') -end -f:close() -p = io.popen('markdown '..navfile) -template.nav = p:read('*all') -p:close() - --- Write HTML. -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 '..page) - template.toc, template.main = p:read('*all'):match('^(.-\n</ul>\n)(.+)$') - p:close() - if page:find('^%.%./') then page = page:match('^%A+(.+)$') end - f = io.open(page:gsub('%.md$', '.html'), 'wb') - local html = HTML:gsub('%%%(([^)]+)%)', template) - f:write(html) - f:close() -end diff --git a/doc/markdowndoc.lua b/doc/markdowndoc.lua index 8a661138..6c181a7b 100644 --- a/doc/markdowndoc.lua +++ b/doc/markdowndoc.lua @@ -120,10 +120,10 @@ function M.start(doc) -- Create the header and footer, if given a template. local header, footer = '', '' if M.options.template_dir ~= 'luadoc/doclet/html/' then - local p = io.popen('markdown "'..M.options.template_dir..'header.md"') + local p = io.popen('markdown "'..M.options.template_dir..'.header.md"') template.header = p:read('*all') p:close() - p = io.popen('markdown "'..M.options.template_dir..'footer.md"') + p = io.popen('markdown "'..M.options.template_dir..'.footer.md"') template.footer = p:read('*all') p:close() end diff --git a/doc/style.css b/doc/style.css deleted file mode 100644 index 6a1a31e3..00000000 --- a/doc/style.css +++ /dev/null @@ -1,116 +0,0 @@ -/* Copyright 2012 Mitchell mitchell.att.foicica.com. */ - -* { - border: 0 solid #999999; - margin: 0; - padding: 0; -} - -a { - color: #1a66b3; - text-decoration: none; -} -a:hover { text-decoration: underline; } -a:visited { color: #661a66; } - -body { - background-color: #e6e6e6; - color: #333333; -} - -code { - font-size: larger; -} - -h1 { margin: 0 0 1em 0; } -h2, h3, h4, h5, h6 { margin: 1em 0 1em 0; } -h1 { font-size: 1.3em; } -h2 { font-size: 1.1em; } -h3 { font-size: 1em; } -h4 { font-size: 0.9em; } -h5 { font-size: 0.8em; } - -hr { - border: 1px solid #cccccc; - margin: 1em 0 1em 0; -} - -li > code, p > code { color: #808080; } - -pre { - color: #808080; - margin: 0 2.5em 0 2.5em; -} - -table, th, td { - border-width: 1px; - border-collapse: collapse; - margin-left: 1em; - padding: 0.25em; -} - -ul { list-style-type: disc; } - -#content { font-size: 1.2em; } - -#header h1 { - background-color: #cccccc; - border-width: 0 0 1px 0; - padding: 0.25em; - margin: 0; -} -#header ul { - border-width: 0 0 1px 0; - list-style: none; - margin-bottom: 1.5em; - padding: 0.25em; -} -#header li { - color: #808080; - display: inline; -} - -#nav { - border-width: 1px 1px 1px 0; - float: left; - margin-bottom: 1.5em; - width: 10em; -} -#nav ul { - list-style-type: none; - margin: 0.25em 0.25em 0.25em 0.5em; -} -#nav ul ul { margin: 0 0.25em 0 1em; } - -#toc { - border-width: 1px 0 1px 1px; - float: right; - margin: 0 0 1em 1em; -} -#toc ul { - color: #808080; - margin: 0.25em 0.25em 0.25em 1.25em; -} -#toc ul ul { margin: 0 0.25em 0 1em; } - -#nav h2, #toc h2 { - border-width: 0 0 1px 0; - background-color: #cccccc; - font-size: 1em; - font-weight: normal; - margin: 0; - padding: 0.25em; -} - -#main { margin-left: 11em; } -#main p { margin: 1em; } -#main ol, #main ul { margin-left: 2.5em; } -#main ol p, #main ul p { margin-left: 0; } - -#footer { - background-color: #cccccc; - border-width: 1px 0 0 0; - clear: both; - padding: 0.25em; - margin-top: 1.5em; -} diff --git a/src/Makefile b/src/Makefile index 69b83b45..12ea08c2 100644 --- a/src/Makefile +++ b/src/Makefile @@ -181,8 +181,8 @@ clean: cd luajit && make clean doc: manual luadoc adeptsense doxygen -manual: - cd ../doc && lua gen_manual.lua +manual: ../doc/*.md ../*.md + ../doc/bombay -d ../doc -t ../doc --title Textadept --navtitle Manual $^ luadoc: ../modules ../core ../lexers/lexer.lua cd ../doc && $(LUADOC) -d . -t . --doclet markdowndoc $^ adeptsense: ../modules ../core ../lexers/lexer.lua |