aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlexander M Pickering <alex@cogarr.net>2025-10-11 13:12:32 -0500
committerAlexander M Pickering <alex@cogarr.net>2025-10-11 13:12:32 -0500
commit69dafc5d97d05a697958b975d401248ebc492363 (patch)
tree59cdd1d88000876c4b19e63a6b32d853bf214139 /src
parentfbd9f9711d7cbdf47428b7825c16fde03b30a785 (diff)
downloadmdoc-69dafc5d97d05a697958b975d401248ebc492363.tar.gz
mdoc-69dafc5d97d05a697958b975d401248ebc492363.tar.bz2
mdoc-69dafc5d97d05a697958b975d401248ebc492363.zip
Update readme's links.HEADmaster
Diffstat (limited to 'src')
-rw-r--r--src/init.lua21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/init.lua b/src/init.lua
index fc57f24..bc921f2 100644
--- a/src/init.lua
+++ b/src/init.lua
@@ -1,10 +1,10 @@
#!/usr/bin/env lua
--[[
-Mdoc creats documentation from comments in source files.
+Mdoc creates documentation from comments in source files.
Mdoc works in several steps:
1. Create "chunks" from input source files
- 2. Create a dependnecy graph, so we only update the things that
+ 2. Create a dependency graph, so we only update the things that
need updating
3. Output html documentation
]]
@@ -13,6 +13,9 @@ local et = require("etlua")
require("mdoc.ext")
local opt = require("mdoc.opt")
+--[[
+Parse arguments, if we can't run this tool, print a help menu and exit
+]]
local args = {...}
local options = opt.parse_options(args)
if options.help then
@@ -215,6 +218,15 @@ local parse_between = {
["/***"] = "*/",
["--[[**"] = "]]"
}
+local comment_parsers = {
+ "doc.short_desc",
+ "doc.desc",
+ "doc.function",
+ "doc.tparam",
+ "doc.treturn"
+ "doc.method",
+ "doc.field",
+}
for _,file in pairs(state.files) do
local cachefilename = string.format("%s/cache/files/%s",options.output,file.relpath)
local cacheattrs = lfs.attributes(cachefilename)
@@ -257,6 +269,11 @@ end
for _,file in pairs(state.files) do
local function process_chunk(chunk)
assert(chunk.file and chunk.line, "Chunk without file or line num:")
+ local state = {
+ short_desc = "no short description provided",
+ desc = {},
+
+ }
local section = nil
local partname = nil
local sectiontype = nil