From e677dc11219f2fe9f28063c2f04659185bf44c74 Mon Sep 17 00:00:00 2001 From: eruber Date: Fri, 6 Jul 2018 15:20:54 -0700 Subject: [PATCH 01/10] Fixed Issue 301 --- ldoc/html.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ldoc/html.lua b/ldoc/html.lua index d1eb8885..41cc3208 100644 --- a/ldoc/html.lua +++ b/ldoc/html.lua @@ -152,7 +152,7 @@ function html.generate_output(ldoc, args, project) end return base..name..'.html' end - + function ldoc.include_file (file) local text,e = utils.readfile(file) if not text then quit("unable to include "..file) @@ -161,14 +161,16 @@ function html.generate_output(ldoc, args, project) end end --- these references are never from the index...? -function ldoc.source_ref (fun) + -- these references are never from the index...? + function ldoc.source_ref (fun) local modname = fun.module.name + local path, ext + path, ext = tools.split_dotted_name(fun.module.file.filename) local pack,name = tools.split_dotted_name(modname) if not pack then name = modname end - return (ldoc.single and "" or "../").."source/"..name..'.lua.html#'..fun.lineno + return (ldoc.single and "" or "../").."source/"..name..'.'..ext..'.html#'..fun.lineno end function ldoc.use_li(ls) @@ -212,7 +214,7 @@ function ldoc.source_ref (fun) function ldoc.is_list (t) return type(t) == 'table' and t.append end - + function ldoc.strip_header (s) if not s then return s end return s:gsub('^%s*#+%s+','') From a7b6a58cff09700d7e12a616d99882827fb094bf Mon Sep 17 00:00:00 2001 From: eruber Date: Sat, 7 Jul 2018 16:06:05 -0700 Subject: [PATCH 02/10] Added tags @note, @curator, @contributor --- ldoc/doc.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ldoc/doc.lua b/ldoc/doc.lua index 97e1ff42..225f8cfa 100644 --- a/ldoc/doc.lua +++ b/ldoc/doc.lua @@ -24,9 +24,9 @@ local TAG_MULTI,TAG_ID,TAG_SINGLE,TAG_TYPE,TAG_FLAG,TAG_MULTI_LINE = 'M','id','S -- - 'T' tags which represent a type, like 'function' (TAG_TYPE) local known_tags = { param = 'M', see = 'M', comment = 'M', usage = 'ML', ['return'] = 'M', field = 'M', author='M',set='M'; - class = 'id', name = 'id', pragma = 'id', alias = 'id', + class = 'id', name = 'id', pragma = 'id', alias = 'id', curator='M', contributor='M', copyright = 'S', summary = 'S', description = 'S', release = 'S', license = 'S', - fixme = 'S', todo = 'S', warning = 'S', raise = 'S', charset = 'S', within = 'S', + fixme = 'S', todo = 'S', warning = 'S', note = 'S', raise = 'S', charset = 'S', within = 'S', ['local'] = 'N', export = 'N', private = 'N', constructor = 'N', static = 'N',include = 'S', -- project-level module = 'T', script = 'T', example = 'T', topic = 'T', submodule='T', classmod='T', file='T', @@ -57,7 +57,7 @@ known_tags._presentation_names = { } known_tags._module_info = { - 'copyright','release','license','author' + 'copyright','release','license','author', 'curator', 'contributor' } local see_reference_handlers = {} @@ -126,7 +126,7 @@ end -- annotation tags can appear anywhere in the code and may contain any of these tags: known_tags._annotation_tags = { - fixme = true, todo = true, warning = true + fixme = true, todo = true, warning = true, note = true } local acount = 1 From 67428b5ca97bdd0ce2129234a790c56448428955 Mon Sep 17 00:00:00 2001 From: eruber Date: Sat, 7 Jul 2018 16:26:31 -0700 Subject: [PATCH 03/10] Removed tags @note, @curator, @contributor this can be aliases in config file, well at least the last two can be --- ldoc/doc.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ldoc/doc.lua b/ldoc/doc.lua index 225f8cfa..97e1ff42 100644 --- a/ldoc/doc.lua +++ b/ldoc/doc.lua @@ -24,9 +24,9 @@ local TAG_MULTI,TAG_ID,TAG_SINGLE,TAG_TYPE,TAG_FLAG,TAG_MULTI_LINE = 'M','id','S -- - 'T' tags which represent a type, like 'function' (TAG_TYPE) local known_tags = { param = 'M', see = 'M', comment = 'M', usage = 'ML', ['return'] = 'M', field = 'M', author='M',set='M'; - class = 'id', name = 'id', pragma = 'id', alias = 'id', curator='M', contributor='M', + class = 'id', name = 'id', pragma = 'id', alias = 'id', copyright = 'S', summary = 'S', description = 'S', release = 'S', license = 'S', - fixme = 'S', todo = 'S', warning = 'S', note = 'S', raise = 'S', charset = 'S', within = 'S', + fixme = 'S', todo = 'S', warning = 'S', raise = 'S', charset = 'S', within = 'S', ['local'] = 'N', export = 'N', private = 'N', constructor = 'N', static = 'N',include = 'S', -- project-level module = 'T', script = 'T', example = 'T', topic = 'T', submodule='T', classmod='T', file='T', @@ -57,7 +57,7 @@ known_tags._presentation_names = { } known_tags._module_info = { - 'copyright','release','license','author', 'curator', 'contributor' + 'copyright','release','license','author' } local see_reference_handlers = {} @@ -126,7 +126,7 @@ end -- annotation tags can appear anywhere in the code and may contain any of these tags: known_tags._annotation_tags = { - fixme = true, todo = true, warning = true, note = true + fixme = true, todo = true, warning = true } local acount = 1 From 9365b7d525fd2f4b89c5f87380cc33ec813cbac0 Mon Sep 17 00:00:00 2001 From: eruber Date: Sat, 7 Jul 2018 16:32:51 -0700 Subject: [PATCH 04/10] Added tags @curator and @contributor to be handled just like the @author tag --- ldoc/doc.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ldoc/doc.lua b/ldoc/doc.lua index 97e1ff42..09a04dce 100644 --- a/ldoc/doc.lua +++ b/ldoc/doc.lua @@ -23,7 +23,7 @@ local TAG_MULTI,TAG_ID,TAG_SINGLE,TAG_TYPE,TAG_FLAG,TAG_MULTI_LINE = 'M','id','S -- - 'N' tags which have no associated value, like 'local` (TAG_FLAG) -- - 'T' tags which represent a type, like 'function' (TAG_TYPE) local known_tags = { - param = 'M', see = 'M', comment = 'M', usage = 'ML', ['return'] = 'M', field = 'M', author='M',set='M'; + param = 'M', see = 'M', comment = 'M', usage = 'ML', ['return'] = 'M', field = 'M', author='M', curator='M', contributor='M', set='M'; class = 'id', name = 'id', pragma = 'id', alias = 'id', copyright = 'S', summary = 'S', description = 'S', release = 'S', license = 'S', fixme = 'S', todo = 'S', warning = 'S', raise = 'S', charset = 'S', within = 'S', @@ -57,7 +57,7 @@ known_tags._presentation_names = { } known_tags._module_info = { - 'copyright','release','license','author' + 'copyright','release','license','author', 'curator', 'contributor' } local see_reference_handlers = {} From 959e89feed1a4366637edd82b7e39be1075899b1 Mon Sep 17 00:00:00 2001 From: eruber Date: Sat, 7 Jul 2018 18:18:30 -0700 Subject: [PATCH 05/10] Changed Version to indicate development build --- ldoc.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ldoc.lua b/ldoc.lua index 4cb99663..da50f21b 100644 --- a/ldoc.lua +++ b/ldoc.lua @@ -30,7 +30,7 @@ utils.unpack = utils.unpack or unpack or table.unpack local append = table.insert local lapp = require 'pl.lapp' -local version = '1.4.6' +local version = '1.4.6-u_dev' -- so we can find our private modules app.require_here() From a5d0086e636877d2b4488cdb6f57c9bffe7af79f Mon Sep 17 00:00:00 2001 From: eruber Date: Sat, 7 Jul 2018 18:19:24 -0700 Subject: [PATCH 06/10] Changed footer to reference forked repo --- ldoc/html/ldoc_ltp.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ldoc/html/ldoc_ltp.lua b/ldoc/html/ldoc_ltp.lua index 4827e619..9371350a 100644 --- a/ldoc/html/ldoc_ltp.lua +++ b/ldoc/html/ldoc_ltp.lua @@ -306,7 +306,7 @@ return [==[
-generated by LDoc $(ldoc.version) +generated by LDoc $(ldoc.version) Last updated $(ldoc.updatetime)
From 6364979dd2a76c4aa9bf7d5f27f7af442ea9c382 Mon Sep 17 00:00:00 2001 From: eruber Date: Sat, 7 Jul 2018 21:27:16 -0700 Subject: [PATCH 07/10] Explained contents of this fork --- readme.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/readme.md b/readme.md index 35e9c2b5..32201fcf 100644 --- a/readme.md +++ b/readme.md @@ -2,6 +2,13 @@ Copyright (C) 2011-2012 Steve Donovan. +## Fork of Steve Donovan's LDoc that fixes issue 301 and adds the following tags: + +- **@contributor** Someone's Name +- **@curator** SomeOne's Name + +Both of the above tags are processed similar to the **@author** tag + ## Rationale This project grew out of the documentation needs of From 11482d75dee46f42cf6eaf8fc97df6e329f9922e Mon Sep 17 00:00:00 2001 From: eruber Date: Sat, 7 Jul 2018 23:21:36 -0700 Subject: [PATCH 08/10] Increased content width by 100 to 800px --- ldoc/html/ldoc_css.lua | 2 +- ldoc/html/ldoc_fixed_css.lua | 2 +- ldoc/html/ldoc_pale_css.lua | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ldoc/html/ldoc_css.lua b/ldoc/html/ldoc_css.lua index 1be506f6..324c3b8c 100644 --- a/ldoc/html/ldoc_css.lua +++ b/ldoc/html/ldoc_css.lua @@ -125,7 +125,7 @@ table.index td { text-align: left; vertical-align: top; } #content { margin-left: 14em; padding: 1em; - width: 700px; + width: 800px; border-left: 2px solid #cccccc; border-right: 2px solid #cccccc; background-color: #ffffff; diff --git a/ldoc/html/ldoc_fixed_css.lua b/ldoc/html/ldoc_fixed_css.lua index 98187c79..a87e0d35 100644 --- a/ldoc/html/ldoc_fixed_css.lua +++ b/ldoc/html/ldoc_fixed_css.lua @@ -132,7 +132,7 @@ table.index td { text-align: left; vertical-align: top; } margin-left: 14em; padding: 1em; padding-left: 2em; - width: 700px; + width: 800px; border-left: 2px solid #cccccc; // border-right: 2px solid #cccccc; background-color: #ffffff; diff --git a/ldoc/html/ldoc_pale_css.lua b/ldoc/html/ldoc_pale_css.lua index ffc91a28..56452fd7 100644 --- a/ldoc/html/ldoc_pale_css.lua +++ b/ldoc/html/ldoc_pale_css.lua @@ -126,7 +126,7 @@ table.index td { text-align: left; vertical-align: top; } #content { margin-left: 14em; padding: 1em; - width: 700px; + width: 800px; border-left: 2px solid #cccccc; // border-right: 2px solid #cccccc; background-color: #ffffff; From 6d5f23ae62ad14bb689468490981031bd89b2b37 Mon Sep 17 00:00:00 2001 From: eruber Date: Sun, 8 Jul 2018 09:23:16 -0700 Subject: [PATCH 09/10] Fixed order of single and double quotes in trailing_warning message --- ldoc/doc.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ldoc/doc.lua b/ldoc/doc.lua index 09a04dce..75920b57 100644 --- a/ldoc/doc.lua +++ b/ldoc/doc.lua @@ -458,7 +458,7 @@ end function Item:trailing_warning (kind,tag,rest) if type(rest)=='string' and #rest > 0 then - Item.warning(self,kind.." tag: '"..tag..'" has trailing text ; use not_luadoc=true if you want description to continue between tags\n"'..rest..'"') + Item.warning(self,kind.." tag: '"..tag.."' has trailing text ; use not_luadoc=true if you want description to continue between tags\n'"..rest.."'") end end From 91e9df1f1cbe9d23b75e03ec6b3dd588ad94cfa3 Mon Sep 17 00:00:00 2001 From: eruber Date: Mon, 20 Aug 2018 12:42:06 -0700 Subject: [PATCH 10/10] version number bump plus documented changes --- changes.md | 10 ++++++++++ ldoc.lua | 1 + 2 files changed, 11 insertions(+) diff --git a/changes.md b/changes.md index a96b72c5..de3a8f82 100644 --- a/changes.md +++ b/changes.md @@ -1,3 +1,13 @@ +## Version 1.4.6-u_dev +This version is a fork of Steve Donovan's LDoc that: + +- Fixes [issue 301](https://github.com/stevedonovan/LDoc/issues/301 "Source code links wiht add_language_extension() are incorrect.") +- Adds the following tags: + - **@contributor** Someone's Name + - **@curator** SomeOne's Name + +Both of the above tags are processed similar to the **@author** tag + ## Version 1.4.4 ### Features diff --git a/ldoc.lua b/ldoc.lua index da50f21b..ec3e0247 100644 --- a/ldoc.lua +++ b/ldoc.lua @@ -571,6 +571,7 @@ if ldoc.prettify_files then local files = List() local linemap = {} for F in file_list:iter() do + print("Pretty Print file: ", F.filename) files:append(F.filename) local mod = F.modules[1] local ls = List()