Skip to content

Commit 8117731

Browse files
authored
Merge branch 'main' into fix/issue11664
2 parents f0fc230 + ca05876 commit 8117731

Some content is hidden

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

56 files changed

+659
-181
lines changed

news/changelog-1.7.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ All changes included in 1.7:
88
- ([#11580](https://github.com/quarto-dev/quarto-cli/issues/11580)): Fix regression with documents containing `categories` fields that are not strings.
99
- ([#11752](https://github.com/quarto-dev/quarto-cli/issues/11752)): Fix regression with non-alphanumeric characters in `categories` preventing correct filtering of listing.
1010
- ([#11561](https://github.com/quarto-dev/quarto-cli/issues/11561)): Fix a regression with `$border-color` that impacted, callouts borders, tabset borders, and table borders of the defaults themes. `$border-color` is now correctly a mixed of `$body-color` and `$body-bg` even for the default theme.
11+
- ([#11943](https://github.com/quarto-dev/quarto-cli/issues/11943)): Fix callout title color on dark theme in revealjs following Revealjs update in quarto 1.6.
1112

1213
## YAML validation
1314

@@ -44,6 +45,7 @@ All changes included in 1.7:
4445
- ([#11578](https://github.com/quarto-dev/quarto-cli/issues/11578)): Typst column layout widths use fractional `fr` units instead of percent `%` units for unitless and default widths in order to fill the enclosing block and not spill outside it.
4546
- ([#11676](https://github.com/quarto-dev/quarto-cli/pull/11676)): Convert unitless image widths from pixels to inches for column layouts.
4647
- ([#11835](https://github.com/quarto-dev/quarto-cli/issues/11835)): Take markdown structure into account when detecting minimum heading level.
48+
- ([#11964](https://github.com/quarto-dev/quarto-cli/issues/11964)): Using panel layout without a crossref label now correctly do not add an empty `#block[]` that was leading to an unnecessary space in output.
4749

4850
## Lua Filters and extensions
4951

package/src/common/cyclic-dependencies.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { runCmd } from "../util/cmd.ts";
1111
import { Configuration, readConfiguration } from "./config.ts";
1212
import { error, info } from "../../../src/deno_ral/log.ts";
1313
import { progressBar } from "../../../src/core/console.ts";
14-
import { md5Hash } from "../../../src/core/hash.ts";
14+
import { md5HashSync } from "../../../src/core/hash.ts";
1515

1616
export function cycleDependenciesCommand() {
1717
return new Command()
@@ -186,7 +186,7 @@ function findCyclicDependencies(
186186
// creates a hash for a set of paths (a cycle)
187187
const hash = (paths: string[]) => {
188188
const string = paths.join(" ");
189-
return md5Hash(string);
189+
return md5HashSync(string);
190190
};
191191

192192
// The current import stack

package/src/common/patches/revealjs-theme-0001-dracula.patch

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
diff --git a/src/resources/formats/revealjs/themes/dracula.scss b/src/resources/formats/revealjs/themes/dracula.scss
2-
index 5330fbc1b..45498dd41 100644
2+
index 5330fbc1b..fe068d9a8 100644
33
--- a/src/resources/formats/revealjs/themes/dracula.scss
44
+++ b/src/resources/formats/revealjs/themes/dracula.scss
5-
@@ -1,106 +1,88 @@
5+
@@ -1,106 +1,90 @@
66
/**
77
* Dracula Dark theme for reveal.js.
88
* Based on https://draculatheme.com
@@ -151,7 +151,9 @@ index 5330fbc1b..45498dd41 100644
151151
- }
152152
+ strong,
153153
+ b {
154-
+ color: var(--r-bold-color);
154+
+ &:not(.callout-title strong, .callout-tile b) {
155+
+ color: var(--r-bold-color);
156+
+ }
155157
+ }
156158
+ em,
157159
+ i,

package/src/common/update-html-dependencies.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1123,7 +1123,9 @@ async function updateGithubSourceCodeDependency(
11231123
await unzip(zipFile, working);
11241124

11251125
await onDownload(working, version);
1126-
if (patches) await applyGitPatches(patches);
1126+
if (patches) {
1127+
await applyGitPatches(patches);
1128+
}
11271129
} else {
11281130
throw new Error(`${versionEnvVar} is not defined`);
11291131
}

src/command/preview/cmd.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ export const previewCommand = new Command()
278278
// get project and preview format
279279
const nbContext = notebookContext();
280280
const project = (await projectContext(dirname(file), nbContext)) ||
281-
singleFileProjectContext(file, nbContext);
281+
(await singleFileProjectContext(file, nbContext));
282282
const formats = await (async () => {
283283
const services = renderServices(nbContext);
284284
try {

src/command/preview/preview.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ export async function previewFormat(
373373
return format;
374374
}
375375
const nbContext = notebookContext();
376-
project = project || singleFileProjectContext(file, nbContext);
376+
project = project || (await singleFileProjectContext(file, nbContext));
377377
formats = formats ||
378378
await withRenderServices(
379379
nbContext,
@@ -485,6 +485,8 @@ export async function renderForPreview(
485485
[],
486486
));
487487

488+
renderResult.context.cleanup();
489+
488490
return {
489491
file,
490492
format: renderResult.files[0].format,

src/command/publish/cmd.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ async function createPublishOptions(
339339

340340
// check for directory (either website or single-file project)
341341
const project = (await projectContext(path, nbContext)) ||
342-
singleFileProjectContext(path, nbContext);
342+
(await singleFileProjectContext(path, nbContext));
343343
if (Deno.statSync(path).isDirectory) {
344344
if (projectIsWebsite(project)) {
345345
input = project;

src/command/render/cmd.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,9 @@ export const renderCommand = new Command()
245245
const services = renderServices(notebookContext());
246246
try {
247247
renderResultInput = relative(Deno.cwd(), walk.path) || ".";
248+
if (renderResult) {
249+
renderResult.context.cleanup();
250+
}
248251
renderResult = await render(renderResultInput, {
249252
services,
250253
flags,
@@ -255,6 +258,7 @@ export const renderCommand = new Command()
255258

256259
// check for error
257260
if (renderResult.error) {
261+
renderResult.context.cleanup();
258262
throw renderResult.error;
259263
}
260264
} finally {
@@ -275,6 +279,10 @@ export const renderCommand = new Command()
275279
if (finalOutput) {
276280
info("Output created: " + finalOutput + "\n");
277281
}
282+
283+
if (renderResult) {
284+
renderResult.context.cleanup();
285+
}
278286
}
279287
} else {
280288
throw new Error(`No valid input files passed to render`);

src/command/render/defaults.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,12 @@ export async function generateDefaults(
3939
let allDefaults: FormatPandoc | undefined;
4040

4141
if (options.format.pandoc) {
42-
allDefaults = (options.format.pandoc
43-
? ld.cloneDeep(options.format.pandoc)
44-
: {}) as FormatPandoc;
42+
allDefaults = {
43+
...(options.format.pandoc || {}),
44+
variables: {
45+
...(options.format.pandoc?.variables || {}),
46+
},
47+
} as FormatPandoc;
4548

4649
// resolve filters
4750
const resolvedFilters = await resolveFilters(

src/command/render/filters.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,7 @@ function initFilterParams(dependenciesFile: string) {
713713
const kQuartoFilterMarker = "quarto";
714714
const kQuartoCiteProcMarker = "citeproc";
715715

716+
// NB: this mutates `pandoc.citeproc`
716717
export async function resolveFilters(
717718
filters: QuartoFilter[],
718719
options: PandocOptions,

src/command/render/flags.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ import {
2727
import { isQuartoMetadata } from "../../config/metadata.ts";
2828
import { RenderFlags, RenderOptions } from "./types.ts";
2929

30-
import * as ld from "../../core/lodash.ts";
31-
3230
import { isAbsolute, SEP_PATTERN } from "../../deno_ral/path.ts";
3331
import { normalizePath } from "../../core/path.ts";
3432
import { removeFlags } from "../../core/flags.ts";
@@ -471,7 +469,12 @@ export function removePandocToArg(args: string[]) {
471469
}
472470

473471
export function removePandocTo(renderOptions: RenderOptions) {
474-
renderOptions = ld.cloneDeep(renderOptions);
472+
renderOptions = {
473+
...renderOptions,
474+
flags: {
475+
...(renderOptions.flags || {}),
476+
},
477+
} as RenderOptions;
475478
delete renderOptions.flags?.to;
476479
if (renderOptions.pandocArgs) {
477480
renderOptions.pandocArgs = removePandocToArg(renderOptions.pandocArgs);

src/command/render/freeze.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,9 @@ import {
2020
LF,
2121
} from "../../deno_ral/fs.ts";
2222

23-
import { cloneDeep } from "../../core/lodash.ts";
24-
2523
import { inputFilesDir } from "../../core/render.ts";
2624
import { TempContext } from "../../core/temp.ts";
27-
import { md5Hash } from "../../core/hash.ts";
25+
import { md5HashSync } from "../../core/hash.ts";
2826
import {
2927
normalizePath,
3028
removeIfEmptyDir,
@@ -55,13 +53,15 @@ export function freezeExecuteResult(
5553
result: ExecuteResult,
5654
) {
5755
// resolve includes within executeResult
58-
result = cloneDeep(result) as ExecuteResult;
56+
const innerResult = {
57+
...result,
58+
} as ExecuteResult;
5959
const resolveIncludes = (
6060
name: "include-in-header" | "include-before-body" | "include-after-body",
6161
) => {
62-
if (result.includes) {
63-
if (result.includes[name]) {
64-
result.includes[name] = result.includes[name]!.map((file) =>
62+
if (innerResult.includes) {
63+
if (innerResult.includes[name]) {
64+
innerResult.includes[name] = innerResult.includes[name]!.map((file) =>
6565
// Storing file content using LF line ending
6666
format(Deno.readTextFileSync(file), LF)
6767
);
@@ -73,7 +73,7 @@ export function freezeExecuteResult(
7373
resolveIncludes(kIncludeAfterBody);
7474

7575
// make the supporting dirs relative to the input file dir
76-
result.supporting = result.supporting.map((file) => {
76+
innerResult.supporting = innerResult.supporting.map((file) => {
7777
if (isAbsolute(file)) {
7878
return relative(normalizePath(dirname(input)), file);
7979
} else {
@@ -88,7 +88,7 @@ export function freezeExecuteResult(
8888
const freezeJsonFile = freezeResultFile(input, output, true);
8989
Deno.writeTextFileSync(
9090
freezeJsonFile,
91-
JSON.stringify({ hash, result }, undefined, 2),
91+
JSON.stringify({ hash, result: innerResult }, undefined, 2),
9292
);
9393

9494
// return the file
@@ -310,7 +310,7 @@ export function removeFreezeResults(filesDir: string) {
310310
function freezeInputHash(input: string) {
311311
// Calculate the hash on a content with LF line ending to avoid
312312
// different hash on different OS (#3599)
313-
return md5Hash(format(Deno.readTextFileSync(input), LF));
313+
return md5HashSync(format(Deno.readTextFileSync(input), LF));
314314
}
315315

316316
// don't use _files suffix in freezer

src/command/render/pandoc-html.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ export async function resolveSassBundles(
5353
inputDir: string,
5454
extras: FormatExtras,
5555
format: Format,
56-
temp: TempContext,
5756
project: ProjectContext,
5857
) {
5958
extras = cloneDeep(extras);
@@ -159,11 +158,11 @@ export async function resolveSassBundles(
159158

160159
for (const target of targets) {
161160
let cssPath: string | undefined;
162-
cssPath = await compileSass(target.bundles, temp);
161+
cssPath = await compileSass(target.bundles, project);
163162
// First, Clean CSS
164163
cleanSourceMappingUrl(cssPath);
165164
// look for a sentinel 'dark' value, extract variables
166-
const cssResult = await processCssIntoExtras(cssPath, extras, temp);
165+
const cssResult = await processCssIntoExtras(cssPath, extras, project);
167166
cssPath = cssResult.path;
168167

169168
// it can happen that processing generate an empty css file (e.g quarto-html deps with Quarto CSS variables)
@@ -261,7 +260,7 @@ export async function resolveSassBundles(
261260
inputDir,
262261
extras,
263262
format,
264-
temp,
263+
project,
265264
hasDarkStyles ? "light" : "default",
266265
defaultStyle,
267266
);
@@ -272,7 +271,7 @@ export async function resolveSassBundles(
272271
inputDir,
273272
extras,
274273
format,
275-
temp,
274+
project,
276275
"dark",
277276
defaultStyle,
278277
);
@@ -291,7 +290,7 @@ async function resolveQuartoSyntaxHighlighting(
291290
inputDir: string,
292291
extras: FormatExtras,
293292
format: Format,
294-
temp: TempContext,
293+
project: ProjectContext,
295294
style: "dark" | "light" | "default",
296295
defaultStyle?: "dark" | "light",
297296
) {
@@ -381,7 +380,7 @@ async function resolveQuartoSyntaxHighlighting(
381380
rules: rules.join("\n"),
382381
},
383382
}],
384-
temp,
383+
project,
385384
false,
386385
);
387386

@@ -500,8 +499,9 @@ interface CSSResult {
500499
async function processCssIntoExtras(
501500
cssPath: string,
502501
extras: FormatExtras,
503-
temp: TempContext,
502+
project: ProjectContext,
504503
): Promise<CSSResult> {
504+
const { temp } = project;
505505
extras.html = extras.html || {};
506506

507507
const css = Deno.readTextFileSync(cssPath);

0 commit comments

Comments
 (0)