Skip to content

Commit

Permalink
Merge branch 'main' into jk/quartonotebookrunner
Browse files Browse the repository at this point in the history
  • Loading branch information
jkrumbiegel authored Mar 14, 2024
2 parents c51ffc6 + b9e30ae commit cf0e0e4
Show file tree
Hide file tree
Showing 27 changed files with 1,564 additions and 1,361 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/actions/quarto-dev/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,19 @@ runs:
- name: Basic dev mode sanity check
shell: pwsh
run: |
If ( "$(quarto --version)" -ne "99.9.9") { Exit 1 }
If ( $(quarto --paths | Select-String -Pattern "package[/\\]+dist[/\\]+share") -ne $null ) { Exit 1 }
If ( "$(git status --porcelain)" -ne "" ) { Exit 1 }
If ( "$(quarto --version)" -ne "99.9.9") {
echo "Unexpected version detected: $(quarto --version)"
Exit 1
}
If ( $(quarto --paths | Select-String -Pattern "package[/\\]+dist[/\\]+share") -ne $null ) {
echo "Unexpected package/dist/share path detected: $(quarto --paths)"
Exit 1
}
If ( "$(git status --porcelain)" -ne "" ) {
echo "Uncommitted changes detected:"
git status --porcelain
Exit 1
}
- name: Quarto Check
if: runner.debug == '1'
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ jobs:
echo -e "\n\nFull ${version} changelog up to this version:\n" >> "release_note.md"
echo -e " * View: https://github.com/${GITHUB_REPOSITORY}/blob/v${version_full}/news/changelog-${version}.md\n" >> "release_note.md"
echo -e " * Download: https://github.com/${GITHUB_REPOSITORY}/releases/download/v${version_full}/changelog.md\n" >> "release_note.md"
echo -e "" >> "release_note.md"
echo -e "Due to an issue with upstream dependency, the RHEL build may not included in this release. Follow #8944 for more information." >> "release_note.md"
# TODO: uncomment this again if new issue with RHEL build
# echo -e "" >> "release_note.md"
# echo -e "Due to an issue with upstream dependency, the RHEL build may not included in this release." >> "release_note.md"
- name: Upload Artifact
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -197,9 +198,9 @@ jobs:
source ./configuration
echo Placing custom Deno ${DENO:1}. See available versions at https://anaconda.org/conda-forge/deno/files
curl -L https://anaconda.org/conda-forge/deno/${DENO:1}/download/linux-64/deno-${DENO:1}-h335b0a9_1.conda --output deno.conda
curl -L https://anaconda.org/conda-forge/deno/${DENO:1}/download/linux-64/deno-${DENO:1}-hfc7925d_0.conda --output deno.conda
unzip deno.conda
tar --use-compress-program=unzstd -xvf pkg-deno-${DENO:1}-h335b0a9_1.tar.zst
tar --use-compress-program=unzstd -xvf pkg-deno-${DENO:1}-hfc7925d_0.tar.zst
cp bin/deno package/pkg-working/bin/tools/x86_64/deno
- name: Make Tarball
Expand Down
5 changes: 1 addition & 4 deletions configuration
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@ export TYPST=0.10.0
# (use commit hash from bslib repo)

# 0.5.1 + consolidated components
export BOOTSTRAP=ad946cafdbf1c91cfd714cb39948bb203ae66e66
# NOTE: HTML TOOLS has a manually committed fill.css file which will be officially
# released in htmltools 0.5.7

export BOOTSTRAP=ad946cafdbf1c91cfd714cb39948bb203ae66e66
export HTMLTOOLS=0.5.7
export BOOTSTRAP_FONT=1.11.1
export BOOTSWATCH=5.3.1
Expand Down
6 changes: 3 additions & 3 deletions dev-docs/feature-format-matrix/create_table.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import yaml
import json
import glob
import pathlib

class Trie:

Expand Down Expand Up @@ -103,8 +103,8 @@ def table_cell(entry, _feature, _format_name, format_config):

