X-Git-Url: http://nitlanguage.org diff --git a/src/doc/doc_templates.nit b/src/doc/doc_templates.nit index 353ecdf..cbb625e 100644 --- a/src/doc/doc_templates.nit +++ b/src/doc/doc_templates.nit @@ -23,7 +23,7 @@ import json::static class TplPage super Template - # Page title in HTML header + # The unescaped page title to put in the HTML header. var title: String is writable, noinit # Page url @@ -60,28 +60,28 @@ class TplPage var css = (self.shareurl / "css").html_escape var vendors = (self.shareurl / "vendors").html_escape - add "" - add "" - add " " - add " " - add " " - add " " - add " " - add " " - add " " - add " " - add " {title}" - add "" + addn "" + addn "" + addn " " + addn " " + addn " " + addn " " + addn " " + addn " " + addn " " + addn " " + addn " {title.html_escape}" + addn "" add "" + addn ">" end # Render the topmenu template private fun render_topmenu do - add "
" + addn "
" add topmenu - add "
" + addn "
" end # Render the sidebar @@ -99,9 +99,9 @@ class TplPage private fun render_content do for section in sections do add section if footer != null then - add "" end end @@ -110,41 +110,41 @@ class TplPage var vendors = (self.shareurl / "vendors").html_escape var js = (self.shareurl / "js").html_escape - add "" - add "" - add "" - add "" + addn "" + addn "" + addn "" + addn "" for script in scripts do add script - add """""" - add "" - add "" + addn "" + addn "" end # Render the whole page redef fun rendering do render_head - add "
" + addn "
" render_topmenu - add "
" + addn "
" if sidebar != null then - add "
" + addn "
" render_sidebar - add "
" - add "
" + addn "
" + addn "
" render_content - add "
" + addn "
" else - add "
" + addn "
" render_content - add "
" + addn "
" end - add "
" - add "
" + addn "
" + addn "
" render_footer end end @@ -182,7 +182,7 @@ class TplTopMenu end tpl.add ">" tpl.add content - tpl.add "" + tpl.addn "" add_raw(tpl) end @@ -193,27 +193,27 @@ class TplTopMenu redef fun rendering do if brand == null and elts.is_empty then return - add "" end end @@ -233,9 +233,9 @@ class TplSidebar redef fun rendering do if boxes.is_empty then return order_boxes - add "" end end @@ -296,16 +296,16 @@ class TplSideBox if content == null then return var open = "" if is_open then open = "in" - add "
" - add "
" + addn "
" + addn "
" add " " add title - add " " - add "
" - add "
" + addn " " + addn "
" + addn "
" add content.as(not null) - add "
" - add "
" + addn "
" + addn "
" end end @@ -332,18 +332,18 @@ class TplSummary redef fun rendering do if children.is_empty then return - add "
" - add "
" + addn "
" + addn "
" add " " add "Summary" - add " " - add "
" - add "
" - add "
" + addn "
" + addn " " - add "
" - add "
" + addn " " + addn "
" + addn "
" end end @@ -364,11 +364,11 @@ class TplSummaryEntry add "
  • " add text if not children.is_empty then - add "" end - add "
  • " + addn "" end end @@ -444,23 +444,23 @@ class TplSection super TplSectionElt redef fun rendering do - add "
    " + addn "
    " if title != null then var lvl = hlvl if lvl == 2 then title_classes.add "well well-sm" - add "" - add title.as(not null) - add "" + addn "" + addn title.as(not null) + addn "" end if subtitle != null then - add "
    " - add subtitle.as(not null) - add "
    " + addn "
    " + addn subtitle.as(not null) + addn "
    " end for child in children do add child end - add "
    " + addn "
    " end end @@ -488,23 +488,23 @@ class TplArticle redef fun rendering do if is_empty then return - add "
    " + addn "
    " if source_link != null then add "" + addn "" end if title != null then var lvl = hlvl if lvl == 2 then title_classes.add "well well-sm" add "" add title.as(not null) - add "" + addn "" end if subtitle != null then add "
    " add subtitle.as(not null) - add "
    " + addn "" end if content != null then add content.as(not null) @@ -512,7 +512,7 @@ class TplArticle for child in children do add child end - add """
    """ + addn """
    """ end redef fun is_empty: Bool do @@ -534,7 +534,7 @@ class TplDefinition var location: nullable Streamable = null is writable private fun render_info do - add "
    " + addn "
    " if namespace != null then if comment == null then add "no comment for " @@ -545,7 +545,7 @@ class TplDefinition add " " add location.as(not null) end - add "
    " + addn "
    " end private fun render_comment do @@ -553,10 +553,10 @@ class TplDefinition end redef fun rendering do - add "
    " + addn "
    " render_comment render_info - add "
    " + addn "
    " end end @@ -567,23 +567,21 @@ class TplClassDefinition var intros = new Array[TplListElt] var redefs = new Array[TplListElt] - init do end - redef fun rendering do - add "
    " + addn "
    " render_comment render_info render_list("Introduces", intros) render_list("Redefines", redefs) - add "
    " + addn "
    " end private fun render_list(name: String, elts: Array[TplListElt]) do if elts.is_empty then return - add "
    {name.html_escape}
    " - add "" end end @@ -597,47 +595,47 @@ class TplSearchPage redef fun rendering do var title = self.title - if title != null then add "

    {title.to_s.html_escape}

    " - add "
    " - add "
    " + if title != null then addn "

    {title.to_s.html_escape}

    " + addn "
    " + addn "
    " if not modules.is_empty then - add "
    " - add "

    Modules

    " - add "
      " + addn "
      " + addn "

      Modules

      " + addn "
        " for m in modules do add "
      • " add m - add "
      • " + addn "" end - add "
      " - add "
      " + addn "
    " + addn "
    " end if not classes.is_empty then - add "
    " - add "

    Classes

    " - add "
      " + addn "
      " + addn "

      Classes

      " + addn "
        " for c in classes do add "
      • " add c - add "
      • " + addn "" end - add "
      " - add "
      " + addn "
    " + addn "
    " end if not props.is_empty then - add "
    " - add "

    Properties

    " - add "
      " + addn "
      " + addn "

      Properties

      " + addn "
        " for p in props do add "
      • " add p - add "
      • " + addn "" end - add "
      " - add "
      " + addn "
    " + addn "
    " end - add "
    " - add "
    " + addn "
    " + addn "
    " end end @@ -652,10 +650,10 @@ class TplLink # Link href var href: String is writable - # Text to display in the link + # The raw HTML content to display in the link var text: Streamable is writable - # Optional title + # The unescaped optional title. var title: nullable String = null is writable init with_title(href, text, title: String) do @@ -665,11 +663,11 @@ class TplLink redef fun rendering do add "" @@ -692,17 +690,15 @@ class TplList # Add content wrapped in a
  • element fun add_li(item: TplListItem) do elts.add item - init do end - init with_classes(classes: Array[String]) do self.css_classes = classes fun is_empty: Bool do return elts.is_empty redef fun rendering do if elts.is_empty then return - add "
      " + addn "
        " for elt in elts do add elt - add "
      " + addn "
    " end end @@ -721,8 +717,6 @@ class TplListItem # CSS classes of the
  • element var css_classes = new Array[String] - init do end - init with_content(content: Streamable) do append(content) init with_classes(content: Streamable, classes: Array[String]) do @@ -737,7 +731,7 @@ class TplListItem redef fun rendering do add "
  • " add content - add "
  • " + addn "" end end @@ -755,9 +749,9 @@ class TplTab var css_classes = new Array[String] redef fun rendering do - add "
    " + addn "
    " for panel in panels do add panel - add "
    " + addn "
    " end end @@ -796,9 +790,9 @@ class TplTabPanel redef fun rendering do add "
    " + addn "' id='{id}'>" if content != null then add content.as(not null) - add "
    " + addn "" end end @@ -886,9 +880,9 @@ class TplScript redef fun rendering do add "" + addn ">" render_content - add "" + addn "" end end @@ -905,17 +899,17 @@ class TplPiwikScript if tracker_url.chars.last != '/' then tracker_url += "/" tracker_url = "://{tracker_url}".to_json - add "" - add "var _paq = _paq || [];" - add " _paq.push([\"trackPageView\"]);" - add " _paq.push([\"enableLinkTracking\"]);" - add "(function() \{" - add " var u=((\"https:\" == document.location.protocol) ? \"https\" : \"http\") + {tracker_url};" - add " _paq.push([\"setTrackerUrl\", u+\"piwik.php\"]);" - add " _paq.push([\"setSiteId\", {site_id}]);" - add " var d=document, g=d.createElement(\"script\"), s=d.getElementsByTagName(\"script\")[0]; g.type=\"text/javascript\";" - add " g.defer=true; g.async=true; g.src=u+\"piwik.js\"; s.parentNode.insertBefore(g,s);" - add "\})();" + addn "" + addn "var _paq = _paq || [];" + addn " _paq.push([\"trackPageView\"]);" + addn " _paq.push([\"enableLinkTracking\"]);" + addn "(function() \{" + addn " var u=((\"https:\" == document.location.protocol) ? \"https\" : \"http\") + {tracker_url};" + addn " _paq.push([\"setTrackerUrl\", u+\"piwik.php\"]);" + addn " _paq.push([\"setSiteId\", {site_id}]);" + addn " var d=document, g=d.createElement(\"script\"), s=d.getElementsByTagName(\"script\")[0]; g.type=\"text/javascript\";" + addn " g.defer=true; g.async=true; g.src=u+\"piwik.js\"; s.parentNode.insertBefore(g,s);" + addn "\})();" end end