The Nitdoc overview page that displays the nit packages catalog

Introduced properties

private var _html_url: String

nitc :: PageHome :: _html_url

Redefined properties

redef type SELF: PageHome

nitc $ PageHome :: SELF

Type of this instance, automatically specialized in every class
redef fun apply_structure(doc: DocModel)

nitc :: static_structure $ PageHome :: apply_structure

Create the structure of this page
redef fun html_url: String

nitc :: static_html $ PageHome :: html_url

Page url
redef fun html_url=(html_url: String)

nitc :: static_html $ PageHome :: html_url=

Page url
redef fun init_title(doc: DocModel)

nitc :: static_html $ PageHome :: init_title

Build page title string
redef fun render(doc: DocModel): Writable

nitc :: static_html $ PageHome :: render

Render the page as a html template
redef fun render_content

nitc :: static_html $ PageHome :: render_content

Renders the footer and content

All properties

fun !=(other: nullable Object): Bool

core :: Object :: !=

Have self and other different values?
fun ==(other: nullable Object): Bool

core :: Object :: ==

Have self and other the same value?
type CLASS: Class[SELF]

core :: Object :: CLASS

The type of the class of self.
type SELF: Object

core :: Object :: SELF

Type of this instance, automatically specialized in every class
private var _content: Array[Writable]

template :: Template :: _content

Each sub-elements
private var _html_url: String

nitc :: DocPage :: _html_url

Page url
private var _html_url: String

nitc :: PageHome :: _html_url

private var _is_frozen: Bool

template :: Template :: _is_frozen

Is the template allowing more modification (add)
private var _is_writing: Bool

template :: Template :: _is_writing

Flag to avoid infinite recursivity if a template contains itself
private var _main_tab: DocTab

nitc :: DocPage :: _main_tab

The page main tab
private var _piwik_script: nullable PiwikScript

nitc :: DocPage :: _piwik_script

Piwik script to append in the page scripts
private var _render_done: Bool

template :: Template :: _render_done

Flag to avoid multiple rendering
private var _shareurl: String

nitc :: DocPage :: _shareurl

Directory where css, js and other assets can be found
private var _tabs: Array[DocTab]

nitc :: DocPage :: _tabs

Page tab panels
private var _title: String

nitc :: DocPage :: _title

Title of this page
private var _topmenu: DocTopMenu

nitc :: DocPage :: _topmenu

Top menu template if any
fun add(element: Writable)

template :: Template :: add

Append an element (String, other Template, etc.) at the end of the template.
fun add_all(elements: Collection[Writable])

template :: Template :: add_all

Append a bunch of elements at the end of the template.
fun add_list(elements: Collection[Writable], sep: Writable, last_sep: Writable)

template :: Template :: add_list

Append a bunch of elements at the end of the template with separations.
fun addn(element: Writable)

template :: Template :: addn

Append element and the end of the template then append a "\n".
fun apply_structure(doc: DocModel)

nitc :: DocPage :: apply_structure

Create the structure of this page
protected fun class_factory(name: String): CLASS

core :: Object :: class_factory

Implementation used by get_class to create the specific class.
fun class_name: String

core :: Object :: class_name

The class name of the object.
private fun content: Array[Writable]

template :: Template :: content

Each sub-elements
private fun content=(content: Array[Writable])

template :: Template :: content=

Each sub-elements
init defaultinit(title: String)

nitc :: DocPage :: defaultinit

fun footer: nullable Writable

nitc :: DocPage :: footer

Footer content if any
fun footer=(footer: nullable Writable)

nitc :: DocPage :: footer=

Footer content if any
fun force_render

template :: Template :: force_render

Call rendering, if not already done
fun freeze

template :: Template :: freeze

Disable further modification: no more add is allowed
fun get_class: CLASS

core :: Object :: get_class

The meta-object representing the dynamic type of self.
fun hash: Int

core :: Object :: hash

The hash code of the object.
fun html_url: String

nitc :: DocPage :: html_url

Page url
fun html_url=(html_url: String)

nitc :: DocPage :: html_url=

Page url
init init

core :: Object :: init

fun init_title(doc: DocModel)

nitc :: DocPage :: init_title

Build page title string
fun init_topmenu(doc: DocModel)

nitc :: DocPage :: init_topmenu

Build top menu template if any
fun inspect: String

core :: Object :: inspect

Developer readable representation of self.
protected fun inspect_head: String

core :: Object :: inspect_head

Return "CLASSNAME:#OBJECTID".
fun is_frozen: Bool

template :: Template :: is_frozen

Is the template allowing more modification (add)
protected fun is_frozen=(is_frozen: Bool)

