From c3ac9837a92edba7c1da8f18c91d55cc1b4fc0a9 Mon Sep 17 00:00:00 2001 From: "mcanouil-dev[bot]" <211049963+mcanouil-dev[bot]@users.noreply.github.com> Date: Sat, 1 Aug 2026 19:29:05 +0000 Subject: [PATCH] chore(deps): update 4 Quarto extensions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - mcanouil/atelier: 0.10.1 → 0.10.2 - mcanouil/gitlink: 1.9.1 → 1.9.2 - mcanouil/iconify: 4.0.0 → 4.0.1 - mcanouil/pastel: 0.1.0 → 0.1.1 --- .../mcanouil/atelier/_extension.yml | 80 +++++++++++-------- .../mcanouil/atelier/_modules/metadata.lua | 44 +++++++++- .../mcanouil/atelier/html/theme.scss | 30 +++++++ .../mcanouil/gitlink/_extension.yml | 7 +- .../mcanouil/gitlink/_modules/metadata.lua | 8 +- docs/_extensions/mcanouil/gitlink/gitlink.lua | 5 +- .../mcanouil/iconify/_extension.yml | 11 ++- .../mcanouil/iconify/_modules/metadata.lua | 44 +++++++++- .../mcanouil/pastel/_extension.yml | 9 ++- 9 files changed, 182 insertions(+), 56 deletions(-) diff --git a/docs/_extensions/mcanouil/atelier/_extension.yml b/docs/_extensions/mcanouil/atelier/_extension.yml index 20000e0..1283fe5 100644 --- a/docs/_extensions/mcanouil/atelier/_extension.yml +++ b/docs/_extensions/mcanouil/atelier/_extension.yml @@ -1,20 +1,59 @@ title: Atelier author: Mickaël Canouil -version: 0.10.1 -quarto-required: '>=1.9.36' -source: mcanouil/quarto-atelier@0.10.1 -source-type: registry +version: 0.10.2 +quarto-required: ">=1.9.36" contributes: + project: + project: + type: website + output-dir: _site + website: + repo-actions: [edit, issue] + repo-link-target: _blank + repo-link-rel: noopener noreferrer + # `locale` matches `lang: en-GB` below; override the two together. + # Naming `twitter-card` at all is what switches Quarto's Twitter + # provider on, after which it inherits title, description, image, and + # image alt from each page. + open-graph: + locale: en_GB + twitter-card: + card-style: summary_large_image + page-navigation: true + back-to-top-navigation: true + llms-txt: true + search: + location: navbar + type: overlay + # `background` and `foreground` are left to the theme on both bars: the + # chrome palette in `html/chrome.scss` sets `$navbar-bg`, `$navbar-fg`, + # `$footer-bg`, and `$footer-fg` from a layer Quarto evaluates first, so + # naming them here would be a configuration with no effect. + navbar: + search: true + page-footer: + border: true + left: | + Powered by [Quarto](https://quarto.org){target="_blank" rel="noopener noreferrer"}. + center: | + © []{#current-year} [Mickaël CANOUIL](https://mickael.canouil.fr){target="_blank" rel="noopener noreferrer"}. + format: atelier-html formats: common: lang: en-GB - date-format: dddd[, the] Do [of] MMMM, YYYY + date-format: "dddd[, the] Do [of] MMMM, YYYY" code-copy: true code-overflow: wrap code-link: false html: respect-user-color-scheme: true + # Quarto builds the canonical link from `website.site-url`, giving a + # directory index the URL of its directory. Set `canonical-url: false` + # on a page served from more than one URL, such as `404.qmd`. canonical-url: true + # `html/chrome.scss` comes before `brand` on purpose: Quarto evaluates + # user layer defaults in reverse list order, so a file placed first is + # evaluated last, after the brand palette it derives the chrome from. theme: light: - html/chrome.scss @@ -45,33 +84,4 @@ contributes: - file: html/scripts/ordinal-dates.html - file: html/scripts/a11y-fixes.html - file: html/scripts/navbar-tooltips.html - project: - project: - type: website - output-dir: _site - website: - repo-actions: - - edit - - issue - repo-link-target: _blank - repo-link-rel: noopener noreferrer - open-graph: - locale: en_GB - twitter-card: - card-style: summary_large_image - page-navigation: true - back-to-top-navigation: true - llms-txt: true - search: - location: navbar - type: overlay - navbar: - search: true - page-footer: - border: true - left: | - Powered by [Quarto](https://quarto.org){target="_blank" rel="noopener noreferrer"}. - center: > - © []{#current-year} [Mickaël CANOUIL](https://mickael.canouil.fr){target="_blank" rel="noopener - noreferrer"}. - format: atelier-html +source: mcanouil/quarto-atelier@0.10.2 diff --git a/docs/_extensions/mcanouil/atelier/_modules/metadata.lua b/docs/_extensions/mcanouil/atelier/_modules/metadata.lua index bab2087..2e1b6d5 100644 --- a/docs/_extensions/mcanouil/atelier/_modules/metadata.lua +++ b/docs/_extensions/mcanouil/atelier/_modules/metadata.lua @@ -42,8 +42,12 @@ end --- @param key string The metadata key to retrieve --- @return string|nil The metadata value as a string, or nil if not found --- @usage local repo = M.get_metadata_value(meta, "github", "repository-name") +--- @note A boolean `false` is a value, not an absence, so the test is against +--- `nil` rather than truthiness. Stringifying it yields "false", which is what +--- a caller comparing against the string form already expects. function M.get_metadata_value(meta, extension_name, key) - if meta['extensions'] and meta['extensions'][extension_name] and meta['extensions'][extension_name][key] then + if meta['extensions'] and meta['extensions'][extension_name] + and meta['extensions'][extension_name][key] ~= nil then return str.stringify(meta['extensions'][extension_name][key]) end return nil @@ -175,6 +179,44 @@ function M.get_options(spec) return result end +-- ============================================================================ +-- PROJECT METADATA UTILITIES +-- ============================================================================ + +--- Get repo-url from Quarto project metadata via QUARTO_EXECUTE_INFO. +--- Reads the JSON file pointed to by the QUARTO_EXECUTE_INFO environment variable +--- and extracts repo-url from website or book metadata. +--- @return string|nil The repo-url value, or nil if not available +function M.get_project_repo_url() + local path = os.getenv("QUARTO_EXECUTE_INFO") + if not path then return nil end + + local file = io.open(path, "r") + if not file then return nil end + + local content = file:read("*a") + file:close() + + if str.is_empty(content) then return nil end + + local ok, info = pcall(quarto.json.decode, content) + if not ok or not info then return nil end + + local format_meta = info["format"] and info["format"]["metadata"] + if not format_meta then return nil end + + -- Try website.repo-url first, then book.repo-url + local repo_url = nil + if format_meta["website"] and format_meta["website"]["repo-url"] then + repo_url = format_meta["website"]["repo-url"] + elseif format_meta["book"] and format_meta["book"]["repo-url"] then + repo_url = format_meta["book"]["repo-url"] + end + + if str.is_empty(repo_url) then return nil end + return repo_url +end + -- ============================================================================ -- MODULE EXPORT -- ============================================================================ diff --git a/docs/_extensions/mcanouil/atelier/html/theme.scss b/docs/_extensions/mcanouil/atelier/html/theme.scss index 33aee3e..4e2f3e0 100644 --- a/docs/_extensions/mcanouil/atelier/html/theme.scss +++ b/docs/_extensions/mcanouil/atelier/html/theme.scss @@ -539,6 +539,36 @@ body.docked .sidebar-navigation { --gitlink-widget-menu-fg: var(--atelier-sidebar-fg); } +// Quarto gives the sidebar `overflow-y: auto` and leaves `overflow-x` at +// `visible`, which computes to `auto`, so anything wider than the column +// scrolls it sideways rather than being clipped. The widget's menu is anchored +// to its trigger's left edge and sized to its content, and the rules above +// centre the tools row, so the menu starts a third of the way in and runs past +// the right edge. It raises the scrollbar even while shut, because it is +// hidden with `visibility` and so still takes part in layout. Anchoring it to +// the tools row, which spans the column, keeps it inside. +// +// The marker class is the one widget.js sets on whichever tools container held +// the placeholder, so this follows the widget into either the main row or the +// collapsed one, which is where it lands when the project also has a navbar. +#quarto-sidebar .gitlink-widget-tools { + position: relative; +} + +// The widget is `position: relative` in widget.css, so without this it stays +// the dropdown's containing block and the row below has no effect. +#quarto-sidebar .gitlink-widget-tools .gitlink-widget { + position: static; +} + +// `width` has to give way with it: widget.css sizes the menu to `max-content`, +// and a specified width over-constrains the box, which drops `right`. +#quarto-sidebar .gitlink-widget-tools .gitlink-widget-dropdown { + left: 0; + right: 0; + width: auto; +} + // Structure ships with the extension's widget.css; match the radius of the // navbar dropdown menus above. body .navbar .gitlink-widget-dropdown { diff --git a/docs/_extensions/mcanouil/gitlink/_extension.yml b/docs/_extensions/mcanouil/gitlink/_extension.yml index ebb04e3..ca715dd 100644 --- a/docs/_extensions/mcanouil/gitlink/_extension.yml +++ b/docs/_extensions/mcanouil/gitlink/_extension.yml @@ -1,9 +1,8 @@ title: gitlink author: Mickaël Canouil -version: 1.9.1 -quarto-required: '>=1.8.21' -source: mcanouil/quarto-gitlink@1.9.1 -source-type: registry +version: 1.9.2 +quarto-required: ">=1.8.21" contributes: filters: - gitlink.lua +source: mcanouil/quarto-gitlink@1.9.2 diff --git a/docs/_extensions/mcanouil/gitlink/_modules/metadata.lua b/docs/_extensions/mcanouil/gitlink/_modules/metadata.lua index a9058dc..2e1b6d5 100644 --- a/docs/_extensions/mcanouil/gitlink/_modules/metadata.lua +++ b/docs/_extensions/mcanouil/gitlink/_modules/metadata.lua @@ -1,5 +1,5 @@ --- MC Metadata - Extension configuration and metadata access for Quarto Lua filters and shortcodes ---- @module metadata +--- @module "metadata" --- @license MIT --- @copyright 2026 Mickaël Canouil --- @author Mickaël Canouil @@ -42,8 +42,12 @@ end --- @param key string The metadata key to retrieve --- @return string|nil The metadata value as a string, or nil if not found --- @usage local repo = M.get_metadata_value(meta, "github", "repository-name") +--- @note A boolean `false` is a value, not an absence, so the test is against +--- `nil` rather than truthiness. Stringifying it yields "false", which is what +--- a caller comparing against the string form already expects. function M.get_metadata_value(meta, extension_name, key) - if meta['extensions'] and meta['extensions'][extension_name] and meta['extensions'][extension_name][key] then + if meta['extensions'] and meta['extensions'][extension_name] + and meta['extensions'][extension_name][key] ~= nil then return str.stringify(meta['extensions'][extension_name][key]) end return nil diff --git a/docs/_extensions/mcanouil/gitlink/gitlink.lua b/docs/_extensions/mcanouil/gitlink/gitlink.lua index c4f3928..0067d62 100644 --- a/docs/_extensions/mcanouil/gitlink/gitlink.lua +++ b/docs/_extensions/mcanouil/gitlink/gitlink.lua @@ -109,9 +109,8 @@ local function colour_to_hex(value) end --- Read a boolean metadata value with a default. ---- `get_metadata_value()` returns nil for boolean `false` (its truthy guard ---- treats false as missing), so this helper reads the raw value directly ---- and coerces it via `tostring`. +--- Reads the raw value rather than going through `get_metadata_value()`, so a +--- boolean, a quoted string, and a bare YAML `false` all resolve the same way. --- @param gitlink_meta table|nil The `extensions.gitlink` metadata sub-table --- @param key string The option key --- @param default boolean The default when the option is absent diff --git a/docs/_extensions/mcanouil/iconify/_extension.yml b/docs/_extensions/mcanouil/iconify/_extension.yml index 36d2ef0..d0ad87f 100644 --- a/docs/_extensions/mcanouil/iconify/_extension.yml +++ b/docs/_extensions/mcanouil/iconify/_extension.yml @@ -1,11 +1,10 @@ title: Iconify author: Mickaël Canouil -version: 4.0.0 -quarto-required: '>=1.5.57' -source: mcanouil/quarto-iconify@4.0.0 -source-type: registry +version: 4.0.1 +quarto-required: ">=1.5.57" contributes: - filters: - - iconify-filter.lua shortcodes: - iconify.lua + filters: + - iconify-filter.lua +source: mcanouil/quarto-iconify@4.0.1 diff --git a/docs/_extensions/mcanouil/iconify/_modules/metadata.lua b/docs/_extensions/mcanouil/iconify/_modules/metadata.lua index bab2087..2e1b6d5 100644 --- a/docs/_extensions/mcanouil/iconify/_modules/metadata.lua +++ b/docs/_extensions/mcanouil/iconify/_modules/metadata.lua @@ -42,8 +42,12 @@ end --- @param key string The metadata key to retrieve --- @return string|nil The metadata value as a string, or nil if not found --- @usage local repo = M.get_metadata_value(meta, "github", "repository-name") +--- @note A boolean `false` is a value, not an absence, so the test is against +--- `nil` rather than truthiness. Stringifying it yields "false", which is what +--- a caller comparing against the string form already expects. function M.get_metadata_value(meta, extension_name, key) - if meta['extensions'] and meta['extensions'][extension_name] and meta['extensions'][extension_name][key] then + if meta['extensions'] and meta['extensions'][extension_name] + and meta['extensions'][extension_name][key] ~= nil then return str.stringify(meta['extensions'][extension_name][key]) end return nil @@ -175,6 +179,44 @@ function M.get_options(spec) return result end +-- ============================================================================ +-- PROJECT METADATA UTILITIES +-- ============================================================================ + +--- Get repo-url from Quarto project metadata via QUARTO_EXECUTE_INFO. +--- Reads the JSON file pointed to by the QUARTO_EXECUTE_INFO environment variable +--- and extracts repo-url from website or book metadata. +--- @return string|nil The repo-url value, or nil if not available +function M.get_project_repo_url() + local path = os.getenv("QUARTO_EXECUTE_INFO") + if not path then return nil end + + local file = io.open(path, "r") + if not file then return nil end + + local content = file:read("*a") + file:close() + + if str.is_empty(content) then return nil end + + local ok, info = pcall(quarto.json.decode, content) + if not ok or not info then return nil end + + local format_meta = info["format"] and info["format"]["metadata"] + if not format_meta then return nil end + + -- Try website.repo-url first, then book.repo-url + local repo_url = nil + if format_meta["website"] and format_meta["website"]["repo-url"] then + repo_url = format_meta["website"]["repo-url"] + elseif format_meta["book"] and format_meta["book"]["repo-url"] then + repo_url = format_meta["book"]["repo-url"] + end + + if str.is_empty(repo_url) then return nil end + return repo_url +end + -- ============================================================================ -- MODULE EXPORT -- ============================================================================ diff --git a/docs/_extensions/mcanouil/pastel/_extension.yml b/docs/_extensions/mcanouil/pastel/_extension.yml index 4b5edc8..69aca5d 100644 --- a/docs/_extensions/mcanouil/pastel/_extension.yml +++ b/docs/_extensions/mcanouil/pastel/_extension.yml @@ -1,10 +1,11 @@ title: Pastel author: Mickaël Canouil -version: 0.1.0 -quarto-required: '>=1.10.18' -source: mcanouil/quarto-pastel@0.1.0 -source-type: registry +version: 0.1.1 +# The Quarto version the brand and its stylesheet are developed and verified +# against. quarto-atelier, which these sites are built on, requires >=1.9.36. +quarto-required: ">=1.10.18" contributes: metadata: project: brand: brand.yml +source: mcanouil/quarto-pastel@0.1.1