Skip to content

Commit 86724da

Browse files
author
Al Manning
committed
Merge branch 'main' into feature/site-nesting
2 parents 048aa47 + f07feb7 commit 86724da

File tree

211 files changed

+8071
-1814
lines changed

Some content is hidden

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

211 files changed

+8071
-1814
lines changed

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ print("Hello Quarto!")
2222

2323
I have (if applicable):
2424

25-
- [ ] filed a [contributor agreement](../CONTRIBUTING.md).
25+
- [ ] filed a [contributor agreement](https://github.com/quarto-dev/quarto-cli/blob/main/CONTRIBUTING.md).
2626
- [ ] referenced the GitHub issue this PR closes
2727
- [ ] updated the appropriate changelog

.github/workflows/test-smokes.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ jobs:
7878
- uses: ./.github/workflows/actions/quarto-dev
7979

8080
- name: Install Tinytex
81+
env:
82+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8183
run: |
8284
quarto install tinytex
8385

news/changelog-1.3.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
## Changes
2-
31
## Jupyter Notebooks
42

53
- Add support for embedding cell outputs in quarto documents using `{{< embed >}}`. You can address cells by Id, Tag, or label, such as `{{< embed mynotebook.ipynb#fig-output >}}` which would embed the output of a cell with the label `fig-output`). You can also provide a list of ids like `{{< embed mynotebook.ipynb#fig-output,tbl-out >}}`.
4+
- Only attempt to postprocess `text/plain` output if it's nonempty ([#3896](https://github.com/quarto-dev/quarto-cli/issues/3896)).
5+
6+
## Code Annotation
7+
8+
- Add support for annotation of code cells (executable or non-executable). You can read more about code annotation at [https://www.quarto.org/docs/prerelease/1.3.html](https://www.quarto.org/docs/prerelease/1.3.html).
69

710
## HTML Format
811

@@ -33,6 +36,7 @@
3336
- Add support for automatically converting SVG images to PDF ([#2575](https://github.com/quarto-dev/quarto-cli/issues/2575))
3437
- Previously, if the `pdf-engine` was set to `latexmk`, we would bypass many features of Quarto and use Pandoc to produce the PDF output. Starting in in Quarto 1.3, all Quarto features will be enabled for the `latexmk` engine and `latexmk` will be used to run the PDF generation loop.
3538
- Fix author processing in default PDFs for complex author names (#3483)
39+
- Remove excessive vertical space between theorem type blocks ([#3776](https://github.com/quarto-dev/quarto-cli/issues/3776)).
3640

3741
## Beamer Format
3842

@@ -64,6 +68,9 @@
6468
- Listings now support `template-params`, which will be passed to custom EJS templates in a variable called `templateParams` when a listing is rendered.
6569
- Custom listing objects now resolve `path: ` fields into the metadata that would be generated by standard listings, giving custom listing access to computed metadata like `reading-time`, etc.
6670
- Improve support for `date-modified` in listings
71+
- Improve support for `yml` based listings by supporting usage of title and description from `yml`.
72+
- Allow listings in project to point directly to non-input files (such as `yml` files) to use for contents.
73+
- Allow `sort: false` to disable any sorting, allowing items to appear in their original / natural order. (#3296)
6774

6875
## Websites
6976

@@ -83,6 +90,10 @@
8390

8491
- `quarto.version()` now returns `Version` object that simplifies comparison (thank you @tarleb)
8592

93+
## HTML Output
94+
95+
- HTML output will not decorate links within source code (for example, from `code-link: true`) with external icons. (#3755)
96+
8697
## Miscellaneous
8798

8899
- Work around pandoc strict checking of `number-offset` type. ([#3126](https://github.com/quarto-dev/quarto-cli/issues/3126))
@@ -94,3 +105,12 @@
94105
- Add new `kbd` shortcode, to describe keyboard keys ([#3384](https://github.com/quarto-dev/quarto-cli/issues/3384)). See the [pre-release documentation](https://quarto.org/docs/prerelease/1.3.html) for details.
95106
- Replace default style for date picker component in OJS ([#2863](https://github.com/quarto-dev/quarto-cli/issues/2863)).
96107
- `quarto check` now supports `quarto check versions` for checking binary dependency versions in the case of custom binaries ([#3602](https://github.com/quarto-dev/quarto-cli/issues/3602)).
108+
- the API for shortcode handlers in lua now accepts a fourth parameter `raw_args` which hold the unparsed arguments in a table ([#3833](https://github.com/quarto-dev/quarto-cli/issues/3833)).
109+
- remove scaffolding div from conditional content in final output ([#3847](https://github.com/quarto-dev/quarto-cli/issues/3847)).
110+
- ensure proof titles are appended to paragraph nodes ([#3772](https://github.com/quarto-dev/quarto-cli/issues/3772)).
111+
- Support parsing markdown in table captions in LaTeX and HTML tables ([#2573](https://github.com/quarto-dev/quarto-cli/issues/2573)).
112+
113+
## Pandoc filter changes
114+
115+
- Quarto 1.3 introduces the notion of Custom AST nodes to Pandoc filters. If you use Lua filters for processing callouts, tabsets, or conditional blocks, consult the [pre-release documentation](https://quarto.org/docs/prerelease/1.3.html) for how to change your filters to support the new syntax.
116+
- Quarto 1.3 now processes HTML tables (in Markdown input) into Pandoc AST nodes, which can be processed by user filters and output into non-HTML formats. In addition, it supports "embedded Markdown content" which will be resolved by quarto's processing, including shortcode and crossref resolution. See the [prerelease documentation](https://quarto.org/docs/prerelease/1.3.html) for more.

package/src/common/package-filters.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,22 @@ export function buildFilter(
2626
return "";
2727
}).trimStart();
2828

29+
const importSrcs = [];
2930
// append imports to src
3031
const importRe = /^import\("(.*)?"\)$/gm;
3132
let match = importRe.exec(imports);
3233
while (match) {
3334
const importFilePath = join(filterDir, match[1]);
35+
console.log(`Inlining ${match[1]} from ${importFilePath}`);
3436
let importSrc = Deno.readTextFileSync(importFilePath);
3537
if (!importSrc.endsWith("\n")) {
3638
importSrc += "\n";
3739
}
38-
src = `${importSrc}\n` + src;
40+
importSrcs.push(importSrc);
3941
match = importRe.exec(imports);
4042
}
43+
importSrcs.push(src);
44+
src = importSrcs.join("");
4145

4246
// write src to dist
4347
info(`Writing inlined file ${output}`);

package/src/common/prepare-dist.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,10 @@ function inlineFilters(config: Configuration) {
143143
info("Building inlined filters");
144144
const outDir = join(config.directoryInfo.share, "filters");
145145
const filtersToInline: Filter[] = [
146+
{ name: "main", dir: "." },
147+
{ name: "pagebreak", dir: "rmarkdown" },
146148
{ name: "quarto-init" },
147-
{ name: "normalize" },
148-
{ name: "quarto-pre" },
149149
{ name: "crossref" },
150-
{ name: "layout" },
151-
{ name: "quarto-post" },
152-
{ name: "pagebreak", dir: "rmarkdown" },
153-
{ name: "quarto-finalize" },
154150
];
155151

156152
filtersToInline.forEach((filter) => {

quarto-cli.code-workspace

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@
2727
},
2828
"[ejs]": {
2929
"editor.formatOnSave": false
30-
}
30+
},
31+
"deno.inlayHints.enumMemberValues.enabled": false,
32+
"deno.inlayHints.functionLikeReturnTypes.enabled": false,
33+
"deno.inlayHints.parameterNames.enabled": "none",
34+
"deno.inlayHints.parameterTypes.enabled": false,
35+
"deno.inlayHints.propertyDeclarationTypes.enabled": false,
36+
"deno.inlayHints.variableTypes.enabled": false,
37+
"deno.inlayHints.variableTypes.suppressWhenTypeMatchesName": false
3138
}
3239
}

src/command/command.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import { useCommand } from "./use/cmd.ts";
2828
import { addCommand } from "./add/cmd.ts";
2929
import { uninstallCommand } from "./uninstall/cmd.ts";
3030
import { createCommand } from "./create/cmd.ts";
31+
import { editorSupportCommand } from "./editor-support/cmd.ts";
3132

3233
// deno-lint-ignore no-explicit-any
3334
export function commands(): Command<any>[] {
@@ -54,5 +55,6 @@ export function commands(): Command<any>[] {
5455
toolsCommand,
5556
checkCommand,
5657
buildJsCommand,
58+
editorSupportCommand,
5759
];
5860
}

src/command/editor-support/cmd.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
* cmd.ts
3+
*
4+
* Copyright (C) 2020-2022 Posit Software, PBC
5+
*
6+
*/
7+
8+
import { Command } from "cliffy/command/mod.ts";
9+
import { crossrefCommand } from "./crossref.ts";
10+
11+
export const editorSupportCommand = new Command()
12+
.name("editor-support")
13+
.description(
14+
"Miscellaneous tools to support Quarto editor modes",
15+
)
16+
.hidden()
17+
.command("crossref", crossrefCommand);
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
/*
2+
* command.ts
3+
*
4+
* Copyright (C) 2020-2022 Posit Software, PBC
5+
*
6+
*/
7+
8+
import { join } from "path/posix.ts";
9+
import { readAll } from "streams/mod.ts";
10+
import { error } from "log/mod.ts";
11+
import { encode as base64Encode } from "encoding/base64.ts";
12+
13+
import { Command } from "cliffy/command/mod.ts";
14+
15+
import { execProcess } from "../../core/process.ts";
16+
import { pandocBinaryPath, resourcePath } from "../../core/resources.ts";
17+
import { globalTempContext } from "../../core/temp.ts";
18+
import { exitWithCleanup } from "../../core/cleanup.ts";
19+
20+
export const crossrefCommand = new Command()
21+
.description("Index cross references for content")
22+
.action(async () => {
23+
// read input
24+
const stdinContent = await readAll(Deno.stdin);
25+
const input = new TextDecoder().decode(stdinContent);
26+
27+
// create directory for indexing and write input into it
28+
const indexingDir = globalTempContext().createDir();
29+
30+
// setup index file and input type
31+
const indexFile = join(indexingDir, "index.json");
32+
Deno.env.set("QUARTO_CROSSREF_INDEX_PATH", indexFile);
33+
Deno.env.set("QUARTO_CROSSREF_INPUT_TYPE", "qmd");
34+
35+
// build command
36+
const cmd = [pandocBinaryPath(), "+RTS", "-K512m", "-RTS"];
37+
cmd.push(...[
38+
"--from",
39+
"markdown",
40+
"--to",
41+
"native",
42+
"--data-dir",
43+
resourcePath("pandoc/datadir"),
44+
"--lua-filter",
45+
resourcePath("filters/quarto-init/quarto-init.lua"),
46+
"--lua-filter",
47+
resourcePath("filters/crossref/crossref.lua"),
48+
]);
49+
50+
// create filter params
51+
const filterParams = base64Encode(
52+
JSON.stringify({
53+
["crossref-index-file"]: "index.json",
54+
["crossref-input-type"]: "qmd",
55+
}),
56+
);
57+
58+
// run pandoc
59+
const result = await execProcess(
60+
{
61+
cmd,
62+
cwd: indexingDir,
63+
env: {
64+
"QUARTO_FILTER_PARAMS": filterParams,
65+
"QUARTO_SHARE_PATH": resourcePath(),
66+
},
67+
},
68+
input,
69+
);
70+
71+
// check for error
72+
if (!result.success) {
73+
error("Error running Pandoc: " + result.stderr);
74+
exitWithCleanup(1);
75+
}
76+
77+
// write back the index
78+
Deno.stdout.writeSync(Deno.readFileSync(indexFile));
79+
});

src/command/publish/account.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ interface ProviderAccountToken extends AccountToken {
155155
export async function manageAccounts() {
156156
// build a list of all authorized accounts
157157
const accounts: ProviderAccountToken[] = [];
158-
for (const provider of await publishProviders()) {
158+
for (const provider of publishProviders()) {
159159
for (const account of await provider.accountTokens()) {
160160
if (account.type === AccountTokenType.Authorized) {
161161
accounts.push({ provider: provider.name, ...account });

0 commit comments

Comments
 (0)