| [comment encoding = UTF-8 /] |
| [module generateToc('http://www.eclipse.org/intent/intentdocument/0.7','http://www.eclipse.org/intent/markup/0.7', 'http://www.eclipse.org/intent/modelingunit/0.7','http://www.eclipse.org/intent/markup/generator/0.7')] |
| [import org::eclipse::mylyn::docs::intent::markup::gen::files::html/] |
| [import org::eclipse::mylyn::docs::intent::markup::gen::files::htmlGenDocument/] |
| [import org::eclipse::mylyn::docs::intent::exporter::queries::documentQueries /] |
| |
| [template public generateTOC(intentDocument : IntentDocument)] |
| <div id="table_of_content" class="sidebar-nav toc"> |
| <div class="summary"> |
| <h3 class="summaryTitle">Table Of Contents</h3> |
| <div id="toc" class="demo" style="height:100px;"> |
| <ul id="menu" > |
| [for (chapter : IntentChapter | intentDocument.chapters)] |
| [chapter.generateToc(indexInContainer(chapter))/] |
| [/for] |
| </ul> |
| </div> |
| </div> |
| </div> |
| [/template] |
| |
| [template public generateToc (subSectionContainer : IntentSubSectionContainer, index : String) ] |
| <li id="toc_[index/]"> |
| <a href="#" onClick="javascript:window.location = '#[index/]';"> |
| [generateSubSectionTitle(subSectionContainer, true)/] |
| </a> |
| <ul> |
| [for (subSection : IntentSection | subSectionContainer.intentContent->filter(IntentSection))] |
| [subSection.generateToc(index + '_' + indexInContainer(subSection.oclAsType(IntentSection)))/] |
| [/for] |
| </ul> |
| </li> |
| [/template] |
| |
| [template public generateSubSectionTitle(subSectionContainer : IntentSubSectionContainer, showUntitled : Boolean)] |
| [if subSectionContainer.title.oclIsUndefined()._not() and subSectionContainer.title.content->size() > 0] |
| [subSectionContainer.title.content.toHTML()/] |
| [else] |
| [if showUntitled] |
| Untitled |
| [else] |
| [/if] |
| [/if] |
| [/template] |