Skip to content
Open
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
222 changes: 222 additions & 0 deletions llm-docs/localization-architecture.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions news/changelog-1.10.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ All changes included in 1.10:
- ([#14261](https://github.com/quarto-dev/quarto-cli/issues/14261)): Fix theorem/example block titles containing inline code producing invalid Typst markup when syntax highlighting is applied.
- ([#14460](https://github.com/quarto-dev/quarto-cli/issues/14460)): Fix CSS `border` and `border-color` declarations losing tokens that precede an `rgb()`/`rgba()` color (e.g. `border: 0px solid rgb(255, 0, 0)` rendering as a 2.25pt border instead of being suppressed). Also fixes: `var(--brand-NAME)` references crashing the Typst CSS translator when `NAME` contained digits (e.g. `--brand-red-50`); a crash when an `rgba()` alpha is unparseable; the `dvmin` length unit being silently rejected (a stray space in the unit table); CSS keywords like `BOLD` not matching as `bold` (CSS keywords are case-insensitive); invalid hex colors like `#fffff` being silently accepted as 2-component colors.
- ([#14511](https://github.com/quarto-dev/quarto-cli/issues/14511)): Fix brand fonts downloaded for a Typst book project not being passed to `typst compile`, causing `unknown font family` warnings and fallback to Libertinus Serif.
- ([#14524](https://github.com/quarto-dev/quarto-cli/issues/14524)): Fix orange-book Typst book running header not honoring `lang:` — chapter heading band stayed `Chapter N.` instead of the locale's word (e.g. `Chapitre N.` for `lang: fr`). Also fixes the orange-book `list-of-figure-title` / `list-of-table-title` template pipes which were silently rendering as empty strings.

### `revealjs`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ $endif$
$if(lot)$
list-of-table-title: "$if(crossref.lot-title)$$crossref.lot-title$$else$$crossref-lot-title$$endif$",
$endif$
supplement-chapter: "$crossref-ch-prefix$",
$if(margin-geometry)$
padded-heading-number: false,
$endif$
Expand Down
15 changes: 14 additions & 1 deletion src/resources/filters/common/meta.lua
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,20 @@ function metaInjectHtml(meta, func)
end


function readMetaOptions(meta)
-- Copy a filter param into Pandoc metadata so it resolves as a $key$
-- variable in Pandoc templates. Skips when the user already set the key
-- (explicit metadata wins). See llm-docs/localization-architecture.md for
-- the broader pattern.
function surfaceParamToMeta(meta, key)
if meta[key] == nil then
local value = param(key, nil)
if value ~= nil then
meta[key] = value
end
end
end

function readMetaOptions(meta)
local options = {}
for key,value in pairs(meta) do
if type(value) == "table" and value.clone ~= nil then
Expand Down
12 changes: 12 additions & 0 deletions src/resources/filters/crossref/meta.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@
function crossrefMetaInject()
return {
Meta = function(meta)
-- surface localized crossref strings as Pandoc template variables
-- (consumed by Pandoc templates like orange-book typst-show.typ via
-- $crossref-ch-prefix$, $crossref-lof-title$, $crossref-lot-title$).
-- Filter params are Lua-only; templates need values in meta.
for _, key in ipairs({
"crossref-ch-prefix",
"crossref-lof-title",
"crossref-lot-title",
}) do
surfaceParamToMeta(meta, key)
end

local function as_latex(inlines)
return trim(pandoc.write(pandoc.Pandoc(quarto.utils.as_blocks(inlines)), "latex"))
end
Expand Down
5 changes: 5 additions & 0 deletions tests/docs/smoke-all/typst/orange-book-lang/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/.quarto/
/_book/
/index.typ
**/*.quarto_ipynb
*_files/
17 changes: 17 additions & 0 deletions tests/docs/smoke-all/typst/orange-book-lang/_quarto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
project:
type: book

book:
title: "Livre Test"
author: "Auteur Test"
chapters:
- index.qmd
- chapter1.qmd

lang: fr

format:
typst:
keep-typ: true
lof: true
lot: true
3 changes: 3 additions & 0 deletions tests/docs/smoke-all/typst/orange-book-lang/chapter1.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Premier chapitre

Voici le premier chapitre de ce livre de test.
16 changes: 16 additions & 0 deletions tests/docs/smoke-all/typst/orange-book-lang/index.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
keep-typ: true
_quarto:
render-project: true
tests:
typst:
ensureTypstFileRegexMatches:
-
- 'supplement-chapter: "Chapitre"'
- 'list-of-figure-title: "Liste des Figures"'
- 'list-of-table-title: "Liste des Tables"'
---

# Préface {.unnumbered}

Préface du livre de test.
Loading