diff -urN luadoc-3.0.1_orig/Makefile.win~ luadoc-3.0.1/Makefile.win~
--- luadoc-3.0.1_orig/Makefile.win~	2008-02-18 23:58:08.000000000 +0100
+++ luadoc-3.0.1/Makefile.win~	1970-01-01 01:00:00.000000000 +0100
@@ -1,57 +0,0 @@
-# $Id: Makefile.win,v 1.2 2008/02/17 06:42:51 jasonsantos Exp $
-
-include config.win
-
-LUADOC_DIR= $(LUA_DIR)\luadoc
-DOCLET_DIR= $(LUADOC_DIR)\doclet
-HTML_DIR= $(DOCLET_DIR)\html
-TAGLET_DIR= $(LUADOC_DIR)\taglet
-STANDARD_DIR= $(TAGLET_DIR)\standard
-LAUNCHER_DIR= c:\lua5.1
-LUADOC_REFMAN= doc\refman
-
-LUADOC_LUAS= src\luadoc\config.lua \
-	src\luadoc\init.lua \
-	src\luadoc\lp.lua \
-	src\luadoc\util.lua
-DOCLET_LUAS= src\luadoc\doclet\debug.lua \
-	src\luadoc\doclet\formatter.lua \
-	src\luadoc\doclet\html.lua \
-	src\luadoc\doclet\raw.lua
-HTML_LUAS= src\luadoc\doclet\html\file.lp \
-	src\luadoc\doclet\html\function.lp \
-	src\luadoc\doclet\html\index.lp \
-	src\luadoc\doclet\html\luadoc.css \
-	src\luadoc\doclet\html\menu.lp \
-	src\luadoc\doclet\html\module.lp \
-	src\luadoc\doclet\html\table.lp
-TAGLET_LUAS= src\luadoc\taglet\standard.lua
-STANDARD_LUAS= src\luadoc\taglet\standard\tags.lua
-
-LAUNCHER= src\luadoc.bat
-LAUNCHER_SRC= src\luadoc.lua.in
-LAUNCHER_START= luadoc_start.lua
-
-build clean:
-
-install:    
-	IF NOT EXIST "$(LUADOC_DIR)" mkdir "$(LUADOC_DIR)"
-	FOR %F IN ($(LUADOC_LUAS)) DO copy "%F" "$(LUADOC_DIR)"
-	IF NOT EXIST "$(DOCLET_DIR)" mkdir "$(DOCLET_DIR)"
-	FOR %F IN ($(DOCLET_LUAS)) DO copy "%F" "$(DOCLET_DIR)"
-	IF NOT EXIST "$(HTML_DIR)" mkdir "$(HTML_DIR)"
-	FOR %F IN ($(HTML_LUAS)) DO copy "%F" "$(HTML_DIR)"
-	IF NOT EXIST "$(TAGLET_DIR)" mkdir "$(TAGLET_DIR)"
-	FOR %F IN ($(TAGLET_LUAS)) DO copy "%F" "$(TAGLET_DIR)"
-	IF NOT EXIST "$(STANDARD_DIR)" mkdir "$(STANDARD_DIR)"
-	FOR %F IN ($(STANDARD_LUAS)) DO copy "%F" "$(STANDARD_DIR)"
-	IF NOT EXIST "$(LAUNCHER_DIR)" mkdir "$(LAUNCHER_DIR)"
-	copy "$(LAUNCHER)" "$(LAUNCHER_DIR)"
-	copy "$(LAUNCHER_SRC)" "$(LAUNCHER_DIR)\$(LAUNCHER_START)"
-	
-	
-
-refman:
-	IF NOT EXIST "$(LUADOC_REFMAN)" mkdir "$(LUADOC_REFMAN)"
-	"$(LAUNCHER)" -d "$(LUADOC_REFMAN)" src\luadoc
-
diff -urN luadoc-3.0.1_orig/src/luadoc/config.lua luadoc-3.0.1/src/luadoc/config.lua
--- luadoc-3.0.1_orig/src/luadoc/config.lua	2007-04-18 16:28:39.000000000 +0200
+++ luadoc-3.0.1/src/luadoc/config.lua	2010-11-09 10:33:38.000001000 +0100
@@ -29,6 +29,8 @@
 	nomodules = false,
 	nofiles = false,
 	verbose = true,
