Updated ldoc_ltp.lua#317
Conversation
Various fixes to make the template generate valid xhtml.
|
This is my template as-is, without any other changes. I have not run any tests. |
alerque
left a comment
There was a problem hiding this comment.
Thanks for taking the time to contribute! In most cases I see what you were fixing here, but there are a couple I couldn't make sense of and a few tweaks I think should be made. Are you around and in a position to tweak this PR so we can get it merged?
| "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"> |
There was a problem hiding this comment.
Rather than switching from HTML 4 to XHTML I'd rather just skip straight to HTML5 and drop the doctype shenanigans.
| # 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.
This looks incorrect. Are you sure you checked how the Lua string vs. variable parsing is being done here?
| # 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.
Not sure where the @todo comes from. I should have read through the file once more.
| # 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.
The nesting of these if loops should be reversed.
There was a problem hiding this comment.
That is outside the scope. This was only to get the generated html pass a linter.
| # 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.
Is this really a CSS class or an HTML property string?
There was a problem hiding this comment.
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.
nowrap is not part of html 5.
The class was pretty simple as I recall it
.nowrap {
white-space: nowrap;
}| # 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.
Same here. Should be removed.
There was a problem hiding this comment.
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.
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.
Thanks for the clarification.
|
Seemed to have no progress, so I deleted the original repo. Sorry for that. I'll add some comments. Just fix the file as you see appropriate, never mind merging the pull request. |
Various fixes to make the template generate valid xhtml.