Open geiseri opened 1 year ago
@geiseri I think this feature would be a great addition to the extension. My intention is to add new features as a Sphinx domain so the syntax would be something like:
.. cadquery:export::
:format: stl
:caption: 3D print
:name: front.stl
result = cadquery.Workplane("front").box(2, 2, 0.5)
:cadquery:download:`3D print <front.stl>`
First of all THANKS! I was using cadquery-server to generate a static site with my models. While it works very well it is quite hard to customize. Sphinx makes that MUCH easier. One feature I miss though is the ability to export links to the models for download.
When I present my models I like to provide a download link to the part. Like below:
Right now I just have my pipeline run the export before the sphinx round and throw them in the
_static
directory. It would be cool to have a directive like this:Where
:format:
is optional and the:name:
would be used similarly to the cadquery export behavior.That would present a link for download similar to the download directive below:
Theoretically, the export function of the cqgi interface could be used. I have never written a directive before, so maybe that won't work for generating a file.
One other choice (while IMHO less flexible) could be to add a parameter like
:export: file.stl
that can add a download link next to the image like the image above.