# 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. # Cards templates for the static documentation module static_cards import templates::html_commands # A card that can be rendered to HTML # # Basically, these cards are templates with additionnal data and behavior. abstract class StaticCard super Template # Card title var title: String is writable # Card id var id: String is writable end # A list of cards class CardList super StaticCard # Cards contained in this list var cards = new Array[StaticCard] is writable redef fun rendering do addn "
" addn subtitle addn "
" end addn "{{{mentity.html_namespace.write_to_string}}}
""" var mdoc = mentity.mdoc_or_fallback if mdoc != null then if full_doc then addn mdoc.html_documentation else addn mdoc.html_synopsis end end addn """""" render_code addn """{{{mentity.location.to_s}}}
" render_code addn "" end addn "{mentity.location}" addn "
{{{maintainer.to_html}}}
""" end var license = metadata.license if license != null then addn """ {{{license}}} license """ end var homepage = metadata.homepage var browse = metadata.browse var issues = metadata.issues if homepage != null or browse != null or issues != null then addn """