Skip to content
Snippets Groups Projects
user avatar
GD authored
261c375c
History
title: "Website template using Quarto"

What is Quarto?

Per the Quarto official website:

Quarto is an open-source scientific and technical publishing system built on Pandoc

  • Create dynamic content with Python, R, Julia, and Observable.
  • Author documents as plain text markdown or Jupyter notebooks.
  • Publish high-quality articles, reports, presentations, websites, blogs, and books in HTML, PDF, MS Word, ePub, and more.
  • Author with scientific markdown, including equations, citations, crossrefs, figure panels, callouts, advanced layout, and more.

Documentation


Creating a website with quarto

  • Command line: quarto create-project <my_website_name> --type website

  • Rstudio new project -> quarto website

Rendering your website from Markdown sources

  • Command line:

    • only build: quarto render <my_website_name>
    • build + preview: quarto preview <my_website_name>
  • Rstudio: Render button to build + preview

  • R console:

Quarto markdown files

Use Quarto markdown (.qmd) files to write your contents, following the standard Markdown syntax with the additional features to run computations, similarly to Rmarkdown.

Running computations

You can include code chunks between ```{r} and ``` markers (with the name of the language between { }), and the code as well as its output will be included, e.g. in R:

x <- seq(0, 10, 0.1)
plot(x, cos(x))

R, Python and Julia programming languages are supported, e.g. in Python:

a = []
for i in range(10):
    a.append(2*i)
print(a)

Note:

  • Running R codes requires the knitr R package.
  • Running Python codes requires the reticulate R package when using Rstudio, and the jupyter Python package when using the command line interface.

Additional tips

You can include markdown (.md) files inside .qmd file with the following {{< include my_file.md >}}.