+	locals = false,
+	internals = false
 }
 
 return default_options
diff -urN luadoc-3.0.1_orig/src/luadoc/doclet/html/file.lp luadoc-3.0.1/src/luadoc/doclet/html/file.lp
--- luadoc-3.0.1_orig/src/luadoc/doclet/html/file.lp	2007-12-21 18:50:48.000000000 +0100
+++ luadoc-3.0.1/src/luadoc/doclet/html/file.lp	2010-10-18 17:50:17.000001000 +0200
@@ -50,9 +50,9 @@
 <h2>Functions</h2>
 <table class="function_list">
 <%for _, func_name in ipairs(file_doc.functions) do
-  local func_data = file_doc.functions[func_name]%>
-	<tr>
-	<td class="name" nowrap><%=func_data.private and "local " or ""%><a href="#<%=func_name%>"><%=func_name%></a>&nbsp;(<%=table.concat(func_data.param, ", ")%>)</td>
+  local func_data = file_doc.functions[func_name] %>
+	<tr <%= func_data.deprecated and 'class="deprecated"' or "" %>>
+	<td class="name" nowrap><%= (func_data.scope == "public") and "" or func_data.scope %> <a href="#<%=func_name%>"><%=func_name%></a>&nbsp;(<%=table.concat(func_data.param, ", ")%>)</td>
 	<td class="summary"><%=func_data.summary%></td>
 	</tr>
 <%end%>
@@ -63,10 +63,11 @@
 <%if #file_doc.tables > 0 then%>
 <h2>Tables</h2>
 <table class="table_list">
-<%for _, tab_name in ipairs(file_doc.tables) do%>
+<%for _, tab_name in ipairs(file_doc.tables) do
+  local table_data = file_doc.tables[tab_name]%>
 	<tr>
-	<td class="name" nowrap><a href="#<%=tab_name%>"><%=tab_name%></a></td>
-	<td class="summary"><%=file_doc.tables[tab_name].summary%></td>
+	<td class="name" nowrap><%= (table_data.scope == "public") and "" or table_data.scope %> <a href="#<%=tab_name%>"><%=tab_name%></a></td>
+	<td class="summary"><%=table_data.summary%></td>
 	</tr>
 <%end%>
 </table>
diff -urN luadoc-3.0.1_orig/src/luadoc/doclet/html/function.lp luadoc-3.0.1/src/luadoc/doclet/html/function.lp
--- luadoc-3.0.1_orig/src/luadoc/doclet/html/function.lp	2007-12-21 18:50:48.000000000 +0100
+++ luadoc-3.0.1/src/luadoc/doclet/html/function.lp	2010-10-14 16:44:41.000001000 +0200
@@ -8,10 +8,19 @@
 end
 %>
 
-<dt><%=func.private and "local " or ""%><a name="<%=func.name%>"></a><strong><%=func.name%></strong>&nbsp;(<%=table.concat(func.param, ", ")%>)</dt>
-<dd>
+<dt <%= func.deprecated and 'class="deprecated"' or "" %>><%= (func.scope == "public") and "" or func.scope %> <a name="<%=func.name%>"></a><strong><%=func.name%></strong>&nbsp;(<%=table.concat(func.param, ", ")%>)</dt>
+<dd <%= func.deprecated and 'class="deprecated"' or "" %>>
 <%=func.description or ""%>
 
+<% if func.deprecated then %>
+	<% if func.deprecated ~= "" then %>
+	<h3>Deprecated:</h3>
+	<%= func.deprecated %>
+	<% else %>
+	<h3>Deprecated.</h3>
+	<% end %>
+<% end %>
+
 <%if type(func.param) == "table" and #func.param > 0 then%>
 <h3>Parameters</h3>
 <ul>
