1 # This file is part of NIT ( http://www.nitlanguage.org ).
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
15 module html_page
is example
23 add
("meta").attr
("charset", "utf-8")
24 add
("title").text
("Nit")
25 add
("link").attr
("rel", "icon").attr
("href", "http://nitlanguage.org/favicon.ico").attr
("type", "image/x-icon")
26 add
("link").attr
("rel", "stylesheet").attr
("href", "http://nitlanguage.org/style.css").attr
("type", "text/css")
27 add
("link").attr
("rel", "stylesheet").attr
("href", "http://nitlanguage.org/local.css").attr
("type", "text/css")
31 open
("article").add_class
("page")
32 open
("section").add_class
("pageheader")
33 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>")
34 open
("header").add_class
("header")
35 open
("div").add_class
("topsubtitle")
36 add
("p").text
("A Fun Language for Serious Programming")
41 open
("div").attr
("id", "pagebody")
42 open
("section").attr
("id", "content")
43 add
("h1").text
("# What is Nit?")
44 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.")
45 add
("p").text
("So, what does the famous hello world program look like, in Nit?")
46 add_html
("<pre><tt><span class='normal'>print </span><span class='string'>'Hello, World!'</span></tt></pre>")
48 add
("h1").text
("# Feature Highlights")
49 add
("h2").text
("Usability")
50 add
("p").text
("Nit's goal is to be usable by real programmers for real projects")
54 add
("a").attr
("href", "http://en.wikipedia.org/wiki/KISS_principle").text
("KISS principle")
56 add
("li").text
("Script-like language without verbosity nor cryptic statements")
57 add
("li").text
("Painless static types: static typing should help programmers")
58 add
("li").text
("Efficient development, efficient execution, efficient evolution.")
61 add
("h2").text
("Robustness")
62 add
("p").text
("Nit will help you to write bug-free programs")
65 add
("li").text
("Strong static typing")
66 add
("li").text
("No more NullPointerException")
69 add
("h2").text
("Object-Oriented")
70 add
("p").text
("Nit's guideline is to follow the most powerful OO principles")
74 add
("a").attr
("href", "./everything_is_an_object/").text
("Everything is an object")
77 add
("a").attr
("href", "./multiple_inheritance/").text
("Multiple inheritance")
80 add
("a").attr
("href", "./refinement/").text
("Open classes")
83 add
("a").attr
("href", "./virtual_types/").text
("Virtual types")
88 add
("h1").text
("# Getting Started")
89 add
("p").text
("Get Nit from its Git repository:")
91 add_html
("<pre><code>$ git clone http://nitlanguage.org/nit.git</code></pre>")
92 add
("p").text
("Build the compiler (may be long):")
93 add_html
("<pre><code>$ cd nit\n")
94 add_html
("$ make</code></pre>")
95 add
("p").text
("Compile a program:")
96 add_html
("<pre><code>$ bin/nitc examples/hello_world.nit</code></pre>")
97 add
("p").text
("Execute the program:")
98 add_html
("<pre><code>$ ./hello_world</code></pre>")
105 var page
= new NitHomepage
107 page
.write_to_file
("nit.html")