Skip to content

Commit f9c5df7

Browse files
committed
Merge remote-tracking branch 'origin/main' into feature/enable-quarto-pub
2 parents 0575263 + ffd73a9 commit f9c5df7

File tree

20 files changed

+453
-118
lines changed

20 files changed

+453
-118
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,23 @@ body:
2828
attributes:
2929
label: "`quarto check` Output"
3030
description: Paste the output of `quarto check`.
31+
placeholder: |
32+
Place the result in code block syntax for better readability
33+
34+
```bash
35+
<insert quarto check result here>
36+
```
3137
3238
- type: textarea
3339
attributes:
3440
label: "`quarto tools check` Output"
3541
description: Paste the output of `quarto tools check`.
42+
placeholder: |
43+
Place the result in code block syntax for better readability
44+
45+
```bash
46+
<insert quarto tools check result here>
47+
```
3648
3749
- type: checkboxes
3850
attributes:

configuration

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ export ALGOLIA_SEARCH_INSIGHTS_JS=2.0.3
4242

4343

4444
# Quarto Info Version
45-
export QUARTO_VERSION=0.9
45+
export QUARTO_VERSION=1.0
4646
export QUARTO_NAME=Quarto
47-
export QUARTO_BUILD_RUN_OFFSET=-594
47+
export QUARTO_BUILD_RUN_OFFSET=-1252
4848

4949
# Configuration Target Directories
5050
export QUARTO_PACKAGE_DIR=package

src/command/render/pandoc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ export async function runPandoc(
177177
const cwd = dirname(options.source);
178178

179179
// build the pandoc command (we'll feed it the input on stdin)
180-
const cmd = [pandocBinaryPath()];
180+
const cmd = [pandocBinaryPath(), "+RTS", "-K512m", "-RTS"];
181181

182182
// build command line args
183183
const args = [...options.args];

src/command/render/project.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,12 @@ export async function renderProject(
294294
renderedFile.supporting = renderedFile.supporting.filter((file) =>
295295
file !== libDir
296296
);
297+
// ensure that we don't have overlapping paths in supporting
298+
renderedFile.supporting = renderedFile.supporting.filter((file) => {
299+
return !renderedFile.supporting!.some((dir) =>
300+
file.startsWith(dir) && file !== dir
301+
);
302+
});
297303
if (keepFiles) {
298304
renderedFile.supporting.map((file) => copyDir(file));
299305
} else {

src/command/use/cmd.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Copyright (C) 2021 by RStudio, PBC
55
*
66
*/
7-
import { Command } from "cliffy/command/mod.ts";
7+
import { Command, ValidationError } from "cliffy/command/mod.ts";
88

99
import { useTemplateCommand } from "./commands/template.ts";
1010

@@ -19,4 +19,11 @@ export const useCommand = new Command()
1919
.description(
2020
"Automate document or project setup tasks.",
2121
)
22+
.action((_options, type, _target) => {
23+
if (type !== useTemplateCommand.getName()) {
24+
throw new ValidationError(
25+
`Unknown type '${type}'- did you mean 'template'?`,
26+
);
27+
}
28+
})
2229
.command(useTemplateCommand.getName(), useTemplateCommand);

src/command/use/commands/template.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,14 @@ import {
1010
extensionSource,
1111
} from "../../../extension/extension-host.ts";
1212
import { info } from "log/mod.ts";
13-
import { Confirm, Input, Select } from "cliffy/prompt/mod.ts";
13+
import { Confirm, Input } from "cliffy/prompt/mod.ts";
1414
import { basename, dirname, join, relative } from "path/mod.ts";
1515
import { ensureDir, ensureDirSync, existsSync } from "fs/mod.ts";
1616
import { TempContext } from "../../../core/temp-types.ts";
1717
import { downloadWithProgress } from "../../../core/download.ts";
1818
import { withSpinner } from "../../../core/console.ts";
1919
import { unzip } from "../../../core/zip.ts";
2020
import { templateFiles } from "../../../extension/template.ts";
21-
import { kExtensionDir } from "../../../extension/extension-shared.ts";
2221
import { Command } from "cliffy/command/mod.ts";
2322
import { initYamlIntelligenceResourcesFromFilesystem } from "../../../core/schema/utils.ts";
2423
import { createTempContext } from "../../../core/temp.ts";

src/core/handlers/mermaid.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@ mermaid.initialize();
203203
const m = defEl.innerHTML.match(/id="([^\"]+)"/);
204204
if (m) {
205205
const id = m[1];
206-
console.log("Will try to patch", id);
207206
idsToPatch.push(id);
208207
}
209208
}
@@ -328,7 +327,6 @@ mermaid.initialize();
328327

329328
const attrs: Record<string, unknown> = {};
330329
if (isRevealjsOutput(handlerContext.options.context.format.pandoc)) {
331-
console.log("Setting reveal to true");
332330
attrs.reveal = true;
333331
}
334332

src/project/types/book/book-config.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,7 @@ function siteRepoUrl(site: Metadata) {
239239
const branch = site[kSiteRepoBranch] || "main";
240240
if (site[kSiteRepoSubdir]) {
241241
const subdir = ensureTrailingSlash(site[kSiteRepoSubdir] as string);
242-
return pathWithForwardSlashes(
243-
join(repoUrl, `tree/${branch}/${subdir}`),
244-
);
242+
return `${ensureTrailingSlash(repoUrl)}tree/${branch}/${subdir}`;
245243
} else {
246244
return repoUrl;
247245
}

src/publish/common/publish.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ export interface PublishHandler<
6666
createDeploy: (
6767
siteId: string,
6868
files: Record<string, string>,
69+
size: number,
6970
) => Promise<Deploy>;
7071
getDeploy: (deployId: string) => Promise<Deploy>;
7172
uploadDeployFile: (
@@ -132,12 +133,12 @@ export async function handlePublish<
132133
message: `Preparing to publish ${type}`,
133134
}, async () => {
134135
const textDecoder = new TextDecoder();
136+
let size = 0;
135137
for (const file of publishFiles.files) {
136138
const filePath = publishFilePath(file);
137-
const sha1 = await crypto.subtle.digest(
138-
"SHA-1",
139-
Deno.readFileSync(filePath),
140-
);
139+
const fileBuffer = Deno.readFileSync(filePath);
140+
size = size + fileBuffer.byteLength;
141+
const sha1 = await crypto.subtle.digest("SHA-1", fileBuffer);
141142
const encodedSha1 = hexEncode(new Uint8Array(sha1));
142143
files.push([file, textDecoder.decode(encodedSha1)]);
143144
}
@@ -149,7 +150,11 @@ export async function handlePublish<
149150
for (const file of files) {
150151
deploy.files[`/${file[0]}`] = file[1];
151152
}
152-
siteDeploy = await handler.createDeploy(target!.id, deploy.files);
153+
siteDeploy = await handler.createDeploy(
154+
target!.id,
155+
deploy.files,
156+
size,
157+
);
153158

154159
// wait for it to be ready
155160
while (true) {

0 commit comments

Comments
 (0)