for the Julia Community
Friday, July 12, 2024
Simple Quarto extension that adds a Julia-themed touch to your documents.
Extensions are a powerful way to modify and extend the behavior of Quarto.
To install the Julia-themed Quarto extensions, run:
Simply adjust the Quarto header of your document:
monospace
text and code
.Inline code looks like this print("hello 🌍")
. Code blocks look like this (Revealjs not affected):
using CounterfactualExplanations, TaijaData
# Data and Classifier:
counterfactual_data = CounterfactualData(load_linearly_separable()...)
M = fit_model(counterfactual_data, :Linear)
# Select random sample:
target = 2
factual = 1
chosen = rand(findall(predict_label(M, counterfactual_data) .== factual))
x = select_factual(counterfactual_data, chosen)
# Counterfactual search:
generator = GenericGenerator()
ce = generate_counterfactual(x, target, counterfactual_data, M, generator)
Note
This is a note in julia_blue. Icons are deactivated in Revealjs.
Tip
This is a tip in julia_green.
Caution
This is a caution callout in julia_purple.
Warning
This is a warning in julia_purple.
Important
This is an important callout in julia_red.
Write tutorials in Quarto that fully integrate into the rendered documenation.
Tutorials that are
Documenter.jl
)
.qmd
) for a package in tutorials/
.md
) into docs/src/tutorials/
_quarto.yml
in tutorials/
:
quarto render file.qmd
quarto render
in tutorials/
renders all but !
tutorials/_freeze
project:
title: "My Tutorials"
output-dir: ../docs/src/tutorials
render: # specify some
- "*.qmd"
- "!NotThisFile.qmd"
format: #render to md
commonmark:
variant: -tex_math_dollars
wrap: preserve
Tip. Use the
Quarto VS Code extension
and the command Quarto Preview
CondaPkg.jl
to handle/install Python, creating a CondaPkg.toml
specifying the Python versionAnd include rendering the tutorials in your make.jl
On CI: Set up caches:
- name: Cache Quarto
uses: actions/cache@v4
with:
path: tutorials/_freeze # Quarto Cache
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('tutorials/*.qmd') }}
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}-
- name: Cache Documenter
uses: actions/cache@v4
with:
path: docs/src/tutorials # Cache rendered tutorials
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('tutorials/*.qmd') }}
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}-
Cached, reproducible tutorials within Documenter.jl
.
Cache vs. breaking versions of the package
Recommendation: Maybe print package versions
Quarto replaces spaces in markdown links
[A](@ref B)
with [A](@ref%20B)
.
These have to be “escaped”:
`[A](@ref B)`{=commonmark}
Due to pandoc:
for now write math in $...$
and not ``...``
@ref
from Documenter.jl
[citekey](@cite)
from DocumenterCitations.jl
@extref
from DocumenterInterLinks.jl
QuartoNotebookRunner.jl
should provide native rendering in pure JuliaThe quarto-juliacon-proceedings extension adds support for writing a JuliaCon Proceedings article in Quarto.
To install the JuliaCon Proceedings extension, run:
Disclaimer
PDF version resembles the official JuliaCon Proceedings format almost exactly but it is not officially endorsed by the JuliaCon Proceedings team.
See this issue.
JuliaCon Proceedings to set an example for reproducibility:
Benefits for the authors: