Dynamically creating a quarto table from yaml metadata

I'm exploring using Quarto to manage and maintain our organisation's data dictionary.

To do this, I would like to dynamically create portions of the Quarto pages, to ensure they stay in sync with the truth. The metadata I would like to use is currently in yaml form, in a separate git repo.

Is there a workflow for this, or has anyone done similar? I guess we will need a pre-processing step to strip out and replace portions of the .qmd files before each new render. Or is there a way to achieve this natively within Quarto?

Thanks!

We have about 200 definitions live currently, and I guess close to 1000 when this rolls out more widely. Very interested in how others might have used quarto / rmarkdown to keep users in touch with underlying technical details, without duplicating info / metadata.

What Quarto does is to compile an HTML/CSS/JS static webpage from formating markup and interleaving it with output from code chunks to create a big static webpage where the content doesn't change between updates. All the host server does is to take the HTTP request and serve up the content unchanged from the time it was originally transferred.

This contrasts with services like Python's Djanjo that uses an SQL database as a backend to read content continuously as it is updated without regenerating the whole site. Query operations are translated to SQL language, sent to the SQL server, brought back, reformatted and served up. Quarto can be set up to do searches and table sorts, those are "internal" to the document as it comes off the knitting machine.

For serving dynamic web content, R has other tools such as the R/Apache Integration project, which embeds the R interpreter inside the Apache 2.0 web server. This allows for the creation of web applications in R, with the ability to handle HTTP requests and responses.

If the update frequency is relatively low, just knitting the updated document and posting it is most of what's required. The qualification could be a hiccup with flushing the client-side browser cache so that the updated content is requested. It's been like 25 years since I've had to worry about this and likely the HTTP ecosystem has developed tools to address cache invalidation, but it's something to keep in mind.

In sum, just do something like reading in your dictionary as csv and spitting it out as html tables should work.

1 Like

Thanks, that's a really helpful way to frame this problem. I have not thought about this in the web context.

My 1000 pages could actually be 1 page 1000 different times if they are entirely dynamic.

I was stuck thinking about this as individual pages, with some dynamic content on each.

2 Likes

Yeah, definitely easier to provide for filter/scroll on single page!

1 Like

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.