Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Issue 301 #302

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
10 changes: 10 additions & 0 deletions changes.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 2 additions & 1 deletion ldoc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down
6 changes: 3 additions & 3 deletions ldoc/doc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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 = {}
Expand Down Expand Up @@ -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

Expand Down
12 changes: 7 additions & 5 deletions ldoc/html.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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+','')
Expand Down
2 changes: 1 addition & 1 deletion ldoc/html/ldoc_css.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion ldoc/html/ldoc_fixed_css.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion ldoc/html/ldoc_ltp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ return [==[
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc $(ldoc.version)</a></i>
<i>generated by <a href="https://github.com/eruber/LDoc">LDoc $(ldoc.version)</a></i>
<i style="float:right;">Last updated $(ldoc.updatetime) </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
Expand Down
2 changes: 1 addition & 1 deletion ldoc/html/ldoc_pale_css.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 7 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before we consider merging this, you should remove anything that suggests this is a fork. We're merging to the bonefied original here ;-)


- **@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
Expand Down