- Do not under any circumstances commit to the main branch without review by someone else;
- Fork the repository, make and test changes, then put in a pull request;
- Please do not add GitHub actions or other "enhacements" that only work for your favourite programming language or workflow, and/or require a lot of extra files to work.
We recommend the following structure for all published content:
- Store
index.qmd,setup.qmdfiles in the root directory - Store notebooks (.ipynb), R files (as .qmd or .rmd), and markdown lessons (.qmd or .md) in the
notebooksfolder - Store figures in a
figsfolder
For all languages/sources:
- Use the big green button "Use this template" this repository
- Edit
index.qmdto change the main landing page. This is basically a markdown file. - Edit or create
setup.qmdto change the Setup instruction pages. Same - basically a md file. - Edit
_quarto.ymlto change the dropdown menu options. - Add additional
*.mdfiles to the root dir to have them converted to html files (and add them to_quarto.ymlto make them navigable), if you'd like. - Edit this Readme in your fork to reflect the content of your workshop.
If you want to use the command line instead of VSCode/RStudio (as described below), run the below commands (after activating the correct Python environment, if needed)
quarto render
# First time you create the file, add them to be tracked by github, e.g.
git add docs/*
git commit -am "your comments"
git pushYou can browse the result locally by exploring the html files created (note: sometimes figures display locally but not on web and the other way around too.)
- Delete
notebooks/01a-fundamentals.ipynb,01b-exampleRcontent.qmdandenvironment.yml - Create files in the
notebooksfolder (for examplenotebooks/1_cont.md). Have a look at what the syntax for Challenges, Objectives, Key Points and Questions is supported in01c-exampleMDcontent.md, and use similar syntax across other .md files where needed. - Add links to your content to the navigation configuration in
_quarto.yml. For example, to link to the rendered page fornotebooks/1_cont.md, add a link tonotebooks/1_cont.htmlin_quarto.yml - Type
quarto renderin the terminal - or use VSCode's "Render Quarto project' command using the command pallette instead.
To publish Quarto websites to GitHub pages, you can:
- Render sites on your local machine (see above)
- Use the
quarto publishcommand - Use GitHub Actions
Enable GitHub pages in your repository settings:
- Go to GitHub repository settings
- Scroll down to "GitHub Pages" section and select the following:
Source: deploy from a branchBranch:mainDirectory: /root
Save
Run the quarto publish command (assuming you are working in terminal)
quarto publishYour Quarto project will be rendered at a URL with this format:
https://pages.github.sydney.edu.au/informatics/<NAME-OF-YOUR-REPO>/Here are some example actions.
Add this action to automatically quarto render && quarto publish. Only works well if your repo uses markdown files exclusively, cannot execute python/R code for example. In the current form, it expects "Github Pages" to be deployed on the gh-pages branch from /(root), i.e. the standard configuration.
# Example from https://github.com/quarto-dev/quarto-actions/blob/main/examples/quarto-publish-example.yml
name: Quarto Publish
on:
push:
branches: main
jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
with:
tinytex: true
- name: Render Quarto Project
uses: quarto-dev/quarto-actions/render@v2
- name: Publish to GitHub Pages (and render)
uses: quarto-dev/quarto-actions/publish@v2
with:
target: gh-pages
If you'd like to use a more generic and possibly neutral theme, go to the _quarto.yaml and change the format section to:
format:
html:
toc: true
theme:
light: flatly
dark: darkly
css: styles.scss
code-link: true
code-fold: falseIf you'd like to use the USYD Masterbrand Ochre, go to the _quarto.yaml and change the format section to:
format:
html:
theme: simplex
css: [lesson.css, bootstrap-icons.css]
toc: true
code-overflow: wrap
highlight-style: github