Skip to content

Commit ee0f68b

Browse files
claude: simplify typst-templates test to target main branch
Fixes #13486 The quarto-ext/typst-templates repo now has the import-and-gather changes merged to main. Remove the branch override, local-path development shortcut, and skip logic, simplifying the template list to a plain string array. Co-Authored-By: Claude Opus 4.6 <[email protected]>
1 parent 965fde5 commit ee0f68b

2 files changed

Lines changed: 11 additions & 28 deletions

File tree

news/changelog-1.9.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ All changes included in 1.9:
6969
- ([#13362](https://github.com/quarto-dev/quarto-cli/issues/13362)): Remove unused `blockquote` definitions from template.
7070
- ([#13452](https://github.com/quarto-dev/quarto-cli/issues/13452)): Wraps subfigure captions generated by `quarto_super()` in `block` function to avoid emitting `par` elements. (author: @christopherkenny)
7171
- ([#13474](https://github.com/quarto-dev/quarto-cli/issues/13474)): Heading font for title should default to `mainfont`.
72+
- ([#13486](https://github.com/quarto-dev/quarto-cli/issues/13486)): Update the [Custom Typst Templates](https://quarto.org/docs/output-formats/typst-custom.html), which had been failing due to changes in the Typst language, to use the latest upstream packages and bundle them using `typst-gather` for offline use. (ams, dept-news, fiction, ieee, letter, poster)
7273
- ([#13555](https://github.com/quarto-dev/quarto-cli/issues/13555)): Add support for `icon=false` in callouts when used in `format: typst`.
7374
- ([#13589](https://github.com/quarto-dev/quarto-cli/issues/13589)): Fix callouts with invalid ID prefixes crashing with "attempt to index a nil value". Callouts with unknown reference types now render as non-crossreferenceable callouts with a warning, ignoring the invalid ID.
7475
- ([#13602](https://github.com/quarto-dev/quarto-cli/issues/13602)): Fix support for multiple files set in `bibliography` field in `biblio.typ` template partial.

tests/smoke/extensions/extension-render-typst-templates.test.ts

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -10,40 +10,22 @@ import { ensureDirSync, existsSync } from "../../../src/deno_ral/fs.ts";
1010
import { testRender } from "../render/render.ts";
1111
import { removeIfEmptyDir } from "../../../src/core/path.ts";
1212

13-
// Set to a local path for development, or null to use GitHub
14-
// Example: "/Users/gordon/src/tt-work/typst-templates"
15-
const LOCAL_TEMPLATES_PATH: string | null = null;
16-
17-
// GitHub repo where templates are published (templates are subdirectories)
1813
const GITHUB_REPO = "quarto-ext/typst-templates";
19-
const GITHUB_BRANCH = "@import-and-gather"
2014

21-
// Template definitions - single source of truth
22-
// Templates with `skip: true` require local typst packages (@local/...) that need
23-
// `quarto typst gather` to bundle. They're skipped until packages are bundled.
2415
const typstTemplates = [
25-
{ name: "ams" },
26-
{ name: "dept-news", skip: false }, // needs @local/dashing-dept-news
27-
{ name: "fiction" },
28-
{ name: "ieee" },
29-
{ name: "letter" },
30-
{ name: "poster" }, // needs @local/typst-poster
16+
"ams",
17+
"dept-news",
18+
"fiction",
19+
"ieee",
20+
"letter",
21+
"poster",
3122
];
3223

33-
// Helper to get the template source for `quarto use template`
34-
function getTemplateSource(name: string): string {
35-
if (LOCAL_TEMPLATES_PATH) {
36-
return join(LOCAL_TEMPLATES_PATH, name);
37-
}
38-
return `${GITHUB_REPO}/${name}${GITHUB_BRANCH}`;
39-
}
40-
41-
for (const template of typstTemplates.filter((t) => !t.skip)) {
42-
const format = `${template.name}-typst`;
24+
for (const name of typstTemplates) {
25+
const format = `${name}-typst`;
4326
const baseDir = join("docs", "_temp-test-artifacts");
44-
const dirName = `typst-${template.name}`;
27+
const dirName = `typst-${name}`;
4528
const workingDir = join(baseDir, dirName);
46-
// quarto use template creates a qmd file named after the working directory
4729
const input = join(workingDir, `${dirName}.qmd`);
4830

4931
testRender(input, format, true, [], {
@@ -56,7 +38,7 @@ for (const template of typstTemplates.filter((t) => !t.skip)) {
5638
},
5739

5840
setup: async () => {
59-
const source = getTemplateSource(template.name);
41+
const source = `${GITHUB_REPO}/${name}`;
6042
console.log(`using template: ${source}`);
6143
const wd = Deno.cwd();
6244
Deno.chdir(workingDir);

0 commit comments

Comments
 (0)