comparison 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
comparison
equal deleted inserted replaced
6:2d1a0a75fc49 7:fa7a99c2d079
1 [%
2 labels(
3 CollectionTitle = "Home (%name%)"
4 );
5 document.css.push(css.global);
6 document.css.push(css.library);
7
8 CollectionClass = 'Benzin::Doxygen::Model::Collection';
9 CompoundClass = 'Benzin::Doxygen::Model::Compound';
10 MemberClass = 'Benzin::Doxygen::Model::Member';
11
12 Icons = {
13 namespace = 'NS',
14 class = 'C',
15 variable = 'Var',
16 function = 'F',
17 property = 'P',
18 interface = 'I',
19 struct = 'S',
20 enum = 'E',
21 event = 'Ev'
22 };
23
24 NullIcon = '  ';
25
26 coll = resource.Seek('doxygenCollection');
27
28 compounds = coll.location.compounds;
29 members = resource.Seek('compound').location || coll.location.members;
30
31 document.title = model.canonicalName;
32
33 MACRO GetLocationFor(model) BLOCK;
34 members.Child(model.doxId) IF model.isa(MemberClass);
35 compounds.Child(model.doxId) IF model.isa(CompoundClass);
36 END;
37 %]
38 [% MACRO IconKind(model) BLOCK %]<span class="icon">[% Icons.item(model.kind) || NullIcon %]</span>[% END %]
39 [% 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 %]
40 [% MACRO CompoundSiblings(model) BLOCK %]
41 [% compound = model.isa(MemberClass) ? model.compound : model %]
42 <ul class="members">
43 [% FOREACH item IN compound.GetSiblings({ kind = { '-not_in' = [ 'file', 'dir' ] } }) %]
44 <li [% IF item.doxId == compound.doxId %]class="active"[% END %]>[% Link(item,item.shortName, item.canonicalName) %]</li>
45 [% END %]
46 </ul>
47 [% END %]
48 [% MACRO Members(model) BLOCK %]
49 [% compound = model.isa(MemberClass) ? model.compound : model %]
50 <ul class="members">
51 [% FOREACH item IN compound.GetMembers({ kind = { '-not_in' = [ 'file', 'dir' ] } }) %]
52 <li [% IF item.doxId == model.doxId %]class="active"[% END %]>[% Link(item,item.shortName, item.canonicalName) %]</li>
53 [% END %]
54 </ul>
55 [% END %]
56 <div class="library-pane">
57
58 <div id="toc-nav" class="nav-pane left">
59 [% IF model.isa(CollectionClass) %]
60
61 <ul class="dox-nav-menu">
62 <li class="last"><a href="$coll.location" title="$coll.model.description">[% CollectionTitle( name = coll.model.name) %]</a></li>
63 [% Members(model) %]
64 </ul>
65 [% ELSE %]
66 [%
67 parents = model.GetParents({ kind = { '-not_in' = [ 'file', 'dir' ] } });
68 parents.push(model) IF model.isa(CompoundClass);
69 %]
70 <ul class="dox-nav-menu">
71 <li [% IF !parents.size %]class="last"[% END %]><a href="$coll.location" title="$coll.model.description">[% CollectionTitle( name = coll.model.name) %]</a></li>
72 [% FOREACH parent IN parents %]
73 <li [% IF loop.last %]class="last"[% END %]>[% Link(parent, parent.shortName, parent.canonicalName) %]</li>
74 [% END %]
75 [% Members(model) %]
76 </ul>
77 [% END %]
78 </div>
79 <div id="siblings-nav" class="nav-pane right">
80 [% CompoundSiblings(model) %]
81 </div>
82 <div id="content-pane" class="content-pane">
83 $content
84 </div>
85 <script type="text/javascript">
86 require(['implab/sticky'],function(sticky) {
87 sticky('toc-nav',{ along: 'content-pane' });
88 sticky('siblings-nav', { along: 'content-pane' });
89 });
90 </script>
91 </div>