mosra / m.css

A no-nonsense, no-JavaScript CSS framework, site and documentation theme for content-oriented websites
https://mcss.mosra.cz
Other
406 stars 92 forks source link

Need to expand environment variables while copying referenced files #127

Closed thomthom closed 4 years ago

thomthom commented 4 years ago

I was trying out m.css and it looks really promising. I found one issue in while testing this, we use environment variables in the Doxygen config for some of the reference files.

https://github.com/mosra/m.css/blob/6eefd92c2aa3e0a257503d31b1a469867dfff8b6/documentation/doxygen.py#L3642-L3660

I think this can be addressed by having the script expand the environment variables. I could give it a stab to create a PR if that sounds acceptable.

mosra commented 4 years ago

Hi,

this should be possible since 1c133b1bae1b9072c4567ec2cb77202c6c2283fc -- there's now a possibility to supply most of the options from a python config file, which is done to alllow a lot more flexibility (among the planned features is supplying URL formatter functions, hooks for code processing etc.) and should also make your case possible -- in particular, take a "template" input Doxyfile, expand env vars in it and save it to a Doxyfile that then gets processed further. Or if you need that in the EXTRA_FILES / STYLESHEETS / FAVICON ... options that can be specified directly through Python, you don't even need to do any Doxyfile processing.

The original way through the Doxyfile is still supported for backwards compatibility of course, but the Python file is the preferred way going forward.

thomthom commented 4 years ago

That sounds great! Having the config for m.css makes sense as well. I'm in the process of converting our current docs to m.css and I have a separate Doxyfile that inherits from the main one just for that. Having the config file in python allows for even more flexibility. 👍

mosra commented 4 years ago

The split is a bit weird at this point (you still need to patch the original Doxyfile to enable the XML output and disable the HTML output) so you most probably end up with three files anyway. In the future I might consider adding an ability to generate a Doxyfile from a pure-python config, but right now it's like this.

thomthom commented 4 years ago

That's fine, an extra file doesn't hurt. Main value is being able to use environment variable to account for local dev environment vs build machine environment.