# This file is part of NIT ( http://www.nitlanguage.org ). # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # HTML templates used by Nitdoc to generate API documentation # Pages are assembled using `Template` module doc_templates import template import json::static # A documentation page class TplPage super Template # Page title in HTML header var title: String is writable, noinit # Page url var url: String is writable, noinit # Directory where css, js and other assets can be found var shareurl: String is writable, noinit # Attributes of the body tag element var body_attrs = new Array[TagAttribute] # Top menu template if any var topmenu: TplTopMenu is writable, noinit # Sidebar template if any var sidebar: nullable TplSidebar = null is writable # Content of the page in form a TplSection var sections = new Array[TplSection] # Footer content if any var footer: nullable Streamable = null is writable # JS scripts to append at the end of the body var scripts = new Array[TplScript] # Add a section to this page fun add_section(section: TplSection) do sections.add section end # Render the html header private fun render_head do var css = (self.shareurl / "css").html_escape var vendors = (self.shareurl / "vendors").html_escape addn "" addn "
" addn " " addn " " addn " " addn " " addn " " addn " " addn " " addn " " addn "