nitdoc: better display of big class hierarchies.

Fixes #638

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
nitdoc: display markdown synopsys in lists.

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
nitdoc: add template for tab panel component from Bootstrap

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
nitdoc: add default link to local files if opt_source is not set.

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
nitdoc: redirect quicksearch to mpropdef in mclass page instead of mproperty page

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
lib: create group `template`.

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
lib: introduce `TemplateMacro`.

TemplateMacro is a quick and easy way to replace macros in string by other Streamable replacement.

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
lib: add tests for `TemplateMacro`

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
markdown: decorator generate headline ids and save them for further use in client.

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
markdown: fix out of bound access on MDLine

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
nitdoc: show mpropdefs redef chain in MClass page.

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Merge: Nitdoc next

Some improvments for Nitdoc:

* **Better display of big class hierarchies in lists and graphs**: example with class Token: http://gresil.org/jenkins/job/CI-nitdoc/ws/doc/nitc/class_workspace__Token.html

* **Markdownize synopsys**: example with Concerns here: http://gresil.org/jenkins/job/CI-nitdoc/ws/doc/nitc/group_workspace__workspace.html#concerns

* **Better display for mpropdefs definition hierarchies**: example with the `Object::exit` method: http://gresil.org/jenkins/job/CI-nitdoc/ws/doc/nitc/class_standard__Object.html#standard__Object__exit

Also some minor fixes:

* add link to source even in local generation (link to the file so it can be openned in a browser but there is no jumps to lines)
* always redirect to mproperty definition in class page (try to hidde at a maximum the mproperty page so it only accessible from intro definition)

Previews:

* lib: http://gresil.org/jenkins/job/CI-nitdoc/ws/doc/stdlib/index.html
* nitc: http://gresil.org/jenkins/job/CI-nitdoc/ws/doc/nitc/index.html

Pull-Request: #745
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Jean Privat <jean@pryen.org>
Merge: Template strings and macros

# Template strings with macros replacement.

`TemplateString` provides a simple way to customize generic string templates
using macros and replacement.

A macro is represented as a string identifier like `%MACRO%` in the template
string. Using `TemplateString`, macros can be replaced by any `Streamable` data:

    var tpl = new TemplateString("Hello %NAME%!")
    tpl.replace("NAME", "Dave")
    assert tpl.write_to_string == "Hello Dave!"

A macro identifier is valid if:

* starts with an uppercase letter
* contains only numers, uppercase letters or '_'

See `String::is_valid_macro_name` for more details.

## External template files

When using large template files it's recommanded to use external template files.

In external file `example.tpl`:

    <!DOCTYPE html>
    <html lang="en">
     <head>
      <title>%TITLE%</title>
     </head>
     <body>
      <h1>%TITLE%</h1>
      <p>%ARTICLE%</p>
     </body>
    </html>

Loading the template file using `TemplateString`:

    var file = "example.tpl"
    if file.file_exists then
        tpl = new TemplateString.from_file("example.tpl")
        tpl.replace("TITLE", "Home Page")
        tpl.replace("ARTICLE", "Welcome on my site!")
    end

## Outputting

Once macro replacement has been made, the `TemplateString` can be
output like any other `Template` using methods like `write_to`, `write_to_string`
or `write_to_file`.

    tpl = new TemplateString("Hello %NAME%!")
    tpl.replace("NAME", "Dave")
    assert tpl.write_to_string == "Hello Dave!"

## Template correctness

`TemplateString` can be outputed even if all macros were not replaced.
In this case, the name of the macro will be displayed wuthout any replacement.

    tpl = new TemplateString("Hello %NAME%!")
    assert tpl.write_to_string == "Hello %NAME%!"

The `check` method can be used to ensure that all macros were replaced before
performing the output. Warning messages will be stored in `warnings` and can
be used to locate unreplaced macros.

    tpl = new TemplateString("Hello %NAME%!")
    if not tpl.check then
        assert not tpl.warnings.is_empty
        print "Cannot output unfinished template:"
        print tpl.warnings.join("
")
        exit(0)
    else
        tpl.write_to sys.stdout
    end
    assert tpl.write_to_string == "Hello %NAME%!"

Pull-Request: #747
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Jean Privat <jean@pryen.org>
Merge: markdown: decorator generate headline ids and save them for further use in client.

Markdown decorator now remembers outputed headlines.

This will be usefull to reconstruct headline summary from parsed markdown.

Also added a fix on outofbound exception.

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

Pull-Request: #764
Reviewed-by: Jean Privat <jean@pryen.org>