prepare ldoc.lua for self-documentation

This commit is contained in:
steve donovan 2011-09-19 15:53:43 +02:00
parent 6e941f576f
commit 86dd93e67c
3 changed files with 18 additions and 8 deletions

View File

@ -2,5 +2,5 @@ project='LDoc'
title='LDoc documentation' title='LDoc documentation'
description='A Lua documentation tool' description='A Lua documentation tool'
format='markdown' format='markdown'
file='ldoc.luadoc' file='ldoc.lua'
readme='docs/doc.md' readme='docs/doc.md'

View File

@ -201,7 +201,7 @@ return [==[
</div> <!-- id="content" --> </div> <!-- id="content" -->
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 0.7</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.0</a></i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>

View File

@ -1,8 +1,14 @@
--------------- ---------------
-- ldoc, a Lua documentation generator. -- ldoc, a Lua documentation generator.
-- Compatible with luadoc-style annoations, but providing -- Compatible with luadoc-style annoations, but providing
-- easier customization options. C/C++ support is provided. -- easier customization options.
-- Steve Donovan, 2011 --
-- C/C++ support for Lua extensions is provided.
--
-- @author Steve Donovan
-- @copyright 2011
-- @license MIT/X11
-- @script ldoc
require 'pl' require 'pl'
@ -13,8 +19,9 @@ local lapp = require 'pl.lapp'
-- so we can find our private modules -- so we can find our private modules
app.require_here() app.require_here()
local args = lapp [[ --- @usage
ldoc, a documentation generator for Lua, vs 0.6 local usage = [[
ldoc, a documentation generator for Lua, vs 1.0.0
-d,--dir (default docs) output directory -d,--dir (default docs) output directory
-o,--output (default 'index') output name -o,--output (default 'index') output name
-v,--verbose verbose -v,--verbose verbose
@ -32,9 +39,12 @@ ldoc, a documentation generator for Lua, vs 0.6
-c,--config (default config.ld) configuration name -c,--config (default config.ld) configuration name
--dump debug output dump --dump debug output dump
--filter (default none) filter output as Lua data (e.g pl.pretty.dump) --filter (default none) filter output as Lua data (e.g pl.pretty.dump)
--tags (default none) show all references to a given tag --tags (default none) show all references to given tags, comma-separated
<file> (string) source file or directory containing source <file> (string) source file or directory containing source
`ldoc .` means read options from an `config.ld` file in same directory.
]] ]]
local args = lapp(usage)
local doc = require 'ldoc.doc' local doc = require 'ldoc.doc'
local lang = require 'ldoc.lang' local lang = require 'ldoc.lang'
@ -373,7 +383,7 @@ if type(ldoc.readme) == 'string' then
item.postprocess = function(txt) return ldoc.markup(txt,F) end item.postprocess = function(txt) return ldoc.markup(txt,F) end
end end
---- extract modules from the file objects, resolve references and sort appropriately --- -- extract modules from the file objects, resolve references and sort appropriately ---
local project = ProjectMap() local project = ProjectMap()