diff -urN luadoc-3.0.1_orig/src/luadoc/doclet/html/luadoc.css luadoc-3.0.1/src/luadoc/doclet/html/luadoc.css
--- luadoc-3.0.1_orig/src/luadoc/doclet/html/luadoc.css	2006-03-31 22:45:13.000000000 +0200
+++ luadoc-3.0.1/src/luadoc/doclet/html/luadoc.css	2010-10-21 15:03:49.000001000 +0200
@@ -170,7 +170,7 @@
 
 #navigation li li a
 {
-	padding: 0px 3px 0px -1em;
+	padding: 0px 3px 0px 0px;
 }
 
 #content
@@ -246,6 +246,7 @@
 	border-color: #cccccc;
 	border-collapse: collapse;
 }
+.deprecated { opacity: .5; }
 table.function_list td
 {
 	border-width: 1px;
@@ -281,6 +282,3 @@
 dl.table dt {border-top: 1px solid #ccc; padding-top: 1em;}
 dl.table dd {padding-bottom: 1em;}
 dl.table h3 {padding: 0; margin: 0; font-size: medium;}
-
-#TODO: make module_list, file_list, function_list, table_list inherit from a list
-
diff -urN luadoc-3.0.1_orig/src/luadoc/doclet/html/module.lp luadoc-3.0.1/src/luadoc/doclet/html/module.lp
--- luadoc-3.0.1_orig/src/luadoc/doclet/html/module.lp	2007-12-21 18:50:48.000000000 +0100
+++ luadoc-3.0.1/src/luadoc/doclet/html/module.lp	2010-10-18 17:47:36.000001000 +0200
@@ -49,8 +49,8 @@
 <table class="function_list">
 <%for _, func_name in ipairs(module_doc.functions) do
   local func_data = module_doc.functions[func_name]%>
-	<tr>
-	<td class="name" nowrap><%=func_data.private and "local " or ""%><a href="#<%=func_name%>"><%=func_name%></a>&nbsp;(<%=table.concat(module_doc.functions[func_name].param, ", ")%>)</td>
+	<tr <%= func_data.deprecated and 'class="deprecated"' or "" %>
+	<td class="name" nowrap><%= (func_data.scope == "public") and "" or func_data.scope %> <a href="#<%=func_name%>"><%=func_name%></a>&nbsp;(<%=table.concat(module_doc.functions[func_name].param, ", ")%>)</td>
 	<td class="summary"><%=module_doc.functions[func_name].summary%></td>
 	</tr>
 <%end%>
@@ -61,10 +61,11 @@
 <%if #module_doc.tables > 0 then%>
 <h2>Tables</h2>
 <table class="table_list">
-<%for _, tab_name in ipairs(module_doc.tables) do%>
+<%for _, tab_name in ipairs(module_doc.tables) do
+  local table_data = module_doc.tables[tab_name]%>
 	<tr>
-	<td class="name" nowrap><a href="#<%=tab_name%>"><%=tab_name%></a></td>
-	<td class="summary"><%=module_doc.tables[tab_name].summary%></td>
+	<td class="name" nowrap><%= (table_data.scope == "public") and "" or table_data.scope %> <a href="#<%=tab_name%>"><%=tab_name%></a></td>
+	<td class="summary"><%=table_data.summary%></td>
 	</tr>
 <%end%>
 </table>
diff -urN luadoc-3.0.1_orig/src/luadoc/doclet/html/table.lp luadoc-3.0.1/src/luadoc/doclet/html/table.lp
--- luadoc-3.0.1_orig/src/luadoc/doclet/html/table.lp	2007-04-14 04:02:54.000000000 +0200
+++ luadoc-3.0.1/src/luadoc/doclet/html/table.lp	2010-10-18 17:48:27.000001000 +0200
@@ -1,4 +1,4 @@
-<dt><a name="<%=tab.name%>"></a><strong><%=tab.name%></strong></dt>
+<dt><%= (tab.scope == "public") and "" or tab.scope %> <a name="<%=tab.name%>"></a><strong><%=tab.name%></strong></dt>
 <dd><%=tab.description%>
 
 <%if type(tab.field) == "table" and #tab.field > 0 then%>
diff -urN luadoc-3.0.1_orig/src/luadoc/doclet/html.lua luadoc-3.0.1/src/luadoc/doclet/html.lua
--- luadoc-3.0.1_orig/src/luadoc/doclet/html.lua	2007-12-21 18:50:48.000000000 +0100
+++ luadoc-3.0.1/src/luadoc/doclet/html.lua	2010-10-25 14:00:14.000001000 +0200
@@ -149,7 +149,7 @@
 	assert(fname)
 
 	-- if fname does not specify a module, use the module_doc
-	if string.len(modulename) == 0 and module_doc then
+	if #modulename == 0 and module_doc then
 		modulename = module_doc.name
 	end
 
@@ -158,8 +158,7 @@
 --		logger:error(string.format("unresolved reference to function `%s': module `%s' not found", fname, modulename))
 		return
 	end
-	
-	for _, func_name in pairs(module_doc[kind]) do
+	for _, func_name in ipairs(module_doc[kind]) do
 		if func_name == fname then
 			return module_link(modulename, doc, from) .. "#" .. fname
 		end
diff -urN luadoc-3.0.1_orig/src/luadoc/taglet/standard/tags.lua luadoc-3.0.1/src/luadoc/taglet/standard/tags.lua
--- luadoc-3.0.1_orig/src/luadoc/taglet/standard/tags.lua	2007-09-05 14:39:09.000000000 +0200
+++ luadoc-3.0.1/src/luadoc/taglet/standard/tags.lua	2010-11-09 10:34:27.000001000 +0100
@@ -7,7 +7,7 @@
 local util = require "luadoc.util"
 local string = require "string"
 local table = require "table"
-local assert, type, tostring = assert, type, tostring
+local assert, type, tostring, error = assert, type, tostring, error
 
 module "luadoc.taglet.standard.tags"
 
@@ -145,6 +145,20 @@
 end
 
 -------------------------------------------------------------------------------
+local function deprecated (tag, block, text)
+	text = text or ""
+	block[tag] = text
+end
+
+-------------------------------------------------------------------------------
+local function scope (tag, block, text)
+	if text ~= "public" and text ~= "internal" and text ~= "local" then
+		error("'scope' tag has wrong value '"..text.."', allowed values: public, internal, local")
+	end
+	block[tag] = text
+end
+
+-------------------------------------------------------------------------------
 
 local handlers = {}
 handlers["author"] = author
@@ -158,6 +172,8 @@
 handlers["return"] = ret
 handlers["see"] = see
 handlers["usage"] = usage
+handlers["deprecated"] = deprecated
+handlers["scope"] = scope
 
 -------------------------------------------------------------------------------
 
diff -urN luadoc-3.0.1_orig/src/luadoc/taglet/standard.lua luadoc-3.0.1/src/luadoc/taglet/standard.lua
--- luadoc-3.0.1_orig/src/luadoc/taglet/standard.lua	2007-12-21 18:50:48.000000000 +0100
+++ luadoc-3.0.1/src/luadoc/taglet/standard.lua	2010-11-09 10:34:10.000001000 +0100
@@ -54,7 +54,7 @@
 		if r ~= nil then
 			return {
 				name = id,
-				private = (l == "local"),
+				scope = (l == "local ") and "local" or "public",
 				param = util.split("%s*,%s*", param),
 			}
 		end
@@ -156,12 +156,11 @@
 	-- get the first non-empty line of code
 	local code = table.foreachi(block.code, function(_, line)
 		if not util.line_empty(line) then
-			-- `local' declarations are ignored in two cases:
-			-- when the `nolocals' option is turned on; and
-			-- when the first block of a file is parsed (this is
-			--	necessary to avoid confusion between the top
-			--	local declarations and the `module' definition.
-			if (options.nolocals or first_line) and line:find"^%s*local" then
+			-- `local' declarations are ignored when the first
+			-- block of a file is parsed (this is necessary to
+			-- avoid confusion between the top local declarations
+			-- and the `module' definition.
+			if first_line and line:find"^%s*local" then
 				return
 			end
 			return line
@@ -176,7 +175,7 @@
 			block.class = "function"
 			block.name = func_info.name
 			block.param = func_info.param
-			block.private = func_info.private
+			block.scope = func_info.scope
 		elseif module_name then
 			block.class = "module"
 			block.name = module_name
@@ -214,7 +213,9 @@
 	-- extracts summary information from the description
 	block.summary = parse_summary(block.description)
 	assert(string.sub(block.description, 1, 1) ~= " ", string.format("`%s'", block.description))
-	
+	if block.name then
+		assert(block.class == "function" and block.scope or block.class ~= "function", block.name .. " has no scope tag")
+	end
 	return block
 end
 
@@ -232,6 +233,7 @@
 	local block = {
 		comment = {},
 		code = {},
+		scope = "public"
 	}
 
 	while line ~= nil do
@@ -277,7 +279,17 @@
 			-- reached a luadoc block
 			local block
 			line, block, modulename = parse_block(f, line, modulename, first)
-			table.insert(blocks, block)
+			if block.name then
+				assert(block.class == "function" and block.scope or (block.class ~= "function"), "no scope defined")
+			end
+			-- only add locals and internals if explicitly requested
+			if block.scope == "local" then
+				if options.locals then table.insert(blocks, block) end
+			elseif block.scope == "internal" then
+				if options.internals then table.insert(blocks, block) end
+			else
+				table.insert(blocks, block)
+			end
 		else
 			-- look for a module definition
 			modulename = check_module(line, modulename)
@@ -300,7 +312,7 @@
 --		functions = class_iterator(blocks, "function"),
 --		tables = class_iterator(blocks, "table"),
 	}
---
+
 	local first = doc.files[filepath].doc[1]
 	if first and modulename then
 		doc.files[filepath].author = first.author
diff -urN luadoc-3.0.1_orig/src/luadoc/util.lua luadoc-3.0.1/src/luadoc/util.lua
--- luadoc-3.0.1_orig/src/luadoc/util.lua	2008-02-17 07:42:51.000000000 +0100
+++ luadoc-3.0.1/src/luadoc/util.lua	2010-10-25 13:12:45.000001000 +0200
@@ -39,18 +39,20 @@
 -- @return true if line is empty, false otherwise
 
 function line_empty (line)
-	return (string.len(trim(line)) == 0)
+	return (#trim(line) == 0)
 end
 
 -------------------------------------------------------------------------------
--- Appends two string, but if the first one is nil, use to second one
+-- Appends two string, but if the first/second one is nil, use to second/first one
 -- @param str1 first string, can be nil
--- @param str2 second string
--- @return str1 .. " " .. str2, or str2 if str1 is nil
+-- @param str2 second string, can be nil
+-- @return str1 .. " " .. str2, or str2 if str1 is nil or str1 if str2 is nil
 
 function concat (str1, str2)
-	if str1 == nil or string.len(str1) == 0 then
+	if str1 == nil or #str1 == 0 then
 		return str2
+	elseif str2 == nil or #str2 == 0 then
+		return str1
 	else
 		return str1 .. " " .. str2
 	end
@@ -69,7 +71,7 @@
 
 function split(delim, text)
 	local list = {}
-	if string.len(text) > 0 then
+	if #text > 0 then
 		delim = delim or ""
 		local pos = 1
 		-- if delim matches empty string then it would give an endless loop
@@ -123,7 +125,7 @@
 	i2 = i2 or 0
 	assert(i1 < w and i2 < w, "the indents must be less than the line width")
 	s = string.rep(" ", i1) .. s
-	local lstart, len = 1, string.len(s)
+	local lstart, len = 1, #s
 	while len - lstart > w do
 		local i = lstart + w
 		while i > lstart and string.sub(s, i, i) ~= " " do i = i - 1 end
diff -urN luadoc-3.0.1_orig/src/luadoc.lua.in luadoc-3.0.1/src/luadoc.lua.in
--- luadoc-3.0.1_orig/src/luadoc.lua.in	2008-02-17 07:42:51.000000000 +0100
+++ luadoc-3.0.1/src/luadoc.lua.in	2011-01-04 13:20:30.002254000 +0100
@@ -28,6 +28,8 @@
       --noindexpage            do not generate global index page
       --nofiles                do not generate documentation for files
       --nomodules              do not generate documentation for modules
+      --locals                 also generate documentation for local functions
+      --internals              also generate documentation for internal functions
       --doclet doclet_module   doclet module to generate output
       --taglet taglet_module   taglet module to parse input code
   -q, --quiet                  suppress all normal output
