nitc :: PageHome :: defaultinit
nitc :: static_structure $ PageHome :: apply_structure
Create the structure of this pagenitc :: static_html $ PageHome :: init_title
Build page title stringnitc :: static_html $ PageHome :: render_content
Renders the footer and contenttemplate :: Template :: _is_frozen
Is the template allowing more modification (add
)
template :: Template :: _is_writing
Flag to avoid infinite recursivity if a template contains itselfnitc :: DocPage :: _piwik_script
Piwik script to append in the page scriptstemplate :: Template :: _render_done
Flag to avoid multiple renderingnitc :: DocPage :: apply_structure
Create the structure of this pagecore :: Object :: class_factory
Implementation used byget_class
to create the specific class.
nitc :: DocPage :: defaultinit
nitc :: PageHome :: defaultinit
template :: Template :: defaultinit
core :: Object :: defaultinit
core :: Writable :: defaultinit
template :: Template :: is_frozen=
Is the template allowing more modification (add
)
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
template :: Template :: is_writing
Flag to avoid infinite recursivity if a template contains itselftemplate :: Template :: is_writing=
Flag to avoid infinite recursivity if a template contains itselfcore :: Object :: native_class_name
The class name of the object in CString format.core :: Object :: output_class_name
Display class name on stdout (debug only).nitc :: DocPage :: piwik_script
Piwik script to append in the page scriptsnitc :: DocPage :: piwik_script=
Piwik script to append in the page scriptstemplate :: Template :: render_done=
Flag to avoid multiple renderingcore :: Writable :: write_to_bytes
Likewrite_to
but return a new Bytes (may be quite large)
core :: Writable :: write_to_file
Likewrite_to
but take care of creating the file
core :: Writable :: write_to_string
Likewrite_to
but return a new String (may be quite large).
redef class PageHome
redef fun apply_structure(doc) do
var title = doc.custom_title or else "Welcome to Nitdoc!"
var intro = doc.custom_intro
if intro != null then
main_tab.content.add new CardPageHeader(title)
main_tab.content.add new CardText(intro)
else
main_tab.content.add new CardPageHeader(title, "The Nit API documentation.")
end
main_tab.content.add new CardCatalogStats(doc.catalog)
main_tab.content.add new CardCatalogTags(doc.catalog)
main_tab.content.add new CardSection(2, "Packages")
var mpackages_sorter = new CatalogScoreSorter(doc.catalog)
var mpackages = doc.catalog.mpackages.values.to_a
mpackages_sorter.sort mpackages
var list = new CardList("packages", "Packages")
for mpackage in mpackages do
list.cards.add new CardCatalogPackage(doc.catalog, mpackage)
end
# TODO pagination?
main_tab.content.add list
end
end
src/doc/static/static_structure.nit:26,1--53,3
redef class PageHome
redef var html_url = "index.html"
redef fun render(doc) do
main_tab.show_sidebar = false
return super
end
redef fun init_title(doc) do
title = doc.custom_title or else "Nitdoc"
end
redef fun render_content do
addn "<div class='container'>"
if tabs.not_empty then
addn tabs.first
end
addn "</div>"
end
end
src/doc/static/static_html.nit:152,1--171,3