Skip to content
Snippets Groups Projects
Commit 32c278eb authored by Yuya Nishihara's avatar Yuya Nishihara
Browse files

templater: keep default resources per template engine (API)

This allows us to register a repo object as a resource in hgweb template,
without loosing '{repo}' symbol:

  symbol('repo') -> mapping['repo'] (n/a) -> defaults['repo']
  resource('repo') -> mapping['repo'] (n/a) -> resources['repo']

I'm thinking of redesigning the templatekw API to take (context, mapping)
in place of **(context._resources + mapping), but that will be a big change
and not implemented yet.

props['templ'] is ported to the resources dict as an example.

.. api::

   mapping does not contain all template resources. use context.resource()
   in template functions.
parent d6cfa722
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment