assert out.param_kind in ['param', 'templateparam']
for param in i:
# This is an overcomplicated shit, so check sanity
+ # http://www.stack.nl/~dimitri/doxygen/manual/commands.html#cmdparam
assert param.tag == 'parameteritem'
assert len(param.findall('parameternamelist')) == 1
- assert param.find('parameternamelist').find('parametertype') is None
- assert len(param.find('parameternamelist').findall('parametername')) == 1
- name = param.find('parameternamelist').find('parametername')
+ # This is only for PHP, ignore for now
+ param_names = param.find('parameternamelist')
+ assert param_names.find('parametertype') is None
+
description = parse_desc(state, param.find('parameterdescription'))
- if i.attrib['kind'] == 'param':
- out.params[name.text] = (description, name.attrib['direction'] if 'direction' in name.attrib else '')
- else:
- assert i.attrib['kind'] == 'templateparam'
- out.templates[name.text] = description
+
+ # Gather all names (so e.g. `@param x, y, z` is turned into
+ # three params sharing the same description)
+ for name in param_names.findall('parametername'):
+ if i.attrib['kind'] == 'param':
+ out.params[name.text] = (description, name.attrib['direction'] if 'direction' in name.attrib else '')
+ else:
+ assert i.attrib['kind'] == 'templateparam'
+ out.templates[name.text] = description
elif i.tag == 'variablelist':
assert element.tag == 'para' # is inside a paragraph :/
*/
template<class A, class B> void bar(int a, int b);
+/**
+@brief Function with one description for all params
+@param x, y, z Coordinates in 3D space
+*/
+void thisIsAShittyWayToPassAVectorButWhatever(float x, float y, float z);
+
}
namespace Eno {
int b)</span>
</dt>
<dd>A function with scattered docs.</dd>
+ <dt>
+ <span class="m-dox-wrap-bumper">void <a href="#a1e4e8c2c75da6e24d78c8a84e0cb3226" class="m-dox">thisIsAShittyWayToPassAVectorButWhatever</a>(</span><span class="m-dox-wrap">float x,
+ float y,
+ float z)</span>
+ </dt>
+ <dd>Function with one description for all params.</dd>
</dl>
</section>
<section>
</table>
<p>This is a function that has the docs all scattered around. They should get merged and reordered.</p>
</div></section>
+ <section class="m-dox-details" id="a1e4e8c2c75da6e24d78c8a84e0cb3226"><div>
+ <h3>
+ <span class="m-dox-wrap-bumper">void Foo::<wbr /></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#a1e4e8c2c75da6e24d78c8a84e0cb3226" class="m-dox-self">thisIsAShittyWayToPassAVectorButWhatever</a>(</span><span class="m-dox-wrap">float x,
+ float y,
+ float z)</span></span>
+ </h3>
+ <p>Function with one description for all params.</p>
+ <table class="m-table m-fullwidth m-flat">
+ <thead>
+ <tr><th colspan="2">Parameters</th></tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td style="width: 1%">x</td>
+ <td>Coordinates in 3D space</td>
+ </tr>
+ <tr>
+ <td>y</td>
+ <td>Coordinates in 3D space</td>
+ </tr>
+ <tr>
+ <td>z</td>
+ <td>Coordinates in 3D space</td>
+ </tr>
+ </tbody>
+ </table>
+ </div></section>
</section>
</div>
</div>