marzer / poxy

Documentation generator for C++
https://pypi.org/project/poxy
MIT License
135 stars 5 forks source link

Enable USE_MATHJAX = TRUE #35

Closed taehyounpark closed 3 months ago

taehyounpark commented 3 months ago

First of all, thank you for this repository! I've looked for everything under the sun for something that would actually handle Doxygen documentation for highly-templated code, only to run into confusing quirks at best or even flat-out erroneous output from several other workflows. m.css together with poxy, gets it perfect!

I just wanted to ask/request how one might be able to insert math equations into the markdown files? As far as I understand, this requires USE_MATHJAX option which is by default false, and poxy (as stated in README) does not allow configs to be changed manually.

Would such an option being allowed in poxy.toml cause any issues with the current locked-down Doxygen configuration? Thanks again in advance!

marzer commented 3 months ago

Hiya,

Would such an option being allowed in poxy.toml cause any issues with the current locked-down Doxygen configuration?

I suspect it would be fine. My choice to lock down the config mostly just to limit the chaos that doxygen can actually cause, since their testing process is lacking and there are always many regressions from one version to the next.

I don't have strong opinions on most of the available options - I just by disabled things I personally didn't want when I started wrapping things up in Poxy as a starting point :)

For your particular case it really only depends on whether m.css supports this particular doxygen feature, since poxy doesn't do much in the way of HTML rendering (only minor bugfixes and small features using pre- and post- processes).

marzer commented 3 months ago

Ah ok so m.css provides support for math formulas but it does not appear to be based on the Doxygen option USE_MATHJAX, since that requires you to using Doxygen's GENERATE_HTML option, which isn't the case (m.css handles HTML rendering itself using doxygen's XML output mode instead).

Have a look at the math-related information in the m.css Doxygen generator documentation; you might find this already works without needing anything extra :)

taehyounpark commented 3 months ago

You are right and @f$ x+y @f$ works out of the box. The irony of not having read the documentation :sweat_smile: thanks!

mosra commented 3 months ago

Haha, yes, it's builtin and should "just work", if you have a LaTeX installation set up.

Some background info -- one of the reasons I started making the m.css theme in the first place was because I hated how math equations looked like on most websites, either being blurry / aliased raster images, or flickering and causing page relayouts because it was rendered by some heavy JavaScript on the client side.

So it's instead rendered into a SVG which is then embedded directly into the markup. Here's a "marketing page" for it back from 2018, most / all features shown there including the window-size-dependent layout are possible with Doxygen and the custom @m_class command as well: https://mcss.mosra.cz/admire/math/

lucasmyers97 commented 1 month ago

One follow-up on this: is it possible to use the markdown math syntax (i.e. enclosing $ or ```math blocks) and still use the m.css functionality? I ask with the aim of using a README.md both as a GitHub front page, and the front page of the poxy-generated documentation.

mosra commented 1 month ago

If Doxygen itself supports that (which is a GitHub Flawored Markdown extension I think) and correctly passes that to the generated XML, m.css will as well.

There has been a new 1.11 release yesterday, but I can't see anything latex-math-specific in the changelogs. Maybe it's already there, I never really tried. (Also no idea how crashy or buggy it is, I didn't even manage to get 1.9 running properly for my code yet.)