Exercises
Exercises
Exercise 1: Customising Quarto outputs
- Create a Quarto document which outputs to HTML format.
- Include some text and a code block (in a programming language of your choice).
- Edit the YAML to use one of the Bootswatch themes. See quarto.org/docs/output-formats/html-themes.html for options.
- Further edit the YAML to change the
linkcolor
. - Bonus: edit other YAML options to customise further.
Solution
Exercise 2: Using style files
- Create a
styles.scss
file. - Add the
styles.scss
file to the YAML options in your Quarto file. - Create some CSS variables and write some simple CSS rules in the
styles.scss
file.
Solution
Exercise 3: Styling with Quarto extensions
- Install the
LCARS
template by Michael McCarthy usingquarto add mccarthy-m-g/quarto-lcars-theme
. - Edit the YAML of your
.qmd
file to use the extension. See github.com/mccarthy-m-g/quarto-lcars-theme for more information. - Re-render your document.
- Bonus: browse the Awesome Quarto list and choose a different extension: github.com/mcanouil/awesome-quarto
Solution
Run:
quarto add mccarthy-m-g/quarto-lcars-theme
Exercise 4: Building your own Quarto extension
- Create an
_extensions
folder in the same directory as your.qmd
file. - Create another folder inside the
_extensions
for your extension e.g.PrettyHTML
. - Move your
styles.scss
file from Exercise 2 into thePrettyHTML
folder. - Create an
_extension.yml
file in thePrettyHTML
folder. - Write the YAML code specifying the extension title, author name, version number, and contribution (HTML format with the
styles.scss
styling). - Edit the YAML in the
.qmd
file to use this extension.