Skip to content
Merged
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
4 changes: 4 additions & 0 deletions news/changelog-1.12.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ All changes included in 1.12:

- ([#14783](https://github.com/quarto-dev/quarto-cli/issues/14783)): Fix `quarto preview` ignoring project metadata contributed by an extension, such as `brand`. Contributed project metadata now applies to every command that builds a project context, `quarto inspect` included. (author: @mcanouil)

## Extensions

- ([#15063](https://github.com/quarto-dev/quarto-cli/issues/15063)): Fix a format extension's own `language` file stopping the render with a "does not exist" error, and its `metadata-files` being ignored. Both now resolve relative to the extension's directory, and per-language files such as `_language-fr.yml` load beside the `language` file. (author: @mcanouil)

## Other fixes and improvements

- ([#14822](https://github.com/quarto-dev/quarto-cli/issues/14822)): Translate the `tools-share`, `tools-download`, and `skip-to-content` language keys in Greek. (author: @sogav21)
Expand Down
4 changes: 3 additions & 1 deletion src/command/render/render-contexts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -717,9 +717,11 @@ const readExtensionFormat = async (
extensionMetadata[kExtensionName] = extensionMetadata[kExtensionName] ||
effectiveExtension;

// resolveExtensionPaths made the extension paths relative to the
// document, so the document is the base, not the extension directory
const formats = await resolveFormatsFromMetadata(
extensionMetadata,
extension.path,
file,
[formatDesc.baseFormat],
);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/.quarto/
**/*.quarto_ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
title: Language file
author: Quarto Dev Team
version: 1.0.0
contributes:
formats:
html:
language: _language.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
toc-title-document: "Sommaire de l extension"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
toc-title-document: "Contents from the extension"
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
project:
type: default
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: "A document in a project subdirectory reads the language file of a root extension"
format: langfile-html
toc: true
_quarto:
tests:
langfile-html:
ensureFileRegexMatches:
- ['<h2 id="toc-title">Contents from the extension</h2>']
- []
---

## Section

This document is in a subdirectory of the project, and the `langfile` extension is at the root of the project.
The path to the language file of the extension starts with `../`.
Before the fix, this case worked by chance, because the wrong base directory and the `../` offset cancelled each other out.
This test makes sure that the case continues to work.
17 changes: 17 additions & 0 deletions tests/docs/smoke-all/2026/11/03/issue-15063-project/index.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: "A format extension at the project root reads its own language file"
format: langfile-html
toc: true
_quarto:
tests:
langfile-html:
ensureFileRegexMatches:
- ['<h2 id="toc-title">Contents from the extension</h2>']
- []
---

## Section

This document is at the root of a project, and the `langfile` extension is in the `_extensions/` directory of the project.
Before the fix, Quarto looked for the language file in `_extensions/_extensions/langfile/` and the render stopped.
The table of contents must show the title from the language file of the extension.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
title: Language file in an organisation
author: Quarto Dev Team
version: 1.0.0
contributes:
formats:
html:
language: _language.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
toc-title-document: "Contents from the organisation extension"
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
title: Language file
author: Quarto Dev Team
version: 1.0.0
contributes:
formats:
html:
language: _language.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
toc-title-document: "Sommaire de l extension"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
toc-title-document: "Contents from the extension"
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
title: Metadata file
author: Quarto Dev Team
version: 1.0.0
contributes:
formats:
html:
metadata-files:
- _metadata-extra.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
toc-title: "Contents from the extension metadata file"
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
title: Language file in a subfolder
author: Quarto Dev Team
version: 1.0.0
contributes:
formats:
html:
language: i18n/strings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
toc-title-document: "Sommaire du sous-dossier"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
toc-title-document: "Contents from the extension subfolder"
18 changes: 18 additions & 0 deletions tests/docs/smoke-all/2026/11/03/issue-15063/issue-15063-fr.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: "A format extension reads the per-language file beside its language file"
format: langfile-html
toc: true
lang: fr
_quarto:
tests:
langfile-html:
ensureFileRegexMatches:
- ['<h2 id="toc-title">Sommaire de l extension</h2>']
- ['Contents from the extension']
---

## Section

The `langfile` extension has a `_language-fr.yml` file next to its `_language.yml` file.
With `lang: fr`, Quarto must load the French file.
Its title replaces the English title of the extension and the built-in French title of Quarto.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: "A format extension reads its own metadata files"
format: metafile-html
toc: true
_quarto:
tests:
metafile-html:
ensureFileRegexMatches:
- ['<h2 id="toc-title">Contents from the extension metadata file</h2>']
- []
---

## Section

The `metafile` extension sets `metadata-files` for its HTML format, and the file sets `toc-title`.
Before the fix, Quarto looked for the file in the wrong directory and ignored it without a message.
The table of contents must show the title from this file.
17 changes: 17 additions & 0 deletions tests/docs/smoke-all/2026/11/03/issue-15063/issue-15063-org.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: "An extension under an organisation directory reads its own language file"
format: orgfile-html
toc: true
_quarto:
tests:
orgfile-html:
ensureFileRegexMatches:
- ['<h2 id="toc-title">Contents from the organisation extension</h2>']
- []
---

## Section

The `orgfile` extension is in an organisation directory, `_extensions/acme/orgfile/`.
Before the fix, Quarto looked for the language file in `_extensions/acme/_extensions/acme/orgfile/`.
The table of contents must show the title from the language file of the extension.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
title: "The document language overrides the extension language file"
format: langfile-html
toc: true
language:
toc-title-document: "Contents from the document"
_quarto:
tests:
langfile-html:
ensureFileRegexMatches:
- ['<h2 id="toc-title">Contents from the document</h2>']
- ['Contents from the extension']
---

## Section

The document sets `toc-title-document` under `language`.
The `langfile` extension sets the same key in its language file.
The value of the document must replace the value of the extension.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: "The per-language file beside a language file in a subfolder is found"
format: subdirfile-html
toc: true
lang: fr
_quarto:
tests:
subdirfile-html:
ensureFileRegexMatches:
- ['<h2 id="toc-title">Sommaire du sous-dossier</h2>']
- ['Contents from the extension subfolder']
---

## Section

The `subdirfile` extension keeps its language files in the `i18n/` subfolder.
Quarto must find `i18n/strings.yml`, and then load `i18n/strings-fr.yml` next to it for `lang: fr`.
The table of contents must show the French title, not the English title.
17 changes: 17 additions & 0 deletions tests/docs/smoke-all/2026/11/03/issue-15063/issue-15063.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: "A format extension reads its own language file"
format: langfile-html
toc: true
_quarto:
tests:
langfile-html:
ensureFileRegexMatches:
- ['<h2 id="toc-title">Contents from the extension</h2>']
- []
---

## Section

The `langfile` extension sets `language: _language.yml` for its HTML format.
Before the fix, Quarto looked for this file in `_extensions/_extensions/langfile/` and the render stopped.
The table of contents must show the title from the language file of the extension.
Loading