template :: Template :: is_frozen=

Is the template allowing more modification (add)
intern fun is_same_instance(other: nullable Object): Bool

core :: Object :: is_same_instance

Return true if self and other are the same instance (i.e. same identity).
fun is_same_serialized(other: nullable Object): Bool

core :: Object :: is_same_serialized

Is self the same as other in a serialization context?
intern fun is_same_type(other: Object): Bool

core :: Object :: is_same_type

Return true if self and other have the same dynamic type.
private fun is_writing: Bool

template :: Template :: is_writing

Flag to avoid infinite recursivity if a template contains itself
private fun is_writing=(is_writing: Bool)

template :: Template :: is_writing=

Flag to avoid infinite recursivity if a template contains itself
fun main_tab: DocTab

nitc :: DocPage :: main_tab

The page main tab
protected fun main_tab=(main_tab: DocTab)

nitc :: DocPage :: main_tab=

The page main tab
private intern fun native_class_name: CString

core :: Object :: native_class_name

The class name of the object in CString format.
fun new_sub: Template

template :: Template :: new_sub

Return a new basic template that is automatically added in self (using add)
intern fun object_id: Int

core :: Object :: object_id

An internal hash code for the object based on its identity.
fun output

core :: Object :: output

Display self on stdout (debug only).
intern fun output_class_name

core :: Object :: output_class_name

Display class name on stdout (debug only).
fun piwik_script: nullable PiwikScript

nitc :: DocPage :: piwik_script

Piwik script to append in the page scripts
fun piwik_script=(piwik_script: nullable PiwikScript)

nitc :: DocPage :: piwik_script=

Piwik script to append in the page scripts
fun render(doc: DocModel): Writable

nitc :: DocPage :: render

Render the page as a html template
private fun render_content

nitc :: DocPage :: render_content

Renders the footer and content
private fun render_done: Bool

template :: Template :: render_done

Flag to avoid multiple rendering
private fun render_done=(render_done: Bool)

template :: Template :: render_done=

Flag to avoid multiple rendering
private fun render_head

nitc :: DocPage :: render_head

Renders the html <head>
protected fun rendering

template :: Template :: rendering

Service used to render the content of the template.
fun serialization_hash: Int

core :: Object :: serialization_hash

Hash value use for serialization
fun shareurl: String

nitc :: DocPage :: shareurl

Directory where css, js and other assets can be found
fun shareurl=(shareurl: String)

nitc :: DocPage :: shareurl=

Directory where css, js and other assets can be found
intern fun sys: Sys

core :: Object :: sys

Return the global sys object, the only instance of the Sys class.
fun tabs: Array[DocTab]

nitc :: DocPage :: tabs

Page tab panels
protected fun tabs=(tabs: Array[DocTab])

nitc :: DocPage :: tabs=

Page tab panels
fun title: String

nitc :: DocPage :: title

Title of this page
fun title=(title: String)

nitc :: DocPage :: title=

Title of this page
abstract fun to_jvalue(env: JniEnv): JValue

core :: Object :: to_jvalue

fun to_s: String

core :: Object :: to_s

User readable representation of self.
fun topmenu: DocTopMenu

nitc :: DocPage :: topmenu

Top menu template if any
fun topmenu=(topmenu: DocTopMenu)

nitc :: DocPage :: topmenu=

Top menu template if any
abstract fun write_to(stream: Writer)

core :: Writable :: write_to

Write itself to a stream
fun write_to_bytes: Bytes

core :: Writable :: write_to_bytes

Like write_to but return a new Bytes (may be quite large)
fun write_to_file(filepath: String)

core :: Writable :: write_to_file

Like write_to but take care of creating the file
fun write_to_string: String

core :: Writable :: write_to_string

Like write_to but return a new String (may be quite large).
package_diagram nitc::PageHome PageHome nitc::DocPage DocPage nitc::PageHome->nitc::DocPage template::Template Template nitc::DocPage->template::Template ...template::Template ... ...template::Template->template::Template

Ancestors

interface Object

core :: Object

The root of the class hierarchy.
class Template

template :: Template

Templates are simple hierarchical pieces of text used for efficient stream writing.
interface Writable

core :: Writable

Things that can be efficienlty written to a Writer

Parents

class DocPage

nitc :: DocPage

A documentation page abstraction

Class definitions

nitc $ PageHome
# The Nitdoc overview page that displays the nit packages catalog
class PageHome
	super DocPage
end
src/doc/static/static_base.nit:114,1--117,3

nitc :: static_structure $ PageHome
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

nitc :: static_html $ PageHome
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