2bndy5 / sphinx-social-cards

A Sphinx extension that generates images for social media cards.
https://2bndy5.github.io/sphinx-social-cards/
MIT License
0 stars 0 forks source link

consider switch to rust on backend #83

Open 2bndy5 opened 3 months ago

2bndy5 commented 3 months ago

Historically, I've tried using various libraries to generate images. But SVG rendering support has been the biggest hurtle in this regard.

Currently, I'm using Qt6 (PySide6) on the backend since it offers SVG rendering support (among other essential features like font rendering). However, Qt doesn't not execute well in headless Linux environments (see #13). Using a rust interface on the backend instead should mitigate #13 sufficiently.

I think it is worth re-writing the backend for image generation using python bindings to a rust interface (using PyO3). Useful rust libs/crates include:

2bndy5 commented 1 month ago

Unfortunately, the state of parsing YAML in rust is in a state of flux at the moment.

[!important] See also

  • rust advisory about unmaintained yaml-rust lib
  • yaml-rust2 is a drop-in replacement for yaml-rust lib
  • saphyr is a yaml-rust2 derivative with plans to improve the API at the cost of breaking yaml-rust's API. (see Ethiraric/yaml-rust2#26 for rationale)

Also, serializing a YAML document into rust data structs had been driven with serde-yaml which is no longer maintained (actually deprecated) without any candidates for replacement.