-
Notifications
You must be signed in to change notification settings - Fork 173
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
Updated ldoc_ltp.lua #317
base: master
Are you sure you want to change the base?
Updated ldoc_ltp.lua #317
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
return [==[ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | ||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
<html> | ||
<meta http-equiv="Content-Type" content="text/html; charset=$(ldoc.doc_charset)"/> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=$(ldoc.doc_charset)"/> | ||
<title>$(ldoc.title)</title> | ||
<link rel="stylesheet" href="$(ldoc.css)" type="text/css" /> | ||
# if ldoc.custom_css then -- add custom CSS file if configured. | ||
|
@@ -68,7 +68,7 @@ return [==[ | |
# for kind, mods, type in ldoc.kinds() do | ||
# if ldoc.allowed_in_contents(type,module) then | ||
<h2>$(kind)</h2> | ||
<ul class="$(kind=='Topics' and '' or 'nowrap')"> | ||
<ul class="$(kind=='Topics' and '' or nowrap)"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks incorrect. Are you sure you checked how the Lua string vs. variable parsing is being done here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, this seems to be wrong. |
||
# for mod in mods() do local name = display_name(mod) | ||
# if mod.name == this_mod then | ||
<li><strong>$(name)</strong></li> | ||
|
@@ -128,7 +128,7 @@ return [==[ | |
<table class="function_list"> | ||
# for item in items() do | ||
<tr> | ||
<td class="name" $(nowrap)><a href="#$(item.name)">$(display_name(item))</a></td> | ||
<td class="name $(nowrap)"><a href="#$(item.name)">$(display_name(item))</a></td> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. Should be removed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is a css-file in the project, as "nowrap" as an attribute is deprecated. It is not even part of html 5. I should have clarified that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Thanks for the clarification. |
||
<td class="summary">$(M(item.summary,item))</td> | ||
</tr> | ||
# end -- for items | ||
|
@@ -182,8 +182,8 @@ return [==[ | |
# for value in iter(tag) do | ||
$(li)$(custom.format and custom.format(value) or M(value))$(il) | ||
# end -- for | ||
</ul "@todo"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure where the @todo comes from. I should have read through the file once more. |
||
# end -- if tag | ||
</ul> | ||
# end -- iter tags | ||
# end | ||
|
||
|
@@ -217,7 +217,8 @@ return [==[ | |
</li> | ||
# end | ||
# if sublist then | ||
</li></ul> | ||
</ul> | ||
</li> | ||
# end | ||
# end -- for | ||
</ul> | ||
|
@@ -226,7 +227,9 @@ return [==[ | |
# if show_return and item.retgroups then local groups = item.retgroups | ||
<h3>Returns:</h3> | ||
# for i,group in ldoc.ipairs(groups) do local li,il = use_li(group) | ||
# if #group > 1 then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The nesting of these if loops should be reversed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That is outside the scope. This was only to get the generated html pass a linter. |
||
<ol> | ||
# end | ||
# for r in group:iter() do local type, ctypes = item:return_type(r); local rt = ldoc.typename(type) | ||
$(li) | ||
# if rt ~= '' then | ||
|
@@ -243,7 +246,9 @@ return [==[ | |
</ul> | ||
# end -- if ctypes | ||
# end -- for r | ||
# if #group > 1 then | ||
</ol> | ||
# end | ||
# if i < #groups then | ||
<h3>Or</h3> | ||
# end | ||
|
@@ -295,7 +300,7 @@ return [==[ | |
<table class="module_list"> | ||
# for m in mods() do | ||
<tr> | ||
<td class="name" $(nowrap)><a href="$(no_spaces(kind))/$(m.name).html">$(m.name)</a></td> | ||
<td class="name $(nowrap)"><a href="$(no_spaces(kind))/$(m.name).html">$(m.name)</a></td> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this really a CSS class or an HTML property string? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In that case, this bit of patch is wrong and should be dropped. @jeblad are you still around? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nowrap is not part of html 5. The class was pretty simple as I recall it .nowrap {
white-space: nowrap;
} |
||
<td class="summary">$(M(ldoc.strip_header(m.summary),m))</td> | ||
</tr> | ||
# end -- for modules | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than switching from HTML 4 to XHTML I'd rather just skip straight to HTML5 and drop the doctype shenanigans.