title |
---|
SIH Quarto Training template |
This repository can serve as a template for making materials from:
- Jupyter notebooks aka
.ipynb
files - R content -
.qmd
files, which mix R (and Python via reticulate, if needed) and md sections - Plain old
.md
files
(see instructions below)
To:
- Support this cross-language functionality
- Keep the repo as lean as possible
- Ensure as little unexpected behaviour as possible, please:
- 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.
While GitHub actions seem like an amazing enhancement, we often develop materials that use custom libraries, renv or conda environments, docker builds etc.
So if you'd like to use actions: PLEASE:
- Create your custom training workshop repository for your content
- Delete what you don't need from this template
- Create your custom actions script
- Add a note to the bottom of this readme linking to your actions page, so others can use it as an example when creating training using a similar combination of environments and language - THIS REPO IS GENERIC BY DESIGN.
- We recommend storing all notebooks (.ipynb) or R files (as .qmd or .rmd) in the
notebooks
folder.
All languages/sources:
- Use the big green button "Use this template" this repository
- Edit
index.qmd
to change the main landing page. This is basically a markdown file. - Edit or create
setup.qmd
to change the Setup instruction pages. Same - basically a md file. - Edit
_quarto.yml
to change the dropdown menu options. - Add additional
*.md
files to the root dir to have them converted to html files (and add them to_quarto.yml
to 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 push
You 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.)
- You will need to have Jupyter and Quarto installed to convert the notebooks and render them for the web.
- [Recommended, not essential] Use VSCode's Quarto Extension to render the project (recommended b/c it's easier/nice).
- Delete
notebooks/01b-exampleRcontent.qmd
and01c-exampleMDcontent.md
- Create notebooks in the
notebooks
folder (for examplenotebooks/1_cont.ipynb
). Have a look at what the syntax for Challenges, Objectives, Key Points and Questions is supported in01a-fundamentals.ipynb
, and use similar syntax across other notebooks where needed. - Execute all the cells in your Jupyter notebook(s) until you're happy with the output/
- Add links to your content to the navigation configuration in
_quarto.yml
. For example, to link to the rendered page fornotebooks/1_cont.ipynb
, add a link tonotebooks/1_cont.html
in_quarto.yml
Note:
The building from Jupyter notebooks will NOT re-render all of the notebooks unless you use the quarto render notebook.ipynb --execute
command
.qmd
is called "Quarto Markdown", and basically works just like Rmd.- If using R, you will need rmarkdown, xml2 and X to have the notebooks generate properly and link out to the documentation, as specified in the
_quarto.yml
file. - Building from R will by default re-render all of the outputs.
- Delete
notebooks/01a-fundamentals.ipynb
,environment.yml
and01c-exampleMDcontent.md
- Create notebooks in the
notebooks
folder (for examplenotebooks/1_cont.qmd
). Have a look at what the syntax for Challenges, Objectives, Key Points and Questions is supported in01b-exampleRcontent.qmd
, and use similar syntax across other .qmd 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.qmd
, add a link tonotebooks/1_cont.html
in_quarto.yml
- Type
quarto render
in the Terminal in RStudio (not the R command line, the Terminal tab!) - or use the buttons.
- Delete
notebooks/01a-fundamentals.ipynb
,01b-exampleRcontent.qmd
andenvironment.yml
- Create files in the
notebooks
folder (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.html
in_quarto.yml
- Type
quarto render
in the terminal - or use VSCode's "Render Quarto project' command using the command pallette instead.