ldoc
ldoc copied to clipboard
Allow passing configuration values
Add a function to the ldoc API (available in config.ld) to pass some values to the templates.
Typical use case is to use different configuration files between local development and production deployment, using different root address. Hence, you can have a local_config.ld with:
add_config_value('html_root', 'http://localhost:8000')
and the default config.ld with:
add_config_value('html_root', 'https://doc.mydomain.com')
Then in templates, you can use $(ldoc.config.html_root) to reffer to the actual value.
Work to do if PR accepted:
- [ ] Update version number
- [ ] Update documentation
Kind.
What do you mean by "a different table" ? The config_values table or the nested ldoc.config table.
It make some times since I opened this PR. But I supposed that I created the nested table to not mix LDoc generated variables (in ldoc) with custom user configuration (in ldoc.config).
If you're OK for mixing everything in the top ldoc table, I will try to update the PR asap.