Merge: nitweb: better namespaces
authorJean Privat <jean@pryen.org>
Thu, 1 Sep 2016 18:50:21 +0000 (14:50 -0400)
committerJean Privat <jean@pryen.org>
Thu, 1 Sep 2016 18:50:21 +0000 (14:50 -0400)
commit82f59b10324266bf5373b65dc5a5bf893561c4d4
tree61cd1a560df977674eeef16ac230293f92d3d209
parent69b83ebfb2f27c3f83ff6c9d8a180a2c00c8d402
parent20b19a686ed3a11b36aeaae64025b87d3738af21
Merge: nitweb: better namespaces

Before this PR, the namespace composition (adding html things to the MEntity::full_name) was handled by Angular. Namespaces are a pain in the nit to generate, even more when you don't have access to the model... So the solution was to delegate that work to the API.

With this PR, nitweb attach a Namespace object to each MEntity so Angular knows how to render it.
The idea is pretty simple, a namespace is an array of either:

* a string for "::", "$" ...
* an mentity reference like `Array`
* another namespace for recursive definitions

Demo is here: http://nitweb.moz-code.org/

Some examples:

* `core`: http://nitweb.moz-code.org/doc/core
* `core>`: http://nitweb.moz-code.org/doc/core>
* `core::core`: http://nitweb.moz-code.org/doc/core::core
* `core::Array`: http://nitweb.moz-code.org/doc/core::Array
* `core::Array::from`: http://nitweb.moz-code.org/doc/core::Array::from

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