module nitcatalog
import loader # Scan&load packages, groups and modules
-import doc::doc_down # Display mdoc
import catalog
+import doc::templates::html_model
+
# A HTML page in a catalog
#
# This is just a template with the header pre-filled and the footer injected at rendering.
do
# Register `self` to the global NitdocDecorator
# FIXME this is ugly. But no better idea at the moment.
- modelbuilder.model.nitdoc_md_processor.emitter.decorator.as(NitdocDecorator).catalog = self
+ modelbuilder.model.nitdoc_md_processor.decorator.as(NitdocDecorator).catalog = self
end
# The output directory where to generate pages
var piwik_site_id: Int = 1
end
+redef class Person
+ redef fun to_html do
+ var res = ""
+ var e = name.html_escape
+ var page = self.page
+ if page != null then
+ res += "<a href=\"{page.html_escape}\">"
+ end
+ var gravatar = self.gravatar
+ if gravatar != null then
+ res += "<img src=\"https://secure.gravatar.com/avatar/{gravatar}?size=20&default=retro\"> "
+ end
+ res += e
+ if page != null then res += "</a>"
+ return res
+ end
+end
+
var model = new Model
var tc = new ToolContext
var f = "p/{p.name}.html"
catalog.package_page(p)
catalog.generate_page(p).write_to_file(out/f)
+ # copy ini
+ var ini = p.ini
+ if ini != null then ini.write_to_file(out/"p/{p.name}.ini")
end
# INDEX