Skip to content

Commit e5ca74f

Browse files
committed
use npm in building webui-preview
1 parent dc3a99c commit e5ca74f

File tree

8 files changed

+3020
-290
lines changed

8 files changed

+3020
-290
lines changed

package/src/common/configure.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
kDependencies,
2020
} from "./dependencies/dependencies.ts";
2121
import { suggestUserBinPaths } from "../../../src/core/path.ts";
22-
import { buildQuartoPreviewJs } from "../../../src/core/previewjs.ts";
22+
import { buildQuartoPreviewJs } from "./previewjs.ts";
2323
import { isWindows } from "../../../src/deno_ral/platform.ts";
2424

2525
export async function configure(

package/src/common/prepare-dist.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Dependency,
2121
} from "./dependencies/dependencies.ts";
2222
import { copyQuartoScript } from "./configure.ts";
2323
import { deno } from "./dependencies/deno.ts";
24-
import { buildQuartoPreviewJs } from "../../../src/core/previewjs.ts";
24+
import { buildQuartoPreviewJs } from "./previewjs.ts";
2525

2626
export async function prepareDist(
2727
config: Configuration,

package/src/common/previewjs.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* previewjs.ts
3+
*
4+
* Copyright (C) 2020-2023 Posit Software, PBC
5+
*/
6+
7+
import { join } from "../../../src/deno_ral/path.ts";
8+
9+
export function buildQuartoPreviewJs(
10+
srcDir: string,
11+
denoDir?: string,
12+
force?: boolean,
13+
) {
14+
const args = ["run", "-A", "build.ts"];
15+
if (force) {
16+
args.push("--force");
17+
}
18+
const buildCmd = new Deno.Command(Deno.execPath(), {
19+
args: args,
20+
cwd: quartoPreviewJsDir(srcDir),
21+
env: denoDir ? { DENO_DIR: denoDir } : undefined,
22+
stderr: "inherit",
23+
stdout: "inherit",
24+
});
25+
return buildCmd.outputSync();
26+
}
27+
28+
export function quartoPreviewJsDir(srcDir: string) {
29+
return join(srcDir, "webui", "quarto-preview");
30+
}

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

Lines changed: 76 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -17146,7 +17146,19 @@ var require_yaml_intelligence_resources = __commonJS({
1714617146
"beamer"
1714717147
]
1714817148
},
17149-
description: "The Beamer color theme for this presentation."
17149+
description: "The Beamer color theme for this presentation, passed to `\\usecolortheme`."
17150+
},
17151+
{
17152+
name: "colorthemeoptions",
17153+
schema: {
17154+
maybeArrayOf: "string"
17155+
},
17156+
tags: {
17157+
formats: [
17158+
"beamer"
17159+
]
17160+
},
17161+
description: "The Beamer color theme options for this presentation, passed to `\\usecolortheme`."
1715017162
},
1715117163
{
1715217164
name: "fonttheme",
@@ -17156,7 +17168,19 @@ var require_yaml_intelligence_resources = __commonJS({
1715617168
"beamer"
1715717169
]
1715817170
},
17159-
description: "The Beamer font theme for this presentation."
17171+
description: "The Beamer font theme for this presentation, passed to `\\usefonttheme`."
17172+
},
17173+
{
17174+
name: "fontthemeoptions",
17175+
schema: {
17176+
maybeArrayOf: "string"
17177+
},
17178+
tags: {
17179+
formats: [
17180+
"beamer"
17181+
]
17182+
},
17183+
description: "The Beamer font theme options for this presentation, passed to `\\usefonttheme`."
1716017184
},
1716117185
{
1716217186
name: "innertheme",
@@ -17166,7 +17190,19 @@ var require_yaml_intelligence_resources = __commonJS({
1716617190
"beamer"
1716717191
]
1716817192
},
17169-
description: "The Beamer inner theme for this presentation."
17193+
description: "The Beamer inner theme for this presentation, passed to `\\useinnertheme`."
17194+
},
17195+
{
17196+
name: "innerthemeoptions",
17197+
schema: {
17198+
maybeArrayOf: "string"
17199+
},
17200+
tags: {
17201+
formats: [
17202+
"beamer"
17203+
]
17204+
},
17205+
description: "The Beamer inner theme options for this presentation, passed to `\\useinnertheme`."
1717017206
},
1717117207
{
1717217208
name: "outertheme",
@@ -17176,7 +17212,19 @@ var require_yaml_intelligence_resources = __commonJS({
1717617212
"beamer"
1717717213
]
1717817214
},
17179-
description: "The Beamer outer theme for this presentation."
17215+
description: "The Beamer outer theme for this presentation, passed to `\\useoutertheme`."
17216+
},
17217+
{
17218+
name: "outerthemeoptions",
17219+
schema: {
17220+
maybeArrayOf: "string"
17221+
},
17222+
tags: {
17223+
formats: [
17224+
"beamer"
17225+
]
17226+
},
17227+
description: "The Beamer outer theme options for this presentation, passed to `\\useoutertheme`."
1718017228
},
1718117229
{
1718217230
name: "themeoptions",
@@ -17188,7 +17236,7 @@ var require_yaml_intelligence_resources = __commonJS({
1718817236
"beamer"
1718917237
]
1719017238
},
17191-
description: "Options passed to LaTeX Beamer themes."
17239+
description: "Options passed to LaTeX Beamer themes inside `\\usetheme`."
1719217240
},
1719317241
{
1719417242
name: "section",
@@ -20745,16 +20793,6 @@ var require_yaml_intelligence_resources = __commonJS({
2074520793
"Alias for href",
2074620794
'Value for rel attribute. Multiple space-separated values are\npermitted. See <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel" class="uri">https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel</a>\nfor a details.',
2074720795
'Value for target attribute. See <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-target" class="uri">https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-target</a>\nfor details.',
20748-
"The Github repo that will be used to store comments.",
20749-
"The label that will be assigned to issues created by Utterances.",
20750-
{
20751-
short: "The Github theme that should be used for Utterances.",
20752-
long: "The Github theme that should be used for Utterances\n(<code>github-light</code>, <code>github-dark</code>,\n<code>github-dark-orange</code>, <code>icy-dark</code>,\n<code>dark-blue</code>, <code>photon-dark</code>,\n<code>body-light</code>, or <code>gruvbox-dark</code>)"
20753-
},
20754-
{
20755-
short: "How posts should be mapped to Github issues",
20756-
long: "How posts should be mapped to Github issues (<code>pathname</code>,\n<code>url</code>, <code>title</code> or <code>og:title</code>)"
20757-
},
2075820796
{
2075920797
short: "The Github repo that will be used to store comments.",
2076020798
long: "The Github repo that will be used to store comments.\nIn order to work correctly, the repo must be public, with the giscus\napp installed, and the discussions feature must be enabled."
@@ -20785,6 +20823,16 @@ var require_yaml_intelligence_resources = __commonJS({
2078520823
"The light theme name.",
2078620824
"The dark theme name.",
2078720825
"The language that should be used when displaying the commenting\ninterface.",
20826+
"The Github repo that will be used to store comments.",
20827+
"The label that will be assigned to issues created by Utterances.",
20828+
{
20829+
short: "The Github theme that should be used for Utterances.",
20830+
long: "The Github theme that should be used for Utterances\n(<code>github-light</code>, <code>github-dark</code>,\n<code>github-dark-orange</code>, <code>icy-dark</code>,\n<code>dark-blue</code>, <code>photon-dark</code>,\n<code>body-light</code>, or <code>gruvbox-dark</code>)"
20831+
},
20832+
{
20833+
short: "How posts should be mapped to Github issues",
20834+
long: "How posts should be mapped to Github issues (<code>pathname</code>,\n<code>url</code>, <code>title</code> or <code>og:title</code>)"
20835+
},
2078820836
"Override the default hypothesis client url with a custom client\nurl.",
2078920837
"Controls whether the sidebar opens automatically on startup.",
2079020838
"Controls whether the in-document highlights are shown by default\n(<code>always</code>, <code>whenSidebarOpen</code> or\n<code>never</code>)",
@@ -23012,11 +23060,15 @@ var require_yaml_intelligence_resources = __commonJS({
2301223060
"The image for the title slide.",
2301323061
"Controls navigation symbols for the presentation (<code>empty</code>,\n<code>frame</code>, <code>vertical</code>, or\n<code>horizontal</code>)",
2301423062
"Whether to enable title pages for new sections.",
23015-
"The Beamer color theme for this presentation.",
23016-
"The Beamer font theme for this presentation.",
23017-
"The Beamer inner theme for this presentation.",
23018-
"The Beamer outer theme for this presentation.",
23019-
"Options passed to LaTeX Beamer themes.",
23063+
"The Beamer color theme for this presentation, passed to\n<code>\\usecolortheme</code>.",
23064+
"The Beamer color theme options for this presentation, passed to\n<code>\\usecolortheme</code>.",
23065+
"The Beamer font theme for this presentation, passed to\n<code>\\usefonttheme</code>.",
23066+
"The Beamer font theme options for this presentation, passed to\n<code>\\usefonttheme</code>.",
23067+
"The Beamer inner theme for this presentation, passed to\n<code>\\useinnertheme</code>.",
23068+
"The Beamer inner theme options for this presentation, passed to\n<code>\\useinnertheme</code>.",
23069+
"The Beamer outer theme for this presentation, passed to\n<code>\\useoutertheme</code>.",
23070+
"The Beamer outer theme options for this presentation, passed to\n<code>\\useoutertheme</code>.",
23071+
"Options passed to LaTeX Beamer themes inside\n<code>\\usetheme</code>.",
2302023072
"The section number in man pages.",
2302123073
"Enable and disable extensions for markdown output (e.g.&nbsp;\u201C+emoji\u201D)",
2302223074
"Specify whether to use <code>atx</code> (<code>#</code>-prefixed) or\n<code>setext</code> (underlined) headings for level 1 and 2 headings\n(<code>atx</code> or <code>setext</code>).",
@@ -24064,76 +24116,7 @@ var require_yaml_intelligence_resources = __commonJS({
2406424116
"Disambiguating year suffix in author-date styles (e.g.&nbsp;\u201Ca\u201D in \u201CDoe,\n1999a\u201D).",
2406524117
"Manuscript configuration",
2406624118
"internal-schema-hack",
24067-
"List execution engines you want to give priority when determining\nwhich engine should render a notebook. If two engines have support for a\nnotebook, the one listed earlier will be chosen. Quarto\u2019s default order\nis \u2018knitr\u2019, \u2018jupyter\u2019, \u2018markdown\u2019, \u2018julia\u2019.",
24068-
{
24069-
short: "The Github repo that will be used to store comments.",
24070-
long: "The Github repo that will be used to store comments.\nIn order to work correctly, the repo must be public, with the giscus\napp installed, and the discussions feature must be enabled."
24071-
},
24072-
{
24073-
short: "The Github repository identifier.",
24074-
long: 'The Github repository identifier.\nYou can quickly find this by using the configuration tool at <a href="https://giscus.app">https://giscus.app</a>. If this is not\nprovided, Quarto will attempt to discover it at render time.'
24075-
},
24076-
{
24077-
short: "The discussion category where new discussions will be created.",
24078-
long: "The discussion category where new discussions will be created. It is\nrecommended to use a category with the <strong>Announcements</strong>\ntype so that new discussions can only be created by maintainers and\ngiscus."
24079-
},
24080-
{
24081-
short: "The Github category identifier.",
24082-
long: 'The Github category identifier.\nYou can quickly find this by using the configuration tool at <a href="https://giscus.app">https://giscus.app</a>. If this is not\nprovided, Quarto will attempt to discover it at render time.'
24083-
},
24084-
{
24085-
short: "The mapping between the page and the embedded discussion.",
24086-
long: "The mapping between the page and the embedded discussion."
24087-
},
24088-
"Display reactions for the discussion\u2019s main post before the\ncomments.",
24089-
"Specify <code>loading: lazy</code> to defer loading comments until\nthe user scrolls near the comments container.",
24090-
"Place the comment input box above or below the comments.",
24091-
{
24092-
short: "The giscus theme to use when displaying comments.",
24093-
long: "The giscus theme to use when displaying comments. Light and dark\nthemes are supported. If a single theme is provided by name, it will be\nused as light and dark theme. To use different themes, use\n<code>light</code> and <code>dark</code> key:"
24094-
},
24095-
"The light theme name.",
24096-
"The dark theme name.",
24097-
"The language that should be used when displaying the commenting\ninterface.",
24098-
"The Github repo that will be used to store comments.",
24099-
"The label that will be assigned to issues created by Utterances.",
24100-
{
24101-
short: "The Github theme that should be used for Utterances.",
24102-
long: "The Github theme that should be used for Utterances\n(<code>github-light</code>, <code>github-dark</code>,\n<code>github-dark-orange</code>, <code>icy-dark</code>,\n<code>dark-blue</code>, <code>photon-dark</code>,\n<code>body-light</code>, or <code>gruvbox-dark</code>)"
24103-
},
24104-
{
24105-
short: "How posts should be mapped to Github issues",
24106-
long: "How posts should be mapped to Github issues (<code>pathname</code>,\n<code>url</code>, <code>title</code> or <code>og:title</code>)"
24107-
},
24108-
"Override the default hypothesis client url with a custom client\nurl.",
24109-
"Controls whether the sidebar opens automatically on startup.",
24110-
"Controls whether the in-document highlights are shown by default\n(<code>always</code>, <code>whenSidebarOpen</code> or\n<code>never</code>)",
24111-
"Controls the overall look of the sidebar (<code>classic</code> or\n<code>clean</code>)",
24112-
"Controls whether the experimental New Note button should be shown in\nthe notes tab in the sidebar.",
24113-
"Specify a URL to direct a user to, in a new tab. when they click on\nthe annotation author link in the header of an annotation.",
24114-
"Alternative annotation services which the client should connect to\ninstead of connecting to the public Hypothesis service at\nhypothes.is.",
24115-
"The base URL of the service API.",
24116-
"The domain name which the annotation service is associated with.",
24117-
"An OAuth 2 grant token which the client can send to the service in\norder to get an access token for making authenticated requests to the\nservice.",
24118-
"A flag indicating whether users should be able to leave groups of\nwhich they are a member.",
24119-
"A flag indicating whether annotation cards should show links that\ntake the user to see an annotation in context.",
24120-
"An array of Group IDs or the literal string\n<code>$rpc:requestGroups</code>",
24121-
"The URL to an image for the annotation service. This image will\nappear to the left of the name of the currently selected group.",
24122-
"Settings to adjust the commenting sidebar\u2019s look and feel.",
24123-
"Secondary color for elements of the commenting UI.",
24124-
"The main background color of the commenting UI.",
24125-
"The background color for call to action buttons.",
24126-
"The font family for selection text in the annotation card.",
24127-
"The font family for the actual annotation value that the user writes\nabout the page or selection.",
24128-
"A CSS selector specifying the containing element into which the\nsidebar iframe will be placed.",
24129-
"Defines a focused filter set for the available annotations on a\npage.",
24130-
"The username of the user to focus on.",
24131-
"The userid of the user to focus on.",
24132-
"The display name of the user to focus on.",
24133-
"Host url and port number of receiving iframe",
24134-
"Number of nested iframes deep the client is relative from the\nreceiving iframe.",
24135-
"The root URL from which assets are loaded.",
24136-
"The URL for the sidebar application which displays annotations."
24119+
"List execution engines you want to give priority when determining\nwhich engine should render a notebook. If two engines have support for a\nnotebook, the one listed earlier will be chosen. Quarto\u2019s default order\nis \u2018knitr\u2019, \u2018jupyter\u2019, \u2018markdown\u2019, \u2018julia\u2019."
2413724120
],
2413824121
"schema/external-schemas.yml": [
2413924122
{
@@ -24362,12 +24345,12 @@ var require_yaml_intelligence_resources = __commonJS({
2436224345
mermaid: "%%"
2436324346
},
2436424347
"handlers/mermaid/schema.yml": {
24365-
_internalId: 193837,
24348+
_internalId: 190556,
2436624349
type: "object",
2436724350
description: "be an object",
2436824351
properties: {
2436924352
"mermaid-format": {
24370-
_internalId: 193829,
24353+
_internalId: 190548,
2437124354
type: "enum",
2437224355
enum: [
2437324356
"png",
@@ -24383,7 +24366,7 @@ var require_yaml_intelligence_resources = __commonJS({
2438324366
exhaustiveCompletions: true
2438424367
},
2438524368
theme: {
24386-
_internalId: 193836,
24369+
_internalId: 190555,
2438724370
type: "anyOf",
2438824371
anyOf: [
2438924372
{

0 commit comments

Comments
 (0)