def compute_trie():
trie = Trie()
for entry in glob.glob("qmd-files/**/document.qmd", recursive=True):
feature = entry.split("/")[1:-1]
for entry in pathlib.Path(".").glob("qmd-files/**/document.qmd"):
feature = entry.parts[1:-1]
front_matter = extract_metadata_from_file(entry)
try:
format = front_matter["format"]
Expand Down
13 changes: 10 additions & 3 deletions news/changelog-1.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ All changes included in 1.5:
- ([#8118](https://github.com/quarto-dev/quarto-cli/issues/8118)): Add support for `body-classes` to add classes to the document body.
- ([#8311](https://github.com/quarto-dev/quarto-cli/issues/8311)): Correct z-order for margins with no contents
- ([#8862](https://github.com/quarto-dev/quarto-cli/issues/8862)): Properly deal with an `aside` within a definition list.
- ([#8990](https://github.com/quarto-dev/quarto-cli/issues/8990)): Copy button now works for embedded code source in modal window when optin-in `code-tools` feature.

## PDF Format

Expand Down Expand Up @@ -65,6 +66,7 @@ All changes included in 1.5:
- ([#8627](https://github.com/quarto-dev/quarto-cli/issues/8627)): Localize the text that appears as placeholder in listing filters.
- ([#8715](https://github.com/quarto-dev/quarto-cli/issues/8715)): Listings should respect `image: false`
- ([#8860](https://github.com/quarto-dev/quarto-cli/discussions/8860)): Don't show duplicate author names.
- ([#9030](https://github.com/quarto-dev/quarto-cli/discussions/9030)): Warn (rather than error) when listing globs produce an empty listing (as this is permissable).

## Manuscripts

Expand All @@ -78,7 +80,8 @@ All changes included in 1.5:

## Shortcodes

- ([#8316](https://github.com/quarto-dev/quarto-cli/issues/8316)): Add fallback value for the `env` shortcode
- ([#8316](https://github.com/quarto-dev/quarto-cli/issues/8316)): Add fallback value for the `env` shortcode.
- ([#9011](https://github.com/quarto-dev/quarto-cli/issues/9011)): `embed` shortcode now renders the embedded document without error when it is using knitr engine and have some outputs with HTML dependencies.

## Lightbox Images

Expand All @@ -101,7 +104,7 @@ All changes included in 1.5:

- ([#8939](https://github.com/quarto-dev/quarto-cli/pull/8939)): `quarto inspect` now takes an additional optional parameter to specify the output file, and provides the graph of include dependencies for the inspection target.

## Other Fixes
## Other Fixes and Improvements

- ([#8119](https://github.com/quarto-dev/quarto-cli/issues/8119)): More intelligently detect when ejs templates are modified during development, improving quality of life during preview.
- ([#8177](https://github.com/quarto-dev/quarto-cli/issues/8177)): Use an explicit path to `sysctl` when detecting MacOS architecture. (author: @kevinushey)
Expand All @@ -117,6 +120,10 @@ All changes included in 1.5:
- ([#8873](https://github.com/quarto-dev/quarto-cli/issues/8873)): Don't overwrite supporting files when creating a project.
- ([#8937](https://github.com/quarto-dev/quarto-cli/issues/8937)): Fix unix launcher script to properly handle spaces in the path to the quarto executable.
- ([#8898](https://github.com/quarto-dev/quarto-cli/issues/8898)): `.deb` and `.tar.gz` bundle contents are now associated to root user and group instead of default user and group for CI build runners.
- Add support for `{{< lipsum >}}` shortcode, which is useful for emitting placeholder text. Specify a specific number of paragraphs (`{{< lipsum 3 >}}`).
- ([#9041](https://github.com/quarto-dev/quarto-cli/issues/9041)): When creating an automatic citation key, replace spaces with underscores in inferred keys.
- ([#9059](https://github.com/quarto-dev/quarto-cli/issues/9059)): `quarto run` now properly works on Windows with Lua scripts.
- Add support for `{{< lipsum >}}` shortcode, which is useful for emitting placeholder text. Provide a specific number of paragraphs (`{{< lipsum 3 >}}`).
- Resolve data URIs in Pandoc's mediabag when rendering documents.
- Increase v8's max heap size by default, to avoid out-of-memory errors when rendering large documents (also cf. https://github.com/denoland/deno/issues/18935).
- Upgrade Deno to 1.41.0
- `quarto install tinytex` will now try to set the default CTAN repository to the nearest mirror resolved from https://mirror.ctan.org.
3 changes: 2 additions & 1 deletion package/src/common/update-html-dependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ import * as ld from "../../../src/core/lodash.ts";
import { runCmd } from "../util/cmd.ts";
import { applyGitPatches, Repo, withRepo } from "../util/git.ts";

import { download, unzip } from "../util/utils.ts";
import { download } from "../util/utils.ts";
import { Configuration } from "./config.ts";
import { visitLines } from "../../../src/core/file.ts";
import { copyMinimal } from "../../../src/core/copy.ts";
import { kSourceMappingRegexes } from "../../../src/config/constants.ts";
import { unzip } from "../../../src/core/zip.ts";

export async function updateHtmlDependencies(config: Configuration) {
info("Updating Bootstrap with version info:");
Expand Down
19 changes: 9 additions & 10 deletions src/command/render/codetools.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/*
* codetools.ts
*
* Copyright (C) 2020-2022 Posit Software, PBC
*
*/
* codetools.ts
*
* Copyright (C) 2020-2022 Posit Software, PBC
*/

import { Document, Element } from "../../core/deno-dom.ts";
import {
Expand Down Expand Up @@ -32,7 +31,7 @@ const kHideAllCodeLinkId = "quarto-hide-all-code";
const kShowAllCodeLinkId = "quarto-show-all-code";
const kViewSourceLinkId = "quarto-view-source";
const kEmbeddedSourceClass = "quarto-embedded-source-code";
const kEmbeddedSourceModalId = kEmbeddedSourceClass + "-modal";
export const kEmbeddedSourceModalId = kEmbeddedSourceClass + "-modal";
const kEmbeddedSourceModalLabelId = kEmbeddedSourceClass + "-modal-label";
const kKeepSourceSentinel = "quarto-executable-code-5450563D";

Expand All @@ -56,7 +55,7 @@ export function resolveKeepSource(
const codeTools = format.render?.[kCodeTools];
if (
codeTools === true ||
(typeof (codeTools) === "object" &&
(typeof codeTools === "object" &&
(codeTools?.source === undefined || codeTools?.source === true))
) {
format.render[kKeepSource] = true;
Expand Down Expand Up @@ -328,17 +327,17 @@ function resolveCodeTools(format: Format, doc: Document): CodeTools {
const kCodeCaption = format.language[kCodeToolsMenuCaption]!;
const codeTools = format?.render[kCodeTools];
const codeToolsResolved = {
source: typeof (codeTools) === "boolean"
source: typeof codeTools === "boolean"
? codeTools
: codeTools?.source !== undefined
? codeTools?.source
: true,
toggle: typeof (codeTools) === "boolean"
toggle: typeof codeTools === "boolean"
? codeTools
: codeTools?.toggle !== undefined
? !!codeTools?.toggle
: true,
caption: typeof (codeTools) === "boolean"
caption: typeof codeTools === "boolean"
? kCodeCaption
: codeTools?.caption || kCodeCaption,
};
Expand Down
4 changes: 3 additions & 1 deletion src/core/csl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ export function suggestId(author: CSLName[], date?: CSLDate) {
}

// Create a deduplicated string against the existing entries
let suggestedId = `${citeIdLeading.toLowerCase()}${datePart}`;
let suggestedId = `${
citeIdLeading.replaceAll(/\s+/g, "_").toLowerCase()
}${datePart}`;
if (suggestedId.length === 0) {
suggestedId = "untitled";
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/puppeteer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ export async function getBrowserExecutablePath() {
if (executablePath === undefined) {
error("Chrome not found");
info(
"\nNo Chrome or Chromium installation was detected.\n\nPlease run 'quarto tools install chromium' to install Chromium.\n",
"\nNo Chrome or Chromium installation was detected.\n\nPlease run 'quarto install chromium' to install Chromium.\n",
);
throw new Error();
}
Expand Down
15 changes: 5 additions & 10 deletions src/core/run/lua.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/*
* lua.ts
*
* Copyright (C) 2020-2022 Posit Software, PBC
*
*/
* lua.ts
*
* Copyright (C) 2020-2022 Posit Software, PBC
*/

import { info } from "../../deno_ral/log.ts";

Expand All @@ -25,7 +24,7 @@ export const luaRunHandler: RunHandler = {
options?: RunHandlerOptions,
) => {
// lua run handlers don't support stdin
if (typeof (stdin) === "string") {
if (typeof stdin === "string") {
throw new Error("Lua run handlers cannot be passed stdin");
}

Expand All @@ -37,10 +36,6 @@ export const luaRunHandler: RunHandler = {
"--to",
"plain",
];
if (isWindows()) {
cmd.push("--lua-filter");
cmd.push(resourcePath("filters/init/init.lua"));
}
cmd.push(
"--lua-filter",
script,
Expand Down
4 changes: 2 additions & 2 deletions src/core/zip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { isWindows } from "./platform.ts";
import { execProcess } from "./process.ts";
import { safeWindowsExec } from "./windows.ts";

export function unzip(file: string) {
const dir = dirname(file);
export function unzip(file: string, dir?: string) {
if (!dir) dir = dirname(file);

if (file.endsWith("zip")) {
// It's a zip file
Expand Down
13 changes: 11 additions & 2 deletions src/format/html/format-html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ import {
SassBundle,
} from "../../config/types.ts";

import { formatHasCodeTools } from "../../command/render/codetools.ts";
import {
formatHasCodeTools,
kEmbeddedSourceModalId,
} from "../../command/render/codetools.ts";

import { createHtmlFormat } from "./../formats-shared.ts";

Expand Down Expand Up @@ -651,6 +654,9 @@ function htmlFormatPostprocessor(

// process all of the code blocks
const codeBlocks = doc.querySelectorAll("pre.sourceCode");
const EmbedSourceModal = doc.querySelector(
`#${kEmbeddedSourceModalId}`,
);
for (let i = 0; i < codeBlocks.length; i++) {
const code = codeBlocks[i] as Element;

Expand All @@ -670,10 +676,13 @@ function htmlFormatPostprocessor(
code.parentElement?.classList.add("hidden");
}

// insert code copy button
// insert code copy button (with specfic attribute when inside a modal)
if (codeCopy) {
code.classList.add("code-with-copy");
const copyButton = createCodeCopyButton(doc, format);
if (EmbedSourceModal && EmbedSourceModal.contains(code)) {
copyButton.setAttribute("data-in-quarto-modal", "");
}
code.appendChild(copyButton);
}

Expand Down
2 changes: 1 addition & 1 deletion src/project/types/website/listing/website-listing-read.ts
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ async function readContents(
});
if (readFiles.length === 0) {
const projRelativePath = relative(project.dir, source);
throw new Error(
warning(
`The listing in '${projRelativePath}' using the following contents:\n- ${
contentGlobs.join("\n- ")
}\ndoesn't match any files or folders.`,
Expand Down
17 changes: 12 additions & 5 deletions src/resources/editor/tools/vs-code.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11412,6 +11412,13 @@ var require_yaml_intelligence_resources = __commonJS({
string: {
description: "The primary title of the item."
}
},
id: {
anyOf: [
"string",
"number"
],
description: 'Citation identifier for the item (e.g. "item1"). Will be autogenerated if not provided.'
}
}
}
Expand Down Expand Up @@ -20385,7 +20392,7 @@ var require_yaml_intelligence_resources = __commonJS({
},
"Guest (e.g.&nbsp;on a TV show or podcast).",
"Host of the item (e.g.&nbsp;of a TV show or podcast).",
"A value which uniquely identifies this item.",
"Citation identifier for the item (e.g.&nbsp;\u201Citem1\u201D). Will be\nautogenerated if not provided.",
"Illustrator (e.g.&nbsp;of a children\u2019s book or graphic novel).",
"Interviewer (e.g.&nbsp;of an interview).",
"International Standard Book Number (e.g.&nbsp;\u201C978-3-8474-1017-1\u201D).",
Expand Down Expand Up @@ -20540,7 +20547,7 @@ var require_yaml_intelligence_resources = __commonJS({
},
"Guest (e.g.&nbsp;on a TV show or podcast).",
"Host of the item (e.g.&nbsp;of a TV show or podcast).",
"A value which uniquely identifies this item.",
"Citation identifier for the item (e.g.&nbsp;\u201Citem1\u201D). Will be\nautogenerated if not provided.",
"Illustrator (e.g.&nbsp;of a children\u2019s book or graphic novel).",
"Interviewer (e.g.&nbsp;of an interview).",
"International Standard Book Number (e.g.&nbsp;\u201C978-3-8474-1017-1\u201D).",
Expand Down Expand Up @@ -22927,12 +22934,12 @@ var require_yaml_intelligence_resources = __commonJS({
mermaid: "%%"
},
"handlers/mermaid/schema.yml": {
_internalId: 182250,
_internalId: 182259,
type: "object",
description: "be an object",
properties: {
"mermaid-format": {
_internalId: 182242,
_internalId: 182251,
type: "enum",
enum: [
"png",
Expand All @@ -22948,7 +22955,7 @@ var require_yaml_intelligence_resources = __commonJS({
exhaustiveCompletions: true
},
theme: {
_internalId: 182249,
_internalId: 182258,
type: "anyOf",
anyOf: [
{
Expand Down
Loading

0 comments on commit cf0e0e4

Please sign in to comment.