{"id":13791021,"url":"https://github.com/jmbuhr/quarto-molstar","last_synced_at":"2025-04-28T21:32:16.251Z","repository":{"id":50702655,"uuid":"519823494","full_name":"jmbuhr/quarto-molstar","owner":"jmbuhr","description":"Shortcode to embed proteins and trajectories with Mol*","archived":false,"fork":false,"pushed_at":"2024-05-06T14:12:04.000Z","size":8295,"stargazers_count":44,"open_issues_count":4,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-05T11:13:11.329Z","etag":null,"topics":["quarto","quarto-extension"],"latest_commit_sha":null,"homepage":"https://jmbuhr.de/quarto-molstar/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jmbuhr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-07-31T16:06:49.000Z","updated_at":"2025-03-20T20:12:03.000Z","dependencies_parsed_at":"2024-01-05T23:46:22.171Z","dependency_job_id":"30736484-97fb-49a2-9e3e-33caa41ae4ed","html_url":"https://github.com/jmbuhr/quarto-molstar","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmbuhr%2Fquarto-molstar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmbuhr%2Fquarto-molstar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmbuhr%2Fquarto-molstar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmbuhr%2Fquarto-molstar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jmbuhr","download_url":"https://codeload.github.com/jmbuhr/quarto-molstar/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251391273,"owners_count":21582141,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["quarto","quarto-extension"],"created_at":"2024-08-03T22:00:54.428Z","updated_at":"2025-04-28T21:32:11.231Z","avatar_url":"https://github.com/jmbuhr.png","language":"JavaScript","funding_links":[],"categories":["Extensions"],"sub_categories":[],"readme":"# Molstar (Mol*) Extension for Quarto\n\nThis extension provides shortcodes for [molstar](https://github.com/molstar/molstar) in quarto.\nMolstar can display macro-molecules such as proteins as well as molcular dynamics trajectories in an interactive viewer.\nYou can see it in action e.g. in the RCSB Protein Data Base: \u003chttps://www.rcsb.org/\u003e, where it provides the 3d view for entries.\nFollow me, if you want this right in your quarto reports (html only).\n\n## Installing\n\n```sh\nquarto install extension jmbuhr/quarto-molstar\n```\n\nThis will install the extension under the `_extensions` subdirectory.\nIf you're using version control, you will want to check in this directory.\n\n## Using\n\nUsage examples are in `index.qmd`, which you can see rendered locally and served with GitHub pages here: \n\u003chttps://jmbuhr.de/quarto-molstar/\u003e\n\nLikewise, the example rendered as a revealjs presentation (`presentation.qmd`) is served here:\n\u003chttps://jmbuhr.de/quarto-molstar/presentation.html\u003e\n\n## Limitations\n\n- Self-contained htmls:\n  Molstar viewers for local files are empty when the file is **not** served by a webserver such as `quarto preview` or GitHub pages.\n  This means it will not display your molecule when you simply open the rendered html with a browser,\n  even if you set the html to be self-contained.\n  The reason for this is the [Same-origin Policy](https://developer.mozilla.org/en-US/docs/Glossary/Same-origin_policy), a security measure in web browsers.\n  It and similar policies prevent that one document can access resources it is not supposed to access.\n  For example, an html document you downloaded is not allowed to execute code that reads personal files on your computer.\n  This also prevents it from loading your molecules from local paths.\n\n  For plain text formats in the `mol-url` shortcode, such as `pdb` and `xyz`, you can enable a custom option that circumvents this limitation \n  by embedding them straight into the html as a string.\n  Add `molstar: embed` to your yml frontmatter to use this.\n- Resources like local structures that have to be loaded need to be added manually via \u003chttps://quarto.org/docs/reference/projects/core.html\u003e in order to be copied to the publish directory until support for automatic resource discovery (\u003chttps://github.com/jmbuhr/quarto-molstar/issues/7\u003e).\n- revealjs presentations now use iframes instead of a normal div to work around https://github.com/jmbuhr/quarto-molstar/issues/1,\n  which is why you might have to address those differently for custom styling if you plan to use the same source for html and revealjs output.\n\n## Update Mol* (extension developement)\n\nThe js and css files where downloaded from the [molstar web viewer](https://molstar.org/viewer/) in order to be up to date but also self-contained and functional without an internet connection. \n\n```bash\ncd _extensions/molstar/assets\nrm molstar.js\nwget https://cdn.jsdelivr.net/npm/molstar@latest/build/viewer/molstar.js\nrm molstar.css\nwget https://cdn.jsdelivr.net/npm/molstar@latest/build/viewer/molstar.css\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmbuhr%2Fquarto-molstar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjmbuhr%2Fquarto-molstar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmbuhr%2Fquarto-molstar/lists"}