Introduced properties

Redefined properties

redef type SELF: NitHomepage

html $ NitHomepage :: SELF

Type of this instance, automatically specialized in every class
redef fun body

html $ NitHomepage :: body

Define body content
redef fun head

html $ NitHomepage :: head

Define head 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
fun add(tag: String): HTMLTag

html :: HTMLPage :: add

Add a html tag to the current element
fun add_html(html: String)

html :: HTMLPage :: add_html

Add a raw html string
fun body

html :: HTMLPage :: body

Define body content
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.
fun close(tag: String)

html :: HTMLPage :: close

Close previously opened tag
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 head

html :: HTMLPage :: head

Define head content
init init

core :: Object :: init

fun inspect: String

core :: Object :: inspect

Developer readable representation of self.
protected fun inspect_head: String

core :: Object :: inspect_head

Return "CLASSNAME:#OBJECTID".
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.
intern fun object_id: Int

core :: Object :: object_id

An internal hash code for the object based on its identity.
fun open(tag: String): HTMLTag

html :: HTMLPage :: open

Open a html tag
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 serialization_hash: Int

core :: Object :: serialization_hash

Hash value use for serialization
intern fun sys: Sys

core :: Object :: sys

Return the global sys object, the only instance of the Sys class.
abstract fun to_jvalue(env: JniEnv): JValue

core :: Object :: to_jvalue

fun to_s: String

core :: Object :: to_s

User readable representation of self.
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 html::NitHomepage NitHomepage html::HTMLPage HTMLPage html::NitHomepage->html::HTMLPage core::Writable Writable html::HTMLPage->core::Writable ...core::Writable ... ...core::Writable->core::Writable

Ancestors

interface Object

core :: Object

The root of the class hierarchy.
interface Writable

core :: Writable

Things that can be efficienlty written to a Writer

Parents

class HTMLPage

html :: HTMLPage

A html page

Class definitions

html $ NitHomepage
class NitHomepage
	super HTMLPage

	redef fun head do
		add("meta").attr("charset", "utf-8")
		add("title").text("Nit")
		add("link").attr("rel", "icon").attr("href", "http://nitlanguage.org/favicon.ico").attr("type", "image/x-icon")
		add("link").attr("rel", "stylesheet").attr("href", "http://nitlanguage.org/style.css").attr("type", "text/css")
		add("link").attr("rel", "stylesheet").attr("href", "http://nitlanguage.org/local.css").attr("type", "text/css")
	end

	redef fun body do
		open("article").add_class("page")
			open("section").add_class("pageheader")
				add_html("<a id='toptitle_first' class='toptitle'>the</a><a id='toptitle_second' class='toptitle' href=''>Nit</a><a id='toptitle_third' class='toptitle' href=''>Programming Language</a>")
				open("header").add_class("header")
					open("div").add_class("topsubtitle")
						add("p").text("A Fun Language for Serious Programming")
					close("div")
				close("header")
			close("section")

			open("div").attr("id", "pagebody")
				open("section").attr("id", "content")
					add("h1").text("# What is Nit?")
					add("p").text("Nit is an object-oriented programming language. The goal of Nit is to propose a robust statically typed programming language where structure is not a pain.")
					add("p").text("So, what does the famous hello world program look like, in Nit?")
					add_html("<pre><tt><span class='normal'>print </span><span class='string'>'Hello, World!'</span></tt></pre>")

					add("h1").text("# Feature Highlights")
					add("h2").text("Usability")
					add("p").text("Nit's goal is to be usable by real programmers for real projects")

					open("ul")
						open("li")
						add("a").attr("href", "http://en.wikipedia.org/wiki/KISS_principle").text("KISS principle")
						close("li")
						add("li").text("Script-like language without verbosity nor cryptic statements")
						add("li").text("Painless static types: static typing should help programmers")
						add("li").text("Efficient development, efficient execution, efficient evolution.")
					close("ul")

					add("h2").text("Robustness")
					add("p").text("Nit will help you to write bug-free programs")

					open("ul")
						add("li").text("Strong static typing")
						add("li").text("No more NullPointerException")
					close("ul")

					add("h2").text("Object-Oriented")
					add("p").text("Nit's guideline is to follow the most powerful OO principles")

					open("ul")
						open("li")
						add("a").attr("href", "./everything_is_an_object/").text("Everything is an object")
						close("li")
						open("li")
						add("a").attr("href", "./multiple_inheritance/").text("Multiple inheritance")
						close("li")
						open("li")
						add("a").attr("href", "./refinement/").text("Open classes")
						close("li")
						open("li")
						add("a").attr("href", "./virtual_types/").text("Virtual types")
						close("li")
					close("ul")


					add("h1").text("# Getting Started")
					add("p").text("Get Nit from its Git repository:")

					add_html("<pre><code>$ git clone http://nitlanguage.org/nit.git</code></pre>")
					add("p").text("Build the compiler (may be long):")
					add_html("<pre><code>$ cd nit\n")
					add_html("$ make</code></pre>")
					add("p").text("Compile a program:")
					add_html("<pre><code>$ bin/nitc examples/hello_world.nit</code></pre>")
					add("p").text("Execute the program:")
					add_html("<pre><code>$ ./hello_world</code></pre>")
				close("section")
			close("div")
		close("article")
	end
end
lib/html/examples/html_page.nit:19,1--103,3