Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 31 additions & 6 deletions docs/_extensions/mcanouil/atelier/_extension.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
title: Atelier
author: Mickaël Canouil
version: 0.10.5
quarto-required: ">=1.9.36"
version: 0.11.0
quarto-required: ">=1.9.38"
contributes:
project:
project:
Expand Down Expand Up @@ -64,8 +64,8 @@ contributes:
- brand
- html/theme.scss
syntax-highlighting:
light: github-light
dark: github-dark
light: arrow-light
dark: arrow-dark
toc: true
toc-depth: 3
anchor-sections: true
Expand All @@ -74,8 +74,34 @@ contributes:
sidebar-width: 300px
body-width: 1000px
margin-width: 300px
# The embedded extensions under `_extensions/mcanouil/` are named here,
# and Quarto resolves each name to the filters or shortcodes of the
# embedded copy. A project resolves the names in its own `filters` list
# against its own `_extensions/` only. A project that keeps its own copy
# of one of these extensions and names it there runs both copies, and its
# own shortcodes replace the embedded ones.
shortcodes:
- iconify
filters:
- social-metadata.lua
- iconify
- code-window
- gitlink
- toc-depth
- collapse-output
# Each embedded extension keeps its own defaults, set per site under
# `extensions:`, with two exceptions. gitlink shows its repository widget,
# but does not rewrite references in prose. The widget shows only where a
# navbar item or sidebar tool has the href `#gitlink-widget`. Code Window
# draws a window only where a block has a `filename`, and does not make a
# label from the language of every other block.
extensions:
gitlink:
enabled: false
widget:
enabled: true
code-window:
auto-filename: false
include-before-body:
- file: html/scripts/skip-link.html
include-after-body:
Expand All @@ -84,5 +110,4 @@ contributes:
- file: html/scripts/ordinal-dates.html
- file: html/scripts/a11y-fixes.html
- file: html/scripts/navbar-tooltips.html
source: mcanouil/quarto-atelier@0.10.5
source-type: github
source: mcanouil/quarto-atelier@0.11.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Mickaël Canouil

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
schema: 1
sources:
quarto-lua-modules:
origin: "https://github.com/mcanouil/quarto-lua-modules"
fetch: "{origin}/releases/download/{version}/{file}"
version: "2.5.0"
licence: MIT
files:
html.lua:
sha256: "a7aae5e69c4effce399b85e90f3ee3261d0f84a5ac2f6c7ddeb1e358ba22ddc8"
runtime: any
logging.lua:
sha256: "5d99ceb89c813fbe4491310e42b4a4cff62e11dda42f01b4f61f969aa58e0706"
runtime: any
metadata.lua:
sha256: "1186431acc50e35797eef68808e4c52321c845a3be4f29bbd7de695b1db2f6cc"
runtime: any
pandoc-helpers.lua:
sha256: "519cdfa87e0026cfaf754639c8f07faefa4e0d21819f463f8b202448fe0f4d7e"
runtime: any
schema-check.lua:
sha256: "343c4846d4bced229de2b09f84b756051cb4061099787f8001384bce680e2987"
runtime: any
string.lua:
sha256: "7801d2f217e803951313ef86f1f899cb6350a44cbb468b2d7c28dd6911a0fadc"
runtime: any
quarto-wizard:
origin: "https://github.com/mcanouil/quarto-wizard"
fetch: "{origin}/releases/download/{version}/{file}"
version: "2.2.0"
licence: MIT
tag-prefix: schema-v
files:
schema.lua:
sha256: "84e0a5a7bae8d71a6d601d581e3e819ace96613cc76c6e9dd3cf79eee629df78"
runtime: any
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
title: Code Window
author: Mickaël Canouil
version: 1.6.0
quarto-required: ">=1.9.36"
contributes:
filters:
- at: pre-quarto
path: main.lua
- at: post-quarto
path: _modules/hotfix/typst-title-fix.lua
source: mcanouil/quarto-code-window@1.6.0
source-type: registry
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
--- @module "cell-output"
--- @license MIT
--- @copyright 2026 Mickaël Canouil
--- @author Mickaël Canouil
--- @brief Mark the code blocks that hold the output of an executed cell.
--- @description Quarto puts the result of an executed cell in a Div with the
--- `cell-output` classes, and the code block inside carries no language class.
--- A CodeBlock filter sees that block on its own and cannot tell it apart from
--- a fenced block written without a language. This pass marks it while the
--- parent Div is still in reach, so the language and window passes can leave it
--- alone.

local M = {}

local MARKER = 'code-window-cell-output'

--- Check whether a Div holds the output of an executed cell.
--- @param div pandoc.Div
--- @return boolean
local function is_cell_output(div)
for _, class in ipairs(div.classes) do
if class == 'cell-output' or class:match('^cell%-output%-') then
return true
end
end
return false
end

--- Mark every code block inside a cell-output Div.
--- @param div pandoc.Div
--- @return pandoc.Div|nil Marked Div, or nil when the Div is left as it is
function M.Div(div)
if not is_cell_output(div) then
return nil
end
return div:walk({
CodeBlock = function(block)
block.attributes[MARKER] = 'true'
return block
end,
})
end

--- Check whether a code block holds the output of an executed cell.
--- @param block pandoc.CodeBlock
--- @return boolean
function M.is_marked(block)
return block.attributes[MARKER] == 'true'
end

--- Check whether an attribute name is this module's marker.
--- The window passes remove every attribute carrying the extension's prefix,
--- and the marker carries it too, so they ask here and leave this one alone.
--- The marker outlives those passes on purpose: it answers whether a block
--- holds the output of an executed cell, and it is removed once, below, after
--- every pass that asks.
--- @param key string Attribute name
--- @return boolean
function M.is_marker(key)
return key == MARKER
end

--- Remove the marker, so it never reaches the output document.
--- @param block pandoc.CodeBlock
function M.strip(block)
block.attributes[MARKER] = nil
end

return M
Loading
Loading