|
@@ -2,9 +2,9 @@
|
|
-- https://github.com/bjornbytes/docroc
|
|
-- https://github.com/bjornbytes/docroc
|
|
-- License - MIT, see LICENSE for details.
|
|
-- License - MIT, see LICENSE for details.
|
|
|
|
|
|
-local rocdoc = {}
|
|
|
|
|
|
+local docroc = {}
|
|
|
|
|
|
-function rocdoc.process(filename)
|
|
|
|
|
|
+function docroc.process(filename)
|
|
local file = io.open(filename, 'r')
|
|
local file = io.open(filename, 'r')
|
|
local text = file:read('*a')
|
|
local text = file:read('*a')
|
|
file:close()
|
|
file:close()
|
|
@@ -18,7 +18,7 @@ function rocdoc.process(filename)
|
|
local tags = {}
|
|
local tags = {}
|
|
chunk:gsub('@(%w+)%s?([^@]*)', function(name, body)
|
|
chunk:gsub('@(%w+)%s?([^@]*)', function(name, body)
|
|
body = body:gsub('(%s+)$', '')
|
|
body = body:gsub('(%s+)$', '')
|
|
- local processor = rocdoc.processors[name]
|
|
|
|
|
|
+ local processor = docroc.processors[name]
|
|
local tag = processor and processor(body) or {}
|
|
local tag = processor and processor(body) or {}
|
|
tag.tag = name
|
|
tag.tag = name
|
|
tag.raw = body
|
|
tag.raw = body
|
|
@@ -36,7 +36,7 @@ function rocdoc.process(filename)
|
|
return comments
|
|
return comments
|
|
end
|
|
end
|
|
|
|
|
|
-rocdoc.processors = {
|
|
|
|
|
|
+docroc.processors = {
|
|
description = function(body)
|
|
description = function(body)
|
|
return {
|
|
return {
|
|
text = body
|
|
text = body
|
|
@@ -84,4 +84,4 @@ rocdoc.processors = {
|
|
end
|
|
end
|
|
}
|
|
}
|
|
|
|
|
|
-return rocdoc
|
|
|
|
|
|
+return docroc
|