Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate the navigation menu with the cssmenu code.
Customizes the navigation tree generation to nest properly and to add the "has-sub" CSS class instead of "tree-view" for root items.
- Loading branch information
Showing
2 changed files
with
15 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
- import ddox.entities; | ||
|
||
- void moduleNavTree(Package pack) | ||
- string pack_class = pack is info.rootPackage ? "has-sub" : "tree-view"; | ||
- foreach(i, p; pack.packages) | ||
li(class='#{!pack.parent && i == 0 && !info.node.parent || p.isAncestorOf(info.node) ? pack_class : pack_class ~ " collapsed"}') | ||
a.package(href="#")= p !is info.rootPackage ? p.name : null | ||
ul.tree-view | ||
- moduleNavTree(p); | ||
- foreach(m; pack.modules) | ||
li | ||
a.module(href="#{info.linkTo(m)}", class='#{info.node is m || m.isAncestorOf(info.node) ? "selected" : ""}')= m.name | ||
|
||
- moduleNavTree(info.rootPackage); |