summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Aubry2012-07-02 05:53:41 (EDT)
committer sbernard2012-07-02 05:53:41 (EDT)
commita14d5303edc63353373af1e9c30538641f811232 (patch)
treef43af123749f448e1130d3fa4b5f394a9752877b
parentf21c2c3e3c05fe25df36b23c623288de9782eb91 (diff)
downloadorg.eclipse.koneki.ldt-a14d5303edc63353373af1e9c30538641f811232.zip
org.eclipse.koneki.ldt-a14d5303edc63353373af1e9c30538641f811232.tar.gz
org.eclipse.koneki.ldt-a14d5303edc63353373af1e9c30538641f811232.tar.bz2
Bug 383650 : [luadocumentor] The HTML result contains useless tags
-rw-r--r--libraries/doctemplates/template/file.lua4
-rw-r--r--libraries/doctemplates/template/item.lua25
-rw-r--r--libraries/doctemplates/template/recordtypedef.lua4
3 files changed, 17 insertions, 16 deletions
diff --git a/libraries/doctemplates/template/file.lua b/libraries/doctemplates/template/file.lua
index 0a87b21..2c33482 100644
--- a/libraries/doctemplates/template/file.lua
+++ b/libraries/doctemplates/template/file.lua
@@ -23,7 +23,7 @@ return[[#
# if _file.shortdescription then
$( format(_file.shortdescription) )
# end
-# if _file.description then
+# if _file.description and #_file.description > 0 then
<br/>$( format(_file.description) )
# end
# --
@@ -110,4 +110,4 @@ return[[#
# end
# end
</div>
-]] \ No newline at end of file
+]]
diff --git a/libraries/doctemplates/template/item.lua b/libraries/doctemplates/template/item.lua
index 87833ba..54ad5e9 100644
--- a/libraries/doctemplates/template/item.lua
+++ b/libraries/doctemplates/template/item.lua
@@ -43,7 +43,7 @@ return
# if _item.shortdescription then
$( format(_item.shortdescription) )
# end
-# if _item.description then
+# if _item.description and #_item.description > 0 then
<br/>$( format(_item.description) )
# end
#
@@ -71,12 +71,7 @@ return
# for position, param in ipairs( fdef.params ) do
# if not (position == 1 and param.name == 'self') then
<li>
- <code><em>
- $(param.name) $(param.optional and 'optional') $(param.hidden and 'hidden')
- </em></code>:
-# if param.description then
- $( format(param.description) )
-# end
+ <code><em>$(param.name) $(param.optional and 'optional') $(param.hidden and 'hidden')</em></code>: $( format(param.description) )
</li>
# end
# end
@@ -107,7 +102,7 @@ return
<ol>
# for position, ret in ipairs(fdef.returns) do
<li>
-# if #ret.types > 0 then
+# if #ret.types > 0 and #niceparmlist(ret.types) > 0 then
<em>$( niceparmlist(ret.types) )</em>
# end
$(ret.description and format(ret.description))
@@ -115,15 +110,21 @@ return
# end
</ol>
# else
- <p>
+# local isreturn = fdef.returns and #fdef.returns > 0 and #niceparmlist(fdef.returns[1].types) > 0
+# local isdescription = fdef.returns and fdef.returns[1].description and #format(fdef.returns[1].description) > 0
+# if isreturn or isdescription then
+ <p>
+# end
# -- Show return type if provided
-# if fdef.returns and #fdef.returns > 0 then
+# if isreturn then
<em>$( niceparmlist(fdef.returns[1].types) )</em>
# end
-# if fdef.returns[1].description then
+# if isdescription then
$( format(fdef.returns[1].description) )
# end
- </p>
+# if isreturn or isdescription then
+ </p>
+# end
# end
# end
#end
diff --git a/libraries/doctemplates/template/recordtypedef.lua b/libraries/doctemplates/template/recordtypedef.lua
index f58a3b1..24ad3aa 100644
--- a/libraries/doctemplates/template/recordtypedef.lua
+++ b/libraries/doctemplates/template/recordtypedef.lua
@@ -14,10 +14,10 @@ return [[#
# --
# -- Descriptions
# --
-#if _recordtypedef.shortdescription then
+#if _recordtypedef.shortdescription and #_recordtypedef.shortdescription > 0 then
<p>$( format( _recordtypedef.shortdescription ) )</p>
#end
-#if _recordtypedef.description then
+#if _recordtypedef.description and #_recordtypedef.description > 0 then
<p>$( format( _recordtypedef.description ) )</p>
#end
#--