lab-cosmo / chemiscope

An interactive structure/property explorer for materials and molecules
http://chemiscope.org
BSD 3-Clause "New" or "Revised" License
119 stars 29 forks source link

Fix of Sphinx Gallery display of Chemiscope Visualizer #334

Closed sofiia-chorna closed 4 weeks ago

sofiia-chorna commented 1 month ago

Allow to display chemiscope viewers in sphinx documentations using sphinx-gallery.

ceriottm commented 1 month ago

So this has made great progress. There are a few issues that need to be fixed IMO:

ceriottm commented 1 month ago

One should check whether the CSS for the jupyterlab layout can be reused here, to avoid defining specialized layout code. Maybe however it's better to use something different, particularly if we can make it adapt to the layout and styling used for a given sphinx preset

sofiia-chorna commented 1 month ago
ceriottm commented 1 month ago

Works great and I think this only needs some polish before we can merge and release. Amazing work @sofiia-chorna I'd say this is worthy of a point release at the very least, @Luthaf and I will also help starting on Tuesday. Meanwhile, something that clearly needs some polish is the documentation of this new feature. If I understand correctly, this can now be used in plain sphinx too - which is fantastic - but there's no example or explanation of how. @sofiia-chorna could you perhaps write down some docs? I'd rename the "use in sphinx-gallery" to a more generic "use with spinx" and discuss both direct inclusion and the generation from a python file using chemiscope.show.

ceriottm commented 1 month ago

OK, it works - and so does the software cookbook so all is really nice, great job @sofiia-chorna . I'd just like to understand a bit better how it works - for instance, it looks like I should be able to add a chemiscope to an arbitrary rst file by writing

.. chemiscope::
:filepath: /home/michele/lavoro/code/chemiscope/docs/src/examples/datasets/fig_trajectory_005.json.gz
            :mode: default

in it, however this does not work. Could you add a documentation of how this is supposed to be used wit (and without) sphinx-gallery?

ceriottm commented 4 weeks ago

closing in favor of #341