Author

Zoë Turner

Published

February 24, 2024

Modified

February 24, 2024

The story so far

A few years ago Mohammed A Mohammed, who was integral to getting NHS-R Community set up, suggested I might like to get involved by creating a website for NHS-R Community. At that time I had no idea where to start so my involvement stalled and a website was built, with help from a 3rd party, in WordPress. WordPress is a great website tool that can support very complicated sites like NHS-R Community’s, as we have both a static site and an Events Management system which means that we don’t need to rely (or pay!) for Eventbrite. We’ve used the system for sign up to hundreds of webinars and workshops, not to mention several hundred people attending conferences over the years.

Moving to purely coded websites

In the time it’s taken from that initial suggestion about building the website to now, where I help to manage the site, I’ve had the opportunity to build websites for myself using {distill} and Hugo Apéro as well as the release of Quarto which I was incredibly keen to try out for website creation.

I’d used Quarto for slides and reports and been hugely impressed with it. Getting started with Quarto is relatively easy if you’ve coded for a while, but like with anything, you have to start off at the basics and quickly want more complex functionality as you get going. This is even more of an issue when you are moving from one system to another and it’s more of a translation than a build-from-scratch project.

Although Quarto has come from the R side of coding it can be used by any other language coder as it supports Python, Julia and Observable. Quarto output can be built in RStudio but equally as easily in other programs like VS Code.

Luckily for me, many people had already jumped into Quarto websites and their code was available online to delve into. I particularly was keen to follow the work of the Brian Tarran for the Royal Statistical Society’s Real World Data Science website because, at first glance, this doesn’t give itself away as being built on Quarto! And I also really like Silvia Canelón’s personal blog site for its beauty and functionality. Silvia has particularly worked hard on accessibility of her website and has written a lot of CSS code which I’m learning through what she has shared.

Accessibility is something that the WordPress site needed considerable work on, particularly when checked with a website called the Web Accessbility Evaluation Tool which Silvia recommends on her blog site. The new Quarto site will need this too of course but now that the code is out in the open, anyone can contribute. That can be either making changes to the code but also highlighting problems as issues that can then be open to everyone to view.

Benefits to Quarto

Accessibility

I’ll mention accessibility again as that’s hugely important and I like the fact that the people working on Quarto also think a lot about accessibility. Adding alt text has never been easier and any code (in the YAML) that refers to an image nearly always has functionality to add image alt text too.

Search functionality

The search function for Quarto books is really impressive and the same functionality can be found in Quarto websites. There might be a plug in within WordPress to make searching through blogs for particular words but with Quarto it’s not something that needs adding - it’s there from the start. I now no longer have to think about tags or categories for blogs to make them easier to find (and then remember them to find the blogs which is the trickier part for me!).

Formatting code

This was a bit of a niggle with WordPress in that it’s not really a website for coders to show their code examples (although there may be a plug in for that!). Quarto handles code snippets and examples by beautifully formatting it to look different to text but also runs the code for you if you want. It’s meant that the charts that are talked about in some blogs are produced as the code is run, not as static pictures that also can’t be copied easily as a picture doesn’t give the functionality for highlighting to copy.

Usually a blogger will choose a nice image to complement their writing and Quarto gives that functionality but I had a lovely surprise when charts that are created by the blog code became the thumbnail image automatically.

Open to contribution

Having a website that can publish R or Python code is an absolute joy. I used to write blogs in RMarkdown, render them to html and then copy the output to WordPress and in the copying and pasting often lost links or formatting.

Being open to contribution of course also means that the repository will be available to people to do pull requests. I’ve set the repository so that it’s not necessary to Render the website to contribute so any additions or changes just need to be made to the qmd files.

A chance to delve into history

Now this point could have come from any change in website but I’ve taken the opportunity to go through each blog and transfer it to Quarto. There are no doubt quicker ways to do this as I can export from WordPress and then work on code to to get it to a format that can be published, but I started with moving a couple of blogs to get started and I’ve really enjoyed this even though it takes a bit more time to do.

Starting in 2018 when the blogs first started I didn’t know R at all. I started learning with NHS-R Community so these early blogs meant very little to me at the time. As I’ve gone through each blog, formatting them and checking the R code runs (I found a couple of tiny mistakes this way) and the links still work I’ve been more like an archivist than a coder. My favourite discovery, and shock, was that I found that RAP (Reproducible Analytical Pipelines) was shared with the NHS-R Community in 2018 although I only really heard about it from 2020. It was very much like the moment I experienced when I went through my old Geography school books and found I’d been taught in those lessons about Index of Multiple Deprivation (IMD) but I had absolutely no recollection of it at all! It hadn’t been the right time for me to really hear about it and yet in time, it’s become something that I now really love working with. You can read more about IMD in a Quarto collaborative book for NHS-R Community called Health Inequalities.

Contributions are welcome!

Knowing where to start with contributions can be a barrier so I’ve written out a few things to try to help people do this. Firstly, our Quarto book (yes another one - they are additive be warned!) Statement on Tools includes some technical appendices including Contributing to GitHub repositories.

If you want to get involved with the NHS-R Community more generally we are building on the NHS-R Way which essentially documents the community. We’ve got a number of activities listed out and these are all open to get involved with, or set up something else.

We can be found, as a community, in Slack and our central email is nhs.rcommunity@nhs.net.

Back to top

Reuse

CC0

Citation

For attribution, please cite this work as:
Turner, Zoë. 2024. “Building a Quarto Website for NHS-R Community.” February 24, 2024. https://nhs-r-community.github.io/nhs-r-community/blog/building-a-quarto-website.html.