Skip to content

Commit

Permalink
Moved creation of inline class documentation to separate template file
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimitri van Heesch committed Aug 30, 2015
1 parent abe254f commit 4bd50c9
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 215 deletions.
8 changes: 7 additions & 1 deletion src/context.cpp
Expand Up @@ -1739,6 +1739,7 @@ class ClassContext::Private : public DefinitionContext<ClassContext::Private>
addProperty("allMembersFileName", this,&Private::allMembersFileName);
addProperty("memberGroups", this,&Private::memberGroups);
addProperty("additionalInheritedMembers",this,&Private::additionalInheritedMembers);
addProperty("isSimple", this,&Private::isSimple);
}
virtual ~Private() {}
TemplateVariant title() const
Expand Down Expand Up @@ -2362,6 +2363,10 @@ class ClassContext::Private : public DefinitionContext<ClassContext::Private>
}
return m_cache.additionalInheritedMembers.get();
}
TemplateVariant isSimple() const
{
return m_classDef->isSimple();
}

private:
ClassDef *m_classDef;
Expand Down Expand Up @@ -5192,7 +5197,8 @@ class ClassListContext::Private : public GenericNodeListContext
{
continue;
}
if (cd->isLinkableInProject() && cd->templateMaster()==0)
if (cd->isLinkableInProject() && cd->templateMaster()==0 &&
!cd->isHidden() && !cd->isEmbeddedInOuterScope())
{
append(ClassContext::alloc(cd));
}
Expand Down
7 changes: 3 additions & 4 deletions templates/html/htmlclass.tpl
Expand Up @@ -180,7 +180,6 @@
</div>
{% endif %}
{# memberdecls #}
{# TODO: isSimple #}
{# nestedClasses #}
{% with list=compound.classes label='nested-classes' title=tr.classes local=1 %}
{% include 'htmldeclcomp.tpl' %}
Expand Down Expand Up @@ -379,9 +378,9 @@
{% endif %}
{# member definitions #}
{# inline classes #}
{% if compound.classes %}
{# TODO write inlined simple classes: tr.classDocumentation / tr.typeDocumentation #}
{% endif %}
{% with classList=compound.classes %}
{% include 'htmlinlineclasses.tpl' %}
{% endwith %}
{# typedefs #}
{% with memberListInfo=compound.detailedTypedefs %}
{% include 'htmlmemdef.tpl' %}
Expand Down
73 changes: 3 additions & 70 deletions templates/html/htmlfile.tpl
Expand Up @@ -160,76 +160,9 @@
{% endif %}
{# member definitions #}
{# inline classes #}
{% if compound.inlineClasses %}
<h2 class="groupheader">{{ tr.classDocumentation }}</h2>
{% for class in compound.inlineClasses %}
{# write anchor #}
<a class="anchor" id="{{ class.anchor }}"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr><td class="memname">{{ class.compoundType }} {{ class.name }}</td></tr>
</table>
</div>
<div class="memdoc">
<div class="textblock">
{# TODO: the stuff inside textblock can be the same as in htmlclass.tpl!! #}
{# template specifier #}
{% if class.language=='cpp' and class.templateDecls %}
<h3>{% spaceless %}
{% for targList in class.templateDecls %}
template&lt;
{% for targ in targList %}
{{ targ.type }}{% if targ.name %} {{ targ.name }}{% endif %}{% if targ.defVal %}&#160;= {{ targ.defVal }}{% endif %}{% if not forloop.last %}, {% endif %}
{% endfor %}
&gt;<br/>
{% endfor %}
{% endspaceless %}
{{ class.classType }}&#160;{{ class.name }}
</h3>
{% endif %}
{# brief description #}
{% if class.brief and config.REPEAT_BRIEF %}
<p>{{ class.brief }}</p>
{% endif %}
{# detailed docs #}
{{ class.details }}
{# source def #}
{% if class.sourceDef %}
{% markers obj in class.sourceDef with tr.definedAtLineInSourceFile %}
{% with text=obj.text %}
{% include 'htmlobjlink.tpl' %}
{% endwith %}
{% endmarkers %}
{% endif %}
</div><!-- textblock -->
{# table with fields #}
<table class="fieldtable">
<tr><th colspan="3">{{ tr.compoundMembers }}</td></tr>
{% for member in class.members %}
<tr><td class="fieldtype">
<a class="anchor" id="{{ member.anchor }}"></a>{{ member.fieldType }}
</td>
<td class="fieldname">
{{ member.name }}
{% if member.isVariable and member.declArgs %}{{ member.declArgs }}{% endif %}
{{ member.bitfields }}
</td>
<td class="fielddoc">
{% if member.brief and not member.details %}{# only brief #}
{{ member.brief }}
{% else %} {# only details or both #}
{% if member.brief %}<p>{{ member.brief }}</p>{% endif %}
{{ member.details }}
{% endif %}
</td>
</tr>
{% endfor %}
</table>
</div><!-- memdoc -->
</div><!-- memitem -->
{% endfor %}
{% endif %}
{% with classList=compound.inlineClasses %}
{% include 'htmlinlineclasses.tpl' %}
{% endwith %}
{# defines #}
{% with memberListInfo=compound.detailedMacros %}
{% include 'htmlmemdef.tpl' %}
Expand Down
70 changes: 70 additions & 0 deletions templates/html/htmlinlineclasses.tpl
@@ -0,0 +1,70 @@
{# input: classList #}
{% if classList %}
<h2 class="groupheader">{{ tr.classDocumentation }}</h2>
{% for class in classList %}
{# write anchor #}
<a class="anchor" id="{{ class.anchor }}"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr><td class="memname">{{ class.compoundType }} {{ class.name }}</td></tr>
</table>
</div>
<div class="memdoc">
<div class="textblock">
{# template specifier #}
{% if class.language=='cpp' and class.templateDecls %}
<h3>{% spaceless %}
{% for targList in class.templateDecls %}
template&lt;
{% for targ in targList %}
{{ targ.type }}{% if targ.name %} {{ targ.name }}{% endif %}{% if targ.defVal %}&#160;= {{ targ.defVal }}{% endif %}{% if not forloop.last %}, {% endif %}
{% endfor %}
&gt;<br/>
{% endfor %}
{% endspaceless %}
{{ class.classType }}&#160;{{ class.name }}
</h3>
{% endif %}
{# brief description #}
{% if class.brief and config.REPEAT_BRIEF %}
<p>{{ class.brief }}</p>
{% endif %}
{# detailed docs #}
{{ class.details }}
{# source def #}
{% if class.sourceDef %}
{% markers obj in class.sourceDef with tr.definedAtLineInSourceFile %}
{% with text=obj.text %}
{% include 'htmlobjlink.tpl' %}
{% endwith %}
{% endmarkers %}
{% endif %}
</div><!-- textblock -->
{# table with fields #}
<table class="fieldtable">
<tr><th colspan="3">{{ tr.compoundMembers }}</th></tr>
{% for member in class.members %}
<tr><td class="fieldtype">
<a class="anchor" id="{{ member.anchor }}"></a>{{ member.fieldType }}
</td>
<td class="fieldname">
{{ member.name }}
{% if member.isVariable and member.declArgs %}{{ member.declArgs }}{% endif %}
{{ member.bitfields }}
</td>
<td class="fielddoc">
{% if member.brief and not member.details %}{# only brief #}
{{ member.brief }}
{% else %} {# only details or both #}
{% if member.brief %}<p>{{ member.brief }}</p>{% endif %}
{{ member.details }}
{% endif %}
</td>
</tr>
{% endfor %}
</table>
</div><!-- memdoc -->
</div><!-- memitem -->
{% endfor %}
{% endif %}
73 changes: 3 additions & 70 deletions templates/html/htmlmodule.tpl
Expand Up @@ -214,76 +214,9 @@
{% endif %}
{# member definitions #}
{# inline classes #}
{% if compound.inlineClasses %}
<h2 class="groupheader">{{ tr.classDocumentation }}</h2>
{% for class in compound.inlineClasses %}
{# write anchor #}
<a class="anchor" id="{{ class.anchor }}"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr><td class="memname">{{ class.compoundType }} {{ class.name }}</td></tr>
</table>
</div>
<div class="memdoc">
<div class="textblock">
{# TODO: the stuff inside textblock can be the same as in htmlclass.tpl!! #}
{# template specifier #}
{% if class.language=='cpp' and class.templateDecls %}
<h3>{% spaceless %}
{% for targList in class.templateDecls %}
template&lt;
{% for targ in targList %}
{{ targ.type }}{% if targ.name %} {{ targ.name }}{% endif %}{% if targ.defVal %}&#160;= {{ targ.defVal }}{% endif %}{% if not forloop.last %}, {% endif %}
{% endfor %}
&gt;<br/>
{% endfor %}
{% endspaceless %}
{{ class.classType }}&#160;{{ class.name }}
</h3>
{% endif %}
{# brief description #}
{% if class.brief and config.REPEAT_BRIEF %}
<p>{{ class.brief }}</p>
{% endif %}
{# detailed docs #}
{{ class.details }}
{# source def #}
{% if class.sourceDef %}
{% markers obj in class.sourceDef with tr.definedAtLineInSourceFile %}
{% with text=obj.text %}
{% include 'htmlobjlink.tpl' %}
{% endwith %}
{% endmarkers %}
{% endif %}
</div><!-- textblock -->
{# table with fields #}
<table class="fieldtable">
<tr><th colspan="3">{{ tr.compoundMembers }}</td></tr>
{% for member in class.members %}
<tr><td class="fieldtype">
<a class="anchor" id="{{ member.anchor }}"></a>{{ member.fieldType }}
</td>
<td class="fieldname">
{{ member.name }}
{% if member.isVariable and member.declArgs %}{{ member.declArgs }}{% endif %}
{{ member.bitfields }}
</td>
<td class="fielddoc">
{% if member.brief and not member.details %}{# only brief #}
{{ member.brief }}
{% else %} {# only details or both #}
{% if member.brief %}<p>{{ member.brief }}</p>{% endif %}
{{ member.details }}
{% endif %}
</td>
</tr>
{% endfor %}
</table>
</div><!-- memdoc -->
</div><!-- memitem -->
{% endfor %}
{% endif %}
{% with classList=compound.inlineClasses %}
{% include 'htmlinlineclasses.tpl' %}
{% endwith %}
{# defines #}
{% with memberListInfo=compound.detailedMacros %}
{% include 'htmlmemdef.tpl' %}
Expand Down
73 changes: 3 additions & 70 deletions templates/html/htmlnamespace.tpl
Expand Up @@ -114,76 +114,9 @@
{% endif %}
{# member definitions #}
{# inline classes #}
{% if compound.inlineClasses %}
<h2 class="groupheader">{{ tr.classDocumentation }}</h2>
{% for class in compound.inlineClasses %}
{# write anchor #}
<a class="anchor" id="{{ class.anchor }}"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr><td class="memname">{{ class.compoundType }} {{ class.name }}</td></tr>
</table>
</div>
<div class="memdoc">
<div class="textblock">
{# TODO: the stuff inside textblock can be the same as in htmlclass.tpl!! #}
{# template specifier #}
{% if class.language=='cpp' and class.templateDecls %}
<h3>{% spaceless %}
{% for targList in class.templateDecls %}
template&lt;
{% for targ in targList %}
{{ targ.type }}{% if targ.name %} {{ targ.name }}{% endif %}{% if targ.defVal %}&#160;= {{ targ.defVal }}{% endif %}{% if not forloop.last %}, {% endif %}
{% endfor %}
&gt;<br/>
{% endfor %}
{% endspaceless %}
{{ class.classType }}&#160;{{ class.name }}
</h3>
{% endif %}
{# brief description #}
{% if class.brief and config.REPEAT_BRIEF %}
<p>{{ class.brief }}</p>
{% endif %}
{# detailed docs #}
{{ class.details }}
{# source def #}
{% if class.sourceDef %}
{% markers obj in class.sourceDef with tr.definedAtLineInSourceFile %}
{% with text=obj.text %}
{% include 'htmlobjlink.tpl' %}
{% endwith %}
{% endmarkers %}
{% endif %}
</div><!-- textblock -->
{# table with fields #}
<table class="fieldtable">
<tr><th colspan="3">{{ tr.compoundMembers }}</td></tr>
{% for member in class.members %}
<tr><td class="fieldtype">
<a class="anchor" id="{{ member.anchor }}"></a>{{ member.fieldType }}
</td>
<td class="fieldname">
{{ member.name }}
{% if member.isVariable and member.declArgs %}{{ member.declArgs }}{% endif %}
{{ member.bitfields }}
</td>
<td class="fielddoc">
{% if member.brief and not member.details %}{# only brief #}
{{ member.brief }}
{% else %} {# only details or both #}
{% if member.brief %}<p>{{ member.brief }}</p>{% endif %}
{{ member.details }}
{% endif %}
</td>
</tr>
{% endfor %}
</table>
</div><!-- memdoc -->
</div><!-- memitem -->
{% endfor %}
{% endif %}
{% with classList=compound.inlineClasses %}
{% include 'htmlinlineclasses.tpl' %}
{% endwith %}
{# typedefs #}
{% with memberListInfo=compound.detailedTypedefs %}
{% include 'htmlmemdef.tpl' %}
Expand Down

0 comments on commit 4bd50c9

Please sign in to comment.