Setting Up of Quarto

Siju Swamy

Saintgits

Step-by-step procedure

Step 1: Install Python

  1. Download and Install Python
    • Go to the official Python website.
    • Download the latest stable version of Python suitable for your operating system (Windows, macOS, or Linux).
    • Run the installer and ensure you check the box to “Add Python to PATH” during installation.
    • Follow the on-screen instructions to complete the installation.

Step 2: Install Visual Studio Code (VS Code)

  1. Download and Install Visual Studio Code (VS Code)
    • Visit the official VS Code website.
    • Download the installer for your operating system.
    • Run the installer and follow the prompts to install VS Code.
    • After installation, open VS Code and install the recommended extensions:
      • Python Extension: Search for “Python” in the Extensions view (Ctrl+Shift+X) and install it.
      • Quarto Extension: Search for “Quarto” in the Extensions view and install it.

Step 3: Install Quarto CLI

  1. Download and Install Quarto CLI
    • Visit the Quarto CLI download page.

    • Download the latest stable release of Quarto CLI for your operating system.

    • Run the installer and follow the on-screen instructions to complete the installation.

    • After installation, verify that Quarto CLI is correctly installed by opening a command line interface (Terminal on macOS/Linux, Command Prompt or PowerShell on Windows) and typing:

      quarto --version

Step 4: Install Git for CI/CD

  1. Download and Install Git
    • Visit the official Git website.
    • Download the installer for your operating system.
    • Run the installer and follow the prompts. You can use the default settings for most options.
    • Ensure Git is added to your system PATH by checking the appropriate option during installation.
  2. Configure Git
    • Open your command line interface (Terminal on macOS/Linux, Command Prompt or PowerShell on Windows).

    • Configure your Git username and email:

      git config --global user.name "Your Name"
      git config --global user.email "your.email@example.com"
    • Verify the installation by checking the Git version:

      git --version

Literate Programming Workflow

---
 Literate Programming Workflow
---
graph TD
    A[Python] -->|Code Execution| B[Quarto CLI]
    B -->|Document Rendering| C[Technical Documents]
    B -->|Document Rendering| D[Blogs]
    B -->|Document Rendering| E[Websites]
    E -->|Host| F[GitHub Pages]
    G[Git] -->|Version Control| C
    G -->|Version Control| D
    G -->|Version Control| E
    G -->|CI/CD| F

    subgraph Development
        A
        B
        G
    end

    subgraph Output
        C
        D
        E
        F
    end

    style Development fill:#f9f,stroke:#333,stroke-width:2px
    style Output fill:#ccf,stroke:#333,stroke-width:2px

Creating Your Personal Website

Step 1: Clone the Website template respository from Github

Copy the following Github repo url and clone using Vscode source control.

https://github.com/sijuswamy/Website-Template

Step 2: Open the folder in the VScode and change and update the necessary details and content.

Use any of the following options to create your personal website designed in Quarto.

# preview as html
quarto preview index.qmd

# preview as pdf
quarto preview index.qmd --to pdf

# preview a jupyter notebook
quarto preview index.ipynb

Rendering

You can use quarto render command line options to control caching behavior without changing the document’s code. Use options to force the use of caching on all chunks, disable the use of caching on all chunks (even if it’s specified in options), or to force a refresh of the cache even if it has not been invalidated:

# use a cache (even if not enabled in options)
quarto render example.qmd --cache 

# don't use a cache (even if enabled in options)
quarto render example.qmd --no-cache 

# use a cache and force a refresh 
quarto render example.qmd --cache-refresh