Skip to content

Commit ff1a396

Browse files
authored
Merge branch 'main' into fix/issue13216
2 parents d92cd2e + e794ac8 commit ff1a396

File tree

72 files changed

+2950
-2267
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+2950
-2267
lines changed

news/changelog-1.6.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ All changes included in 1.6:
22

33
## Breaking changes
44

5-
- The syntax for standard library imports in `quarto run` TypeScript files (`*.ts`) changed. Please see <https://prerelease.quarto.org/docs/projects/scripts.html#deno-scripts> for how to make the necessary changes.
5+
- The syntax for standard library imports in `quarto run` TypeScript files (`*.ts`) changed. Please see <https://quarto.org/docs/projects/scripts.html#deno-scripts> for how to make the necessary changes.
66

77
## Shortcodes
88

news/changelog-1.8.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ All changes included in 1.8:
2020
- ([#726](https://github.com/quarto-dev/quarto-cli/issues/726)): a11y - Provide `.screen-reader-only` callout type when callout text doesn't naturally include the type.
2121
- ([#5538](https://github.com/quarto-dev/quarto-cli/issues/5538)): Fix code-copy button style so that scrolling behaves properly.
2222
- ([#5879](https://github.com/quarto-dev/quarto-cli/issues/5879)): Improve font rendering of `kbd` shortcode on macOS. `kbd` will now also be stricter in converting keyboard shortcuts to macOS icons.
23+
- ([#8568](https://github.com/quarto-dev/quarto-cli/issues/8568)) Default inline code background color to the code block background color if not specified; foreground color is `$pre-color` in dark mode and (remains) purple in light mode.
2324
- ([#10983](https://github.com/quarto-dev/quarto-cli/issues/10983)): Fix spacing inconsistency between paras and first section headings.
2425
- ([#12259](https://github.com/quarto-dev/quarto-cli/issues/12259)): Fix conflict between `html-math-method: katex` and crossref popups (author: @benkeks).
2526
- ([#12341](https://github.com/quarto-dev/quarto-cli/issues/12341)): Enable light and dark logos for html formats (sidebar, navbar, dashboard).
@@ -66,6 +67,7 @@ All changes included in 1.8:
6667

6768
### `website`
6869

70+
- ([#10284](https://github.com/quarto-dev/quarto-cli/issues/10284)): a11y - Fix keyboard navigation for tabset panels when using an HTML theme. Tabs now properly receive keyboard focus.
6971
- ([#12551](https://github.com/quarto-dev/quarto-cli/pull/12551)): Improve warning issued when `aliases` would overwrite an existing document.
7072
- ([#12616](https://github.com/quarto-dev/quarto-cli/issues/12616)): find SVG images in image discovery for listings.
7173
- ([#12693](https://github.com/quarto-dev/quarto-cli/issues/12693)): Prevent resource exhaustion on large websites by serializing `NotebookContext` information to file instead of the environment.
@@ -75,12 +77,15 @@ All changes included in 1.8:
7577

7678
- ([#12615](https://github.com/quarto-dev/quarto-cli/pull/12615)): Adds `algorithm` to theorem environments. (author: @jeremy9959)
7779

78-
## Lua Filters
80+
## Lua Filters and API
7981

82+
- ([#11750](https://github.com/quarto-dev/quarto-cli/pull/11750)): Extend filter path resolution to support `at`/`path` filters from extensions.
8083
- ([#12727](https://github.com/quarto-dev/quarto-cli/issues/12727)): Do not crash in the presence of malformed tabset contents.
8184
- ([#12806](https://github.com/quarto-dev/quarto-cli/pull/12806)): Use pandoc APIs to handle codepage conversion on Windows.
8285
- ([#12811](https://github.com/quarto-dev/quarto-cli/pull/12811)): Add support for YouTube Shorts in `video` shortcode.
83-
- ([#13128](https://github.com/quarto-dev/quarto-cli/issues/13128)): Meta shortcode could crash on bad input.
86+
- ([#13112](https://github.com/quarto-dev/quarto-cli/pull/13112)): Add `quarto.format.format_identifier()` API entry.
87+
- ([#13128](https://github.com/quarto-dev/quarto-cli/issues/13128)): Avoid meta shortcode crash on bad input.
88+
- ([#13246](https://github.com/quarto-dev/quarto-cli/pull/13246)): Add `quarto.variables.get()` and `quarto.metadata.get()` APIs.
8489

8590
## Commands
8691

@@ -108,7 +113,7 @@ All changes included in 1.8:
108113

109114
- ([#12753](https://github.com/quarto-dev/quarto-cli/issues/12753)): Support change in IPython 9+ and import `set_matplotlib_formats` from `matplotlib_inline.backend_inline` in the internal `setup.py` script used to initialize rendering with Jupyter engine.
110115
- ([#12839](https://github.com/quarto-dev/quarto-cli/issues/12839)): Support for `plotly.py` 6+ which now loads plotly.js using a cdn in script as a module.
111-
- ([#13026](https://github.com/quarto-dev/quarto-cli/pulls/13026), [#13151](https://github.com/quarto-dev/quarto-cli/pulls/13151)), [#13184](https://github.com/quarto-dev/quarto-cli/pull/13184): Use `jsdelivr` CDN for jupyter widgets dependencies.
116+
- ([#13026](https://github.com/quarto-dev/quarto-cli/pull/13026), [#13151](https://github.com/quarto-dev/quarto-cli/pull/13151)), [#13184](https://github.com/quarto-dev/quarto-cli/pull/13184): Use `jsdelivr` CDN for jupyter widgets dependencies.
112117

113118
### `knitr`
114119

@@ -118,10 +123,24 @@ All changes included in 1.8:
118123

119124
- ([#12870](https://github.com/quarto-dev/quarto-cli/pull/12870)): Update `julia` engine from `0.17.0` to `0.17.3` to improve `juliaup` detection on Windows systems and correctly set `Base.source_path()` output to match REPL and script usage.
120125

126+
## Languages
127+
128+
- ([#13098](https://github.com/quarto-dev/quarto-cli/pull/13098)): Fox a minor inappropriate phrasing in the Chinese localization of `environment-proof-title` (@sun123xyz).
129+
121130
## Other fixes and improvements
122131

123132
- ([#11321](https://github.com/quarto-dev/quarto-cli/issues/11321)): Follow [recommendation from LaTeX project](https://latex-project.org/news/latex2e-news/ltnews40.pdf) and use `lualatex` instead of `xelatex` as the default PDF engine.
124133
- ([#12782](https://github.com/quarto-dev/quarto-cli/pull/12782)): fix bug on `safeRemoveDirSync`'s detection of safe directory boundaries.
125134
- ([#12853](https://github.com/quarto-dev/quarto-cli/issues/12853)): fix replaceAll() escaping issue with embedded notebooks containing `$` in their Markdown.
126135
- ([#12939](https://github.com/quarto-dev/quarto-cli/pull/12939)): Upgrade `mermaidjs` to 11.6.0.
136+
- ([#13031](https://github.com/quarto-dev/quarto-cli/pull/13031)): Add `.quarto_ipynb` files to `.gitignore` by default.
137+
- ([#13085](https://github.com/quarto-dev/quarto-cli/pull/13085)): Avoid `kbd` shortcode crashes on unknown OS keys.
138+
- ([#13164](https://github.com/quarto-dev/quarto-cli/pull/13164)): add `julia` to execute schema to allow autocomplete suggestions. (@mcanouil)
139+
- ([#13121](https://github.com/quarto-dev/quarto-cli/issues/13121)): Allow `contents` shortcode to find inline elements.
127140
- ([#13216](https://github.com/quarto-dev/quarto-cli/issues/13216)): Properly disable `downlit` (`code-link`) and enable `code-annotations` when non-R code blocks are present.
141+
142+
143+
## Quarto Internals
144+
145+
- ([#13155](https://github.com/quarto-dev/quarto-cli/pull/13155)): Process `pandoc-reader-FORMAT` raw blocks through `pandoc.read(FORMAT)`.
146+
- ([#13255](https://github.com/quarto-dev/quarto-cli/pull/13255)): Move some Lua code to use Pandoc's Lua API.

src/command/render/filters.ts

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -851,19 +851,28 @@ async function resolveFilterExtension(
851851
// Resolve any filters that are provided by an extension
852852
const results: (QuartoFilter | QuartoFilter[])[] = [];
853853
const getFilter = async (filter: QuartoFilter) => {
854-
// Look for extension names in the filter list and result them
854+
// Look for extension names in the filter list and resolve them
855855
// into the filters provided by the extension
856-
if (
857-
filter !== kQuartoFilterMarker && filter !== kQuartoCiteProcMarker &&
858-
typeof filter === "string"
859-
) {
856+
if (filter === kQuartoFilterMarker || filter === kQuartoCiteProcMarker) {
857+
return filter;
858+
}
859+
860+
let pathToResolve: string | null = null;
861+
862+
if (typeof filter === "string") {
863+
pathToResolve = filter;
864+
} else if (typeof filter === "object" && filter.path) {
865+
pathToResolve = filter.path;
866+
}
867+
868+
if (pathToResolve) {
860869
// The filter string points to an executable file which exists
861-
if (existsSync(filter) && !Deno.statSync(filter).isDirectory) {
870+
if (existsSync(pathToResolve) && !Deno.statSync(pathToResolve).isDirectory) {
862871
return filter;
863872
}
864873

865874
const extensions = await options.services.extension?.find(
866-
filter,
875+
pathToResolve,
867876
options.source,
868877
"filters",
869878
options.project?.config,
@@ -873,15 +882,35 @@ async function resolveFilterExtension(
873882
// Filter this list of extensions
874883
const filteredExtensions = filterExtensions(
875884
extensions || [],
876-
filter,
885+
pathToResolve,
877886
"filter",
878887
);
879888
// Return any contributed plugins
880889
if (filteredExtensions.length > 0) {
881890
// This matches an extension, use the contributed filters
882-
const filters = extensions[0].contributes.filters;
883-
if (filters) {
884-
return filters;
891+
const extensionFilters = extensions[0].contributes.filters;
892+
if (extensionFilters) {
893+
// After "path" resolution, "at" needs to be preserved
894+
if (typeof filter === "string") {
895+
return extensionFilters;
896+
} else if (isFilterEntryPoint(filter)) {
897+
return extensionFilters.map(extFilter => {
898+
if (typeof extFilter === "string") {
899+
return {
900+
type: extFilter.endsWith(".lua") ? "lua" : "json" as "lua" | "json",
901+
path: extFilter,
902+
at: filter.at
903+
};
904+
} else {
905+
return {
906+
...extFilter,
907+
at: filter.at
908+
};
909+
}
910+
});
911+
} else {
912+
return extensionFilters;
913+
}
885914
} else {
886915
return filter;
887916
}

src/extension/extension.ts

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
} from "../project/types.ts";
1818

1919
import {
20+
basename,
2021
dirname,
2122
isAbsolute,
2223
join,
@@ -158,7 +159,10 @@ export function projectExtensionPathResolver(
158159
return (href: string, projectOffset: string) => {
159160
const projectRelativeHref = relative(projectOffset, href);
160161

161-
if (projectRelativeHref.startsWith("_extensions/") || projectRelativeHref.startsWith("_extensions\\")) {
162+
if (
163+
projectRelativeHref.startsWith("_extensions/") ||
164+
projectRelativeHref.startsWith("_extensions\\")
165+
) {
162166
const projectTargetHref = projectRelativeHref.replace(
163167
/^_extensions/,
164168
`${libDir}/quarto-contrib/quarto-project`,
@@ -809,10 +813,17 @@ async function readExtension(
809813
);
810814
if (resolved.include.length > 0) {
811815
if (key === "brand") {
812-
(object.project as Record<string, unknown>)[key] = relative(
813-
join(extensionDir, "..", ".."),
814-
resolved.include[0],
815-
);
816+
let projectDir = extensionDir, last;
817+
do {
818+
last = basename(projectDir);
819+
projectDir = dirname(projectDir);
820+
} while (projectDir && last !== "_extensions");
821+
if (projectDir) {
822+
(object.project as Record<string, unknown>)[key] = relative(
823+
projectDir,
824+
resolved.include[0],
825+
);
826+
}
816827
} else {
817828
(object.project as Record<string, unknown>)[key] = resolved.include;
818829
}

src/project/project-gitignore.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { lines } from "../core/text.ts";
1515
import { isEnvDir } from "../core/jupyter/capabilities.ts";
1616
import { isWindows } from "../deno_ral/platform.ts";
1717

18-
export const kQuartoIgnore = [`/${kQuartoScratch}/`];
18+
export const kQuartoIgnore = [`/${kQuartoScratch}/`, `**/*.quarto_ipynb`];
1919

2020
export async function ensureGitignore(
2121
dir: string,

src/resources/editor/tools/vs-code.mjs

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13050,6 +13050,22 @@ var require_yaml_intelligence_resources = __commonJS({
1305013050
}
1305113051
}
1305213052
},
13053+
{
13054+
id: "brand-path-only-light-dark",
13055+
anyOf: [
13056+
"string",
13057+
{
13058+
object: {
13059+
closed: true,
13060+
properties: {
13061+
light: "string",
13062+
dark: "string"
13063+
}
13064+
}
13065+
}
13066+
],
13067+
description: "A path to a brand.yml file, or an object with light and dark paths to brand.yml\n"
13068+
},
1305313069
{
1305413070
id: "brand-path-bool-light-dark",
1305513071
anyOf: [
@@ -14602,7 +14618,8 @@ var require_yaml_intelligence_resources = __commonJS({
1460214618
string: {
1460314619
completions: [
1460414620
"jupyter",
14605-
"knitr"
14621+
"knitr",
14622+
"julia"
1460614623
]
1460714624
}
1460814625
},
@@ -20452,9 +20469,9 @@ var require_yaml_intelligence_resources = __commonJS({
2045220469
},
2045320470
brand: {
2045420471
schema: {
20455-
ref: "brand-path-bool-light-dark"
20472+
ref: "brand-path-only-light-dark"
2045620473
},
20457-
description: "Branding information to use for this document. If a string, the path to a brand file.\nIf false, don't use branding on this document. If an object, an inline brand\ndefinition, or an object with light and dark brand paths or definitions.\n"
20474+
description: "Path to brand.yml or object with light and dark paths to brand.yml\n"
2045820475
},
2045920476
preview: {
2046020477
description: "Options for `quarto preview`",
@@ -22594,6 +22611,7 @@ var require_yaml_intelligence_resources = __commonJS({
2259422611
"The font files to include. These can be local or online. Local file\npaths should be relative to the <code>brand.yml</code> file. Online\npaths should be complete URLs.",
2259522612
"The path to the font file. This can be a local path or a URL.",
2259622613
"A locally-installed font family name. When used, the end-user is\nresponsible for ensuring that the font is installed on their system.",
22614+
"A path to a brand.yml file, or an object with light and dark paths to\nbrand.yml",
2259722615
"Branding information to use for this document. If a string, the path\nto a brand file. If false, don\u2019t use branding on this document. If an\nobject, an inline (unified) brand definition, or an object with light\nand dark brand paths or definitions.",
2259822616
"The path to a light brand file or an inline light brand\ndefinition.",
2259922617
"The path to a dark brand file or an inline dark brand definition.",
@@ -23995,6 +24013,7 @@ var require_yaml_intelligence_resources = __commonJS({
2399524013
"HTML library (JS/CSS/etc.) directory",
2399624014
"Additional file resources to be copied to output directory",
2399724015
"Additional file resources to be copied to output directory",
24016+
"Path to brand.yml or object with light and dark paths to\nbrand.yml",
2399824017
"Options for <code>quarto preview</code>",
2399924018
"Scripts to run as a pre-render step",
2400024019
"Scripts to run as a post-render step",
@@ -24344,6 +24363,7 @@ var require_yaml_intelligence_resources = __commonJS({
2434424363
"HTML library (JS/CSS/etc.) directory",
2434524364
"Additional file resources to be copied to output directory",
2434624365
"Additional file resources to be copied to output directory",
24366+
"Path to brand.yml or object with light and dark paths to\nbrand.yml",
2434724367
"Options for <code>quarto preview</code>",
2434824368
"Scripts to run as a pre-render step",
2434924369
"Scripts to run as a post-render step",
@@ -24907,12 +24927,12 @@ var require_yaml_intelligence_resources = __commonJS({
2490724927
mermaid: "%%"
2490824928
},
2490924929
"handlers/mermaid/schema.yml": {
24910-
_internalId: 197505,
24930+
_internalId: 197539,
2491124931
type: "object",
2491224932
description: "be an object",
2491324933
properties: {
2491424934
"mermaid-format": {
24915-
_internalId: 197497,
24935+
_internalId: 197531,
2491624936
type: "enum",
2491724937
enum: [
2491824938
"png",
@@ -24928,7 +24948,7 @@ var require_yaml_intelligence_resources = __commonJS({
2492824948
exhaustiveCompletions: true
2492924949
},
2493024950
theme: {
24931-
_internalId: 197504,
24951+
_internalId: 197538,
2493224952
type: "anyOf",
2493324953
anyOf: [
2493424954
{

src/resources/editor/tools/yaml/all-schema-definitions.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/resources/editor/tools/yaml/web-worker.js

Lines changed: 26 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)