ldoc icon indicating copy to clipboard operation
ldoc copied to clipboard

Allow passing configuration values

Open AlexisBRENON opened this issue 7 years ago • 1 comments
trafficstars

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.

AlexisBRENON avatar Jan 10 '18 10:01 AlexisBRENON

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.

AlexisBRENON avatar Sep 30 '20 08:09 AlexisBRENON