ソースを参照

Update docroc;

bjorn 9 年 前
コミット
6d6cc32da2
2 ファイル変更4 行追加16 行削除
  1. 2 14
      tools/docroc.lua
  2. 2 2
      tools/update_documentation.lua

+ 2 - 14
tools/docroc.lua

@@ -1,4 +1,4 @@
--- docroc - Lua documentation generator
+-- docroc v0.1.0 - Lua documentation generator
 -- https://github.com/bjornbytes/docroc
 -- License - MIT, see LICENSE for details.
 
@@ -21,7 +21,7 @@ function docroc.process(filename)
       local processor = docroc.processors[name]
       local tag = processor and processor(body) or {}
       tag.tag = name
-      tag.raw = body
+      tag.text = body
       tags[name] = tags[name] or {}
       table.insert(tags[name], tag)
       table.insert(tags, tag)
@@ -37,12 +37,6 @@ function docroc.process(filename)
 end
 
 docroc.processors = {
-  description = function(body)
-    return {
-      text = body
-    }
-  end,
-
   arg = function(body)
     local name = body:match('^%s*(%w+)') or body:match('^%s*%b{}%s*(%w+)')
     local description = body:match('%-%s*(.*)$')
@@ -75,12 +69,6 @@ docroc.processors = {
       type = type,
       description = description
     }
-  end,
-
-  class = function(body)
-    return {
-      name = body
-    }
   end
 }
 

+ 2 - 2
tools/update_documentation.lua

@@ -11,7 +11,7 @@ for _, comment in ipairs(comments) do
   local tags = comment.tags
 
   if tags.class then
-    local class = tags.class[1].name
+    local class = tags.class[1].text
     io.write('- [' .. class .. '](#' .. class:lower() .. ')\n')
   else
     local context = comment.context:match('function.-([:%.].+)')
@@ -40,7 +40,7 @@ for _, comment in ipairs(comments) do
   local tags = comment.tags
 
   if tags.class then
-    io.write('# ' .. tags.class[1].name .. '\n\n')
+    io.write('# ' .. tags.class[1].text .. '\n\n')
     if tags.description then
       io.write(tags.description[1].text .. '\n\n')
     end