# 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. # Introduces templates that compose the documentation HTML rendering. module html_templates import html_model import html::bootstrap import doc_phases::doc_structure import doc_phases::doc_hierarchies import doc_phases::doc_graphs import doc_phases::doc_intros_redefs import doc_phases::doc_lin import doc_phases::doc_readme intrude import doc_down # Renders the page as HTML. redef class DocPage super Template # Page url. var html_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: DocTopMenu is writable, noinit # Sidebar template if any. var sidebar: nullable DocSideBar = null is writable # Footer content if any. var footer: nullable Writable = null is writable # JS scripts to append at the end of the body var scripts = new Array[TplScript] # Renders the html `
`. 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 "