Mercurial > pub > site.implab
diff view/layout/default/library.tt @ 7:fa7a99c2d079
dox library templates and schemas
author | sergey |
---|---|
date | Wed, 14 May 2014 01:22:21 +0400 |
parents | |
children | 7d92a42f8e18 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/view/layout/default/library.tt Wed May 14 01:22:21 2014 +0400 @@ -0,0 +1,91 @@ +[% + labels( + CollectionTitle = "Home (%name%)" + ); + document.css.push(css.global); + document.css.push(css.library); + + CollectionClass = 'Benzin::Doxygen::Model::Collection'; + CompoundClass = 'Benzin::Doxygen::Model::Compound'; + MemberClass = 'Benzin::Doxygen::Model::Member'; + + Icons = { + namespace = 'NS', + class = 'C', + variable = 'Var', + function = 'F', + property = 'P', + interface = 'I', + struct = 'S', + enum = 'E', + event = 'Ev' + }; + + NullIcon = ' '; + + coll = resource.Seek('doxygenCollection'); + + compounds = coll.location.compounds; + members = resource.Seek('compound').location || coll.location.members; + + document.title = model.canonicalName; + + MACRO GetLocationFor(model) BLOCK; + members.Child(model.doxId) IF model.isa(MemberClass); + compounds.Child(model.doxId) IF model.isa(CompoundClass); + END; +%] +[% MACRO IconKind(model) BLOCK %]<span class="icon">[% Icons.item(model.kind) || NullIcon %]</span>[% END %] +[% MACRO Link(model,label,title) BLOCK %]<a class="$model.kind $model.protection" [% IF title %]title="$title" [% END %]href="[% GetLocationFor(model) %]">[% IconKind(model) %] $label</a>[% END %] +[% MACRO CompoundSiblings(model) BLOCK %] + [% compound = model.isa(MemberClass) ? model.compound : model %] + <ul class="members"> + [% FOREACH item IN compound.GetSiblings({ kind = { '-not_in' = [ 'file', 'dir' ] } }) %] + <li [% IF item.doxId == compound.doxId %]class="active"[% END %]>[% Link(item,item.shortName, item.canonicalName) %]</li> + [% END %] + </ul> +[% END %] +[% MACRO Members(model) BLOCK %] + [% compound = model.isa(MemberClass) ? model.compound : model %] + <ul class="members"> + [% FOREACH item IN compound.GetMembers({ kind = { '-not_in' = [ 'file', 'dir' ] } }) %] + <li [% IF item.doxId == model.doxId %]class="active"[% END %]>[% Link(item,item.shortName, item.canonicalName) %]</li> + [% END %] + </ul> +[% END %] +<div class="library-pane"> + + <div id="toc-nav" class="nav-pane left"> + [% IF model.isa(CollectionClass) %] + + <ul class="dox-nav-menu"> + <li class="last"><a href="$coll.location" title="$coll.model.description">[% CollectionTitle( name = coll.model.name) %]</a></li> + [% Members(model) %] + </ul> + [% ELSE %] + [% + parents = model.GetParents({ kind = { '-not_in' = [ 'file', 'dir' ] } }); + parents.push(model) IF model.isa(CompoundClass); + %] + <ul class="dox-nav-menu"> + <li [% IF !parents.size %]class="last"[% END %]><a href="$coll.location" title="$coll.model.description">[% CollectionTitle( name = coll.model.name) %]</a></li> + [% FOREACH parent IN parents %] + <li [% IF loop.last %]class="last"[% END %]>[% Link(parent, parent.shortName, parent.canonicalName) %]</li> + [% END %] + [% Members(model) %] + </ul> + [% END %] + </div> + <div id="siblings-nav" class="nav-pane right"> + [% CompoundSiblings(model) %] + </div> + <div id="content-pane" class="content-pane"> + $content + </div> + <script type="text/javascript"> + require(['implab/sticky'],function(sticky) { + sticky('toc-nav',{ along: 'content-pane' }); + sticky('siblings-nav', { along: 'content-pane' }); + }); + </script> +</div> \ No newline at end of file