In this practical exercise, you will enhance your skills in creating, managing, and publishing documentation using Quarto. You will set up a local Quarto website, customize its content, and publish it to GitHub Pages.
- Create a local Markdown Quarto website
- Modify the website by adding call-outs, new pages, basic formatting, and layout
- Implement Website Navigation
- Include Mermaid diagrams
- Configure the
_quarto.ymlfile - Set up a Git repository and link it to a GitHub remote repository
- Publish the website to GitHub Pages
- Reference Documentation:
- Quarto Markdown: basics
- Welcome to Quarto®
- Creating a Website
- Website Navigation
- [GitHub Pages](GitHub Pages – Quarto)
- [Page Layout](Page Layout – Quarto)
- [Markdown Basics](Markdown Basics – Quarto)
- Mermaid, Diagramming and charting tool
-
Install Quarto if you haven't already. Follow the installation instructions on the Creating a Website.
-
Create a new Quarto project using the command:
quarto create-project my-quarto-site
-
Navigate to the newly created project directory:
cd my-quarto-site
-
Add Call-outs:
-
Use call-outs to highlight important information. For example:
::: callout This is an important note. :::
-
-
Create New Pages:
-
Add new Markdown files to create additional pages. For example, create a
about.mdfile and add it to_quarto.yml:# About This is the about page.
-
-
Basic Formatting and Layout:
-
Use Markdown syntax to format your content. For example:
# Heading ## Subheading This is a paragraph with *italic* and **bold** text.
-
Customize the layout by editing the
_quarto.ymlfile.
-
-
Configure the navigation menu by editing the
_quarto.ymlfile. For example:nav: - Home: index.qmd - About: about.qmd - Contact: contact.qmd
-
Install the Mermaid extension for Quarto if you haven't already. Add the following to your
_quarto.ymlfile:extensions: - mermaid
-
Include Mermaid diagrams in your Markdown files. For example:
``` mermaid graph LR A[Client] --> B[Load Balancer] B --> C[Server1] B --> D[Server2]
--- title: Animal example --- classDiagram note "From Duck till Zebra" Animal <|-- Duck note for Duck "can fly\ncan swim\ncan dive\ncan help in debugging" Animal <|-- Fish Animal <|-- Zebra Animal : +int age Animal : +String gender Animal: +isMammal() Animal: +mate() class Duck{ +String beakColor +swim() +quack() } class Fish{ -int sizeInFeet -canEat() } class Zebra{ +bool is_wild +run() }
-
Customize the site's metadata, theme, and other settings in the
_quarto.ymlfile. For example:title: "My Quarto Site" author: "Your Name" theme: [journals]
-
Initialize a Git repository in your project directory:
git init
-
Add all files to the repository:
git add . -
Commit the changes:
git commit -m "Initial commit" -
Create a new repository on GitHub and link it to your local repository:
git remote add origin https://github.com/your-username/your-repo-name.git git push -u origin main
-
Configure GitHub Pages to serve your Quarto site. Go to your repository settings on GitHub, navigate to the "Pages" section, and select the branch you want to use (e.g.,
main). -
Use the Quarto command to render and deploy your site to GitHub Pages:
quarto publish gh-pages
Here is an example of how your project structure might look:
my-quarto-site/
├── _quarto.yml
├── index.qmd
├── about.qmd
├── contact.qmd
├── .gitignore
└── .git/
And an example _quarto.yml file:
title: "My Quarto Site"
author: "Your Name"
theme: [journals]
nav:
- Home: index.qmd
- About: about.qmd
- Contact: contact.qmd
extensions:
- mermaid- Fork the existing repository (if applicable) or create a new one on GitHub.
- Create a new branch named
MF01-PRA01-YourNameAndSurnamefrom the latest commit. - Implement the required changes and tests.
- Commit your changes with clear, descriptive messages.
- Push your branch to your forked repository.
- Create a pull request to the original repository (if applicable) with a summary of your changes and title:
MF01-PRA01-YourNameAndSurname-PublishingQuartoDocumentation- Example: F01-PRA01-EmmaMoskovitz-PublishingQuartoDocumentation
- Correct setup and configuration of the Quarto website
- Proper use of call-outs, new pages, basic formatting, and layout
- Effective implementation of Website Navigation
- Inclusion of Mermaid diagrams
- Correct configuration of the
_quarto.ymlfile - Successful setup of a Git repository and GitHub remote repository
- Successful publication of the website to GitHub Pages
- Code clarity and documentation quality
- Adherence to best practices for Quarto and GitHub Pages
Remember to focus on creating a well-structured and visually appealing Quarto website that demonstrates good documentation practices. Good luck!