Quarto + Observable Framework #9250
Replies: 2 comments 4 replies
-
I am probably missing something, but isn't it already available in Quarto? |
Beta Was this translation helpful? Give feedback.
-
Hey @bradfordjohnson, thanks for your notes! I've gone with a similar approach. I use Quarto's I've only made it work for my case, but I'll leave a link to some notes for people who stumbled upon this page as I did. Feel free to adapt it to your needs! |
Beta Was this translation helpful? Give feedback.
-
TLDR
I would love to easily be able to leverage both the power of Quarto and Observable Framework together in a unified way.
Idea and background information
I use Quarto for my personal portfolio, technical documentation and more. I love it. I recently have tried out Observable Framework for creating dashboards and all I can think about is connecting Observable Dashboards to Quarto projects. Of course Quarto Dashboards exist and it is a very nice feature so please do not take this feature request as disrespectful, I love the Quarto team. I do think the Observable Framework has some interesting features - such as data loaders and continuous deployment for getting updated data / creating snapshots and publishing the site.
I have been able to create a Observable Dashboard within a Quarto Website project and I think even an extension to help configure this like a starter template would be great... I haven't had the time to dive into the extension development process for Quarto, and I'm not yet very experienced in this realm but I'm looking into how to implement one.
How to make an Observable Dashboard a page within a Quarto Site
Assuming you have Node, NPM, Observable Framework and Quarto installed you will want to make a parent directory with 2 children directories, one where you initialize an Observable Framework project, and the other where you create a Quarto website project like so:
The
styles.css
is a copy of the selected theme'scss
being used in Quarto.Next add the navbar code in the
observable-framework-dir/docs/index.md
file.Using
observablehq.config.ts
the output of the build can be set as a child of the/quarto-dir/
and additional configs can be done in this file and in/docs/index.md
in order to use thestyles.css
and format the Observable output as desired.The file structure may look like this now (
/quarto-dir/observable/
is the Observable build output) :Next you can include the build into the Quarto render via the
_quarto.yml
:Leaving you with the combined output Quarto site in
/quarto-dir/docs/
for a GH actions deployment workflow:I'm sure the directories can be cleaned up even more, but this how I got it to work in initial testing/proof of concept.
I believe a template or other extension would be a good way to unify this workflow. For example some quality of life functionalities such as a way to export the navbar code programmatically from Quarto and have it updated in the Observable Framework files, syncing style.css etc.
Even better would be a master YAML file to interact and configure both frameworks.
A smaller feature for Quarto could be the ability to apply configs to already existing
.html
files._quarto.yml
... on Quarto render or preview, if navbar code is not found or out of sync then the html file is appended to /overwritten in the output directory with these change made. Same with supporting files such as paths for assets likestyles.css
and other generated assets / references of assets.Please let me know if you have any questions or feedback. If this is not a priority for the Quarto team I completely understand and I really appreciate your time and dedication to Quarto! As I said I would love to dive into developing an extension or other solutions myself as a side project, but I thought the Quarto team might find this workflow interesting so I wanted to call it out.
Very Respectfully,
Bradford Johnson
Beta Was this translation helpful? Give feedback.
All reactions