Merge: nitweb: auto link entitites found in `span code`
authorJean Privat <jean@pryen.org>
Wed, 18 Jan 2017 20:23:54 +0000 (15:23 -0500)
committerJean Privat <jean@pryen.org>
Wed, 18 Jan 2017 20:23:54 +0000 (15:23 -0500)
commit3c5e017e563efb90995ce93b6d19be62213a9441
tree460cf3a011207fe55672df7a73b3848f7126d213
parent4d12a9a94656f137b527c92da066443e4ba91954
parente711f4418019f3c59a5d34520a9e6fde1338dfff
Merge: nitweb: auto link entitites found in `span code`

This PR introduces a stub feature for nitweb: autolinking entities from `span` code.

Each time nitweb renders a Markdown comment it evaluates the content of each inline `code` tag and tries to match it with the model index. If the content of the `code` tag matches a package, module, class or property, the `code` content is wrapped in a link to that entity.

Examples:

* `Object`: will be rendered as `<a href='/doc/core::Object'>Object</a>`
* `nullable Object`: will be rendered as `<a href='/doc/core::Object'>nullable Object</a>`
* `is_same_instance`: will be rendered as `<a href='/doc/core::Object::is_same_instance'>is_same_instance</a>`.

The name matching algorithm is the same as the one used to resolve short links like `[Object]` or complex directives like `[graph: core]`.

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

The documentation from the `core` package benefits from the new feature: http://nitweb.moz-code.org/doc/core

Pull-Request: #2353