Skip to main content

My favorite Quarto extensions

My favorite Quarto extensions - Learn about essential Quarto filters for partial content templating, Font Awesome icons, including external code files, and simple search-replace macros to enhance your documentation workflow.

· 5 min read
View raw
Christophe
Markdown, WSL and Docker lover ~ Insatiable curious.
Cet article existe aussi en français — lire la version française.

Changelog

Latest
Note about extension include-code-files

My favorite Quarto extensions

⚡
TL;DR

This article shares a curated list of the author's favorite Quarto extensions to enhance your documentation workflow. Discover useful filters for templating content with quarto-partials, embedding icons with fontawesome, including external code snippets, creating simple text-replacement macros with search-replace, and improving code block visibility in reveal.js presentations with code-fullscreen.

I've been using Quarto for 18 months now to generate my documentation: I'm writing Markdown files (.md) and converting them to a Word document, PDF, static HTML site or a revealjs slideshow. If Quarto is new to you, Running Quarto Markdown in Docker gets you a working setup in minutes.

Quarto is supporting external extensions (also called plugins elsewhere).

Below a list of a few I'm using.

gadenbuie/quarto-partials​

See https://github.com/gadenbuie/quarto-partials/tree/main

When I come to this extension, my need was: I've coded more than 60 functionalities and I need to document them. Each will have the same look&feel like a Description chapter, a How to run?, How to configure?, Remarks and so on.

Sometimes the text will be exactly the same (like a generic text) and, in some cases, almost the same: the How to configure? chapter will have the same sentences except I've to replace some placeholders (like the name of the feature, the name of the configuration file, ...)

In other terms: I need to be able to write some page template and inject specific content to it. I wish that my 60 functionalities pages look the same and if I need to change one global text, I have to do it in a central place.

Partial content is perfect here. Based on their documentation, it's similar to Mustache.

Example​

Let's create a file called _hello.md with this content:

Hello, {{ name }}!

Then, in any file, we can do:

{{< partial _hello.md name="John" >}}

Make sure to add lines below in your YAML front matter:

filters:
- quarto-partials

We can pass variables like here above but, more powerful, we can declare a partial-data key in our YAML frontmatter.

If you want to go much further with this extension (conditional blocks, raw content, a real-world documentation use case), I've written a dedicated deep dive: Using Mustache templating with Quarto.

quarto-ext/fontawesome​

See https://github.com/quarto-ext/fontawesome

Use Font Awesome icons in HTML and PDF documents.

For instance, if you want a GitHub icon, you just need to put the {{< fa brands github size=5x >}} code in your file. Quite easy.

Make sure to add lines below in your YAML front matter:

filters:
- fontawesome

quarto-ext/include-code-files​

Is this still needed?

Not sure this addon is still needed: in one of my documentation, I've used it like this:

```{.yaml include="files/.gitlab-ci.yml"}
```

It was working as expecting but during the generation of a .docx file (MS Word), the included file was missing.

I've then use the native shortcode like below and, now, it works both for .html and .docx.

```yaml
{{< include files/.gitlab-ci.yml >}}
```

See https://github.com/quarto-ext/include-code-files

The objective is to be able to include external file by using the syntax below:

```{.bash include="documentation/chapter_1/install.sh"}
```

Make sure to add lines below in your YAML front matter:

filters:
- include-code-files

quarto-ext/search-replace​

See https://github.com/ute/search-replace

Quarto filter extension for simple search-replace macros.

This extension allows you to search and replace when rendering documents. For instance, by putting the +quarto code in the frontmatter of the article or, better, in the _quarto.yaml global file, we can just write +quarto (a constant) in our document and let the replace action be done during the rendering of the documentation.

search-replace:
+quarto: "[Quarto](https://quarto.org)"

This is a YAML configuration for a search-replace operation that adds a new entry. It defines that wherever the word 'quarto' appears, it should be replaced with a markdown-formatted link '[Quarto](https://quarto.org)' that points to the Quarto website.

Make sure to add lines below in your YAML front matter:

filters:
- search-replace

Example​

Below how to use it. It's simple; just write the name of your constant and during the rendering of your document, the constant will be replaced by the predefined value. Easy!

I'm using +quarto and I love it

shafayetShafee/code-fullscreen​

See https://github.com/shafayetShafee/code-fullscreen

This extension is for revealjs slideshow.

If you have a very long block of code, revealjs will not display all lines and thus, the code will be truncated (like only the first 25 lines will be displayed).

By adding the filter below to your YAML frontmatter, a small Full screen button will be displayed at the top right of the block code.

filters:
- code-fullscreen

🦋 Join the conversation on BlueskyRequires a free Bluesky account to like, repost or comment. This block talks to Bluesky's public API directly from your browser (no cookies, no sign-in) — that means your IP address reaches Bluesky's servers just by this section loading.

Loading comments…

Was this article helpful?