Closed HankewieDanke closed 12 months ago
You don't need the extra to: revealjs
(this will be passed directly to pandoc, maybe it circumvents the filter), if you remove it, it works.
If you need more styling (by default the viewer might be a bit small in a presentation), check out https://github.com/jmbuhr/quarto-molstar/blob/main/presentation.qmd with https://github.com/jmbuhr/quarto-molstar/blob/main/presentation.css -> https://jmbuhr.de/quarto-molstar/presentation.html#/rcsb-pdb
And thanks for the comprehensive reproducible example :)
Thank you for the quick response :)
This is working for the mol-rcsb
case, but I still have problems when using a local file with mol-url
.
Are there any spezificities I have to watch out for in the pdb formating?
This example is working for me: https://jmbuhr.de/quarto-molstar/presentation.html#/local-pdb-file One step you can do for debugging is opening the developer tools (ctrl+shift+i in chromium bases browsers) and checking the console for things like:
This is what happens if I change the path to point to a non-existent file.
If this issue doesn't appear locally but only when deploying a website/document it may be a case of: https://github.com/jmbuhr/quarto-molstar/issues/7
I think quarto has recently added more functions for plugins to discover resources, so I should revisit this and add the resources automatically.
If this doesn't work, can you send the pdb file? The pdb specification can indeed be a bit wild
Thanks a lot will give it a try.
So, I tried (and made sure files exist).
Reusing the headers from above (w/o to: xxx
line), the problem still exists.
If I render to standard HTML everything works but with revealjs, it does not (see below *.qmd
file and image).
---
title: "t"
subtitle: 't'
author: "t"
date: "2023/09/15"
format:
revealjs:
theme: [serif,style.css]
smaller: true
molstar: embed
---
{{< mol-url ./pdbs/1F16.pdb >}}
It is simply the pdb file of rcsb.org/structure/1f16
.
The behaviour is the same w/ and w/o molstar:embed
.
It is independent of 'locally' opening the file w/ browser or through a local standard webserver w/ python -m http.server
.
As the PDB is directly from the rcsb, I fear it may not be a PDB spec problem (NMR structure w/ only protein).
due to the cross origin policy
mentioned in your screenshot, the pdb file will only be available if served from a webserver., not if you just open the html file with a browser. Can you confirm that it also works for you with quarto preview
?
For a presentation I would recommend to use quarto preview
during the presentation as well, or upload to GitHub pages beforehand.
And I may have misled you a bit with molstar: embed
, as this option does not currently work with presentations due to some interaction with the iframes I have to create when it is a presentation.
If you want to make it work with the simple python http server you'll have to server the whole directory, not just the html file:
Of course, don't do that if there is anything in the folder you don't want to be publicly accessible, since this is exactly what the cross origin policy protects against ;)
Looks like they have improved some of their documentation for options: https://github.com/molstar/pdbe-molstar/wiki/1.-PDBe-Molstar-as-JS-plugin
Although I have just realised that this is the pdbe fork of molstar, which might be a good place to look for documentation for base molstar.
Thanks a lot for all the help @jmbuhr, sorry for the late reply. I guess the problem was again between chair and keyboard ;)
As most of the time I am presenting from my own laptop, I will just open a local webserver with the folder. That was the trick that made it work.
Hey, I love this plugin for quarto.
But I have following issue: Molstar does not load any structure when rendering quarto to revealjs.
See below a minimal working example for html (working) and revealjs export:
Maybe I am doing something wrong? Thank you for your help :)
quarto version: 1.3.450 plugin: v0.1.2