init.lua 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. -------------------------------------------------------------------------------
  2. -- LuaDoc main function.
  3. -- @release $Id: init.lua,v 1.4 2008/02/17 06:42:51 jasonsantos Exp $
  4. -------------------------------------------------------------------------------
  5. local require = require
  6. local util = require "luadoc.util"
  7. logger = {}
  8. module ("luadoc")
  9. -------------------------------------------------------------------------------
  10. -- LuaDoc version number.
  11. _COPYRIGHT = "Copyright (c) 2003-2007 The Kepler Project"
  12. _DESCRIPTION = "Documentation Generator Tool for the Lua language"
  13. _VERSION = "LuaDoc 3.0.1"
  14. -------------------------------------------------------------------------------
  15. -- Main function
  16. -- @see luadoc.doclet.html, luadoc.doclet.formatter, luadoc.doclet.raw
  17. -- @see luadoc.taglet.standard
  18. function main (files, options)
  19. logger = util.loadlogengine(options)
  20. -- load config file
  21. if options.config ~= nil then
  22. -- load specified config file
  23. dofile(options.config)
  24. else
  25. -- load default config file
  26. require("luadoc.config")
  27. end
  28. local taglet = require(options.taglet)
  29. local doclet = require(options.doclet)
  30. -- analyze input
  31. taglet.options = options
  32. taglet.logger = logger
  33. local doc = taglet.start(files)
  34. -- generate output
  35. doclet.options = options
  36. doclet.logger = logger
  37. doclet.start(doc)
  38. end