Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions news/changelog-1.10.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ All changes included in 1.10:

- ([#14530](https://github.com/quarto-dev/quarto-cli/pull/14530)): Add `quarto.*` Pandoc template variable namespace. `format.language` is now exposed as `$quarto.language.<key>$` in custom Pandoc templates via the defaults-file `variables:` section, with no leakage into rendered output.

### `html`

- ([#14601](https://github.com/quarto-dev/quarto-cli/pull/PR)): Add [BeBlob](https://gitlab.com/antonbelev/beblob) as a `comments` provider for GitLab-backed comments (the GitLab counterpart to `utterances`). Supports self-managed GitLab via `gitlab-url` and a self-hosted client bundle via `client-url`/`dev-mode`.

### `pdf`

- ([#13588](https://github.com/quarto-dev/quarto-cli/issues/13588)): Fix Lua error when rendering PDF with `reference-location: margin` and a footnote alongside a figure with `fig-cap`. (author: @mcanouil)
Expand Down
2 changes: 1 addition & 1 deletion src/core/schema/zod-types-from-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ ${zodObject}
if (Array.isArray(required)) {
baseObj = `${baseObj}.partial().required({${
required.map((key: string) => {
return `${key}: true`;
return `${yamlToTypeScriptKey(key)}: true`;
}).join(", ")
}})`;
} else if (required === undefined) {
Expand Down
1 change: 1 addition & 0 deletions src/format/html/format-html-shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export const kComments = "comments";
export const kHypothesis = "hypothesis";
export const kUtterances = "utterances";
export const kGiscus = "giscus";
export const kBeblob = "beblob";
export const kAxe = "axe";

export const kGiscusRepoId = "repo-id";
Expand Down
34 changes: 34 additions & 0 deletions src/format/html/format-html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ import {
createCodeCopyButton,
kAnchorSections,
kAxe,
kBeblob,
kBootstrapDependencyName,
kCitationsHover,
kCodeAnnotations,
Expand Down Expand Up @@ -296,6 +297,9 @@ export async function htmlFormatExtras(
[kGiscus]:
(format.metadata[kComments] as Record<string, unknown>)[kGiscus] ||
false,
[kBeblob]:
(format.metadata[kComments] as Record<string, unknown>)[kBeblob] ||
false,
}
: {};
options.codeLink = format.metadata[kCodeLink] || false;
Expand Down Expand Up @@ -565,6 +569,36 @@ export async function htmlFormatExtras(
includeAfterBody.push(utterancesAfterBody);
}

// beblob (GitLab-backed comments)
if (options.beblob) {
if (typeof (options.beblob) !== "object") {
throw new Error(
"Invalid beblob configuration (must provide client-id, redirect-uri and project-name)",
);
}
const beblob = options.beblob as Record<string, unknown>;
for (const key of ["client-id", "redirect-uri", "project-name"]) {
if (!beblob[key]) {
throw new Error(`Invalid beblob configuration (must provide ${key})`);
}
}
beblob["issue-mapping-strategy"] = beblob["issue-mapping-strategy"] ||
"pageTitle";
beblob["gitlab-url"] = beblob["gitlab-url"] || "https://gitlab.com";
beblob["theme"] = beblob["theme"] || "light";
beblob["version"] = beblob["version"] || "2.1.0";
beblob["dev-mode"] = beblob["dev-mode"] ?? false;
const beblobAfterBody = temp.createFile({ suffix: "-beblob.html" });
Deno.writeTextFileSync(
beblobAfterBody,
renderEjs(
formatResourcePath("html", join("beblob", "beblob.ejs")),
{ beblob },
),
);
includeAfterBody.push(beblobAfterBody);
}

// giscus
if (options.giscus) {
const giscus = options.giscus as Record<string, unknown>;
Expand Down
139 changes: 117 additions & 22 deletions src/resources/editor/tools/vs-code.mjs

Large diffs are not rendered by default.

Large diffs are not rendered by default.

139 changes: 117 additions & 22 deletions src/resources/editor/tools/yaml/web-worker.js

Large diffs are not rendered by default.

139 changes: 117 additions & 22 deletions src/resources/editor/tools/yaml/yaml-intelligence-resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -1791,6 +1791,85 @@
"giscus": {
"ref": "giscus-configuration"
},
"beblob": {
"object": {
"closed": true,
"properties": {
"client-id": {
"string": {
"description": "The GitLab OAuth Application ID used to authenticate commenters."
}
},
"redirect-uri": {
"string": {
"description": "The redirect URI registered for the GitLab OAuth Application\n(must match the value configured in GitLab, typically your site URL).\n"
}
},
"project-name": {
"string": {
"description": "The name of the GitLab project used to store comments as issues\n(e.g. `my-project`). This is the project's name as shown in GitLab —\nBeBlob looks the project up by searching GitLab for this name — not\nthe full `namespace/path`.\n"
}
},
"issue-mapping-strategy": {
"string": {
"description": {
"short": "How pages are mapped to GitLab issues.",
"long": "How pages are mapped to GitLab issues\n(`url`, `pageTitle`, or `issueId`).\n"
},
"completions": [
"url",
"pageTitle",
"issueId"
]
}
},
"issue-id": {
"string": {
"description": "The GitLab issue id to use. Required only when `issue-mapping-strategy` is `issueId`."
}
},
"gitlab-url": {
"string": {
"description": "The base URL of the GitLab instance (use this for self-managed GitLab). Defaults to `https://gitlab.com`."
}
},
"theme": {
"string": {
"description": {
"short": "The theme that should be used for BeBlob.",
"long": "The theme that should be used for BeBlob\n(`dark`, `white`, `light`, or `classic`).\n"
},
"completions": [
"dark",
"white",
"light",
"classic"
]
}
},
"dev-mode": {
"boolean": {
"description": "Load the BeBlob assets locally from your own server instead of from the CDN."
}
},
"version": {
"string": {
"description": "The BeBlob version to load from the CDN."
}
},
"client-url": {
"string": {
"description": "Override the default BeBlob client url with a custom client url (e.g. a self-hosted bundle)."
}
}
},
"required": [
"client-id",
"redirect-uri",
"project-name"
]
}
},
"hypothesis": {
"anyOf": [
"boolean",
Expand Down Expand Up @@ -14702,6 +14781,22 @@
"short": "How posts should be mapped to Github issues",
"long": "How posts should be mapped to Github issues (<code>pathname</code>,\n<code>url</code>, <code>title</code> or <code>og:title</code>)"
},
"The GitLab OAuth Application ID used to authenticate commenters.",
"The redirect URI registered for the GitLab OAuth Application (must\nmatch the value configured in GitLab, typically your site URL).",
"The GitLab project (e.g.&nbsp;<code>group/project</code>) that will be\nused to store comments as issues.",
{
"short": "How pages are mapped to GitLab issues.",
"long": "How pages are mapped to GitLab issues (<code>url</code>,\n<code>pageTitle</code>, or <code>issueId</code>)."
},
"The GitLab issue id to use. Required only when\n<code>issue-mapping-strategy</code> is <code>issueId</code>.",
"The base URL of the GitLab instance (use this for self-managed\nGitLab). Defaults to <code>https://gitlab.com</code>.",
{
"short": "The theme that should be used for BeBlob.",
"long": "The theme that should be used for BeBlob (<code>dark</code>,\n<code>white</code>, <code>light</code>, or <code>classic</code>)."
},
"Load the BeBlob assets locally from your own server instead of from\nthe CDN.",
"The BeBlob version to load from the CDN.",
"Override the default BeBlob client url with a custom client url\n(e.g.&nbsp;a self-hosted bundle).",
"Override the default hypothesis client url with a custom client\nurl.",
"Controls whether the sidebar opens automatically on startup.",
"Controls whether the in-document highlights are shown by default\n(<code>always</code>, <code>whenSidebarOpen</code> or\n<code>never</code>)",
Expand Down Expand Up @@ -14810,9 +14905,9 @@
"short": "Name that should be displayed for the overall site",
"long": "Name that should be displayed for the overall site. If not explicitly\nprovided in the <code>open-graph</code> metadata, Quarto will use the\nwebsite or book <code>title</code> by default."
},
"Footer left content",
"Footer right content",
"Footer center content",
"Footer left content. Supports markdown formatting.",
"Footer right content. Supports markdown formatting.",
"Footer center content. Supports markdown formatting.",
"Footer border (<code>true</code>, <code>false</code>, or a border\ncolor)",
"Footer background color",
"Footer foreground color",
Expand Down Expand Up @@ -14857,7 +14952,7 @@
},
"Path to a file containing the Plausible Analytics script snippet",
"Provides an announcement displayed at the top of the page.",
"The content of the announcement",
"The content of the announcement. Supports markdown formatting.",
"Whether this announcement may be dismissed by the user.",
{
"short": "The icon to display in the announcement",
Expand Down Expand Up @@ -14915,7 +15010,7 @@
"Field that contains the section of index entries",
"Additional parameters to pass when executing a search",
"Top navigation options",
"The navbar title. Uses the project title if none is specified.",
"The navbar title. Uses the project title if none is specified.\nSupports markdown formatting.",
"Specification of image that will be displayed to the left of the\ntitle.",
"Alternate text for the logo image.",
"Target href from navbar logo / title. By default, the logo and title\nlink to the root page of the site (/index.html).",
Expand All @@ -14931,7 +15026,7 @@
"Collapse tools into the navbar menu when the display becomes\nnarrow.",
"Side navigation options",
"The identifier for this sidebar.",
"The sidebar title. Uses the project title if none is specified.",
"The sidebar title. Uses the project title if none is specified.\nSupports markdown formatting.",
"Specification of image that will be displayed in the sidebar.",
"Alternate text for the logo image.",
"Target href from navbar logo / title. By default, the logo and title\nlink to the root page of the site (/index.html).",
Expand All @@ -14948,7 +15043,7 @@
"Markdown to place above sidebar content (text or file path)",
"Markdown to place below sidebar content (text or file path)",
"The identifier for this sidebar.",
"The sidebar title. Uses the project title if none is specified.",
"The sidebar title. Uses the project title if none is specified.\nSupports markdown formatting.",
"Specification of image that will be displayed in the sidebar.",
"Alternate text for the logo image.",
"Target href from navbar logo / title. By default, the logo and title\nlink to the root page of the site (/index.html).",
Expand Down Expand Up @@ -15024,7 +15119,7 @@
},
"Path to a file containing the Plausible Analytics script snippet",
"Provides an announcement displayed at the top of the page.",
"The content of the announcement",
"The content of the announcement. Supports markdown formatting.",
"Whether this announcement may be dismissed by the user.",
{
"short": "The icon to display in the announcement",
Expand Down Expand Up @@ -15082,7 +15177,7 @@
"Field that contains the section of index entries",
"Additional parameters to pass when executing a search",
"Top navigation options",
"The navbar title. Uses the project title if none is specified.",
"The navbar title. Uses the project title if none is specified.\nSupports markdown formatting.",
"Specification of image that will be displayed to the left of the\ntitle.",
"Alternate text for the logo image.",
"Target href from navbar logo / title. By default, the logo and title\nlink to the root page of the site (/index.html).",
Expand All @@ -15098,7 +15193,7 @@
"Collapse tools into the navbar menu when the display becomes\nnarrow.",
"Side navigation options",
"The identifier for this sidebar.",
"The sidebar title. Uses the project title if none is specified.",
"The sidebar title. Uses the project title if none is specified.\nSupports markdown formatting.",
"Specification of image that will be displayed in the sidebar.",
"Alternate text for the logo image.",
"Target href from navbar logo / title. By default, the logo and title\nlink to the root page of the site (/index.html).",
Expand All @@ -15115,7 +15210,7 @@
"Markdown to place above sidebar content (text or file path)",
"Markdown to place below sidebar content (text or file path)",
"The identifier for this sidebar.",
"The sidebar title. Uses the project title if none is specified.",
"The sidebar title. Uses the project title if none is specified.\nSupports markdown formatting.",
"Specification of image that will be displayed in the sidebar.",
"Alternate text for the logo image.",
"Target href from navbar logo / title. By default, the logo and title\nlink to the root page of the site (/index.html).",
Expand Down Expand Up @@ -17451,7 +17546,7 @@
},
"Path to a file containing the Plausible Analytics script snippet",
"Provides an announcement displayed at the top of the page.",
"The content of the announcement",
"The content of the announcement. Supports markdown formatting.",
"Whether this announcement may be dismissed by the user.",
{
"short": "The icon to display in the announcement",
Expand Down Expand Up @@ -17509,7 +17604,7 @@
"Field that contains the section of index entries",
"Additional parameters to pass when executing a search",
"Top navigation options",
"The navbar title. Uses the project title if none is specified.",
"The navbar title. Uses the project title if none is specified.\nSupports markdown formatting.",
"Specification of image that will be displayed to the left of the\ntitle.",
"Alternate text for the logo image.",
"Target href from navbar logo / title. By default, the logo and title\nlink to the root page of the site (/index.html).",
Expand All @@ -17525,7 +17620,7 @@
"Collapse tools into the navbar menu when the display becomes\nnarrow.",
"Side navigation options",
"The identifier for this sidebar.",
"The sidebar title. Uses the project title if none is specified.",
"The sidebar title. Uses the project title if none is specified.\nSupports markdown formatting.",
"Specification of image that will be displayed in the sidebar.",
"Alternate text for the logo image.",
"Target href from navbar logo / title. By default, the logo and title\nlink to the root page of the site (/index.html).",
Expand All @@ -17542,7 +17637,7 @@
"Markdown to place above sidebar content (text or file path)",
"Markdown to place below sidebar content (text or file path)",
"The identifier for this sidebar.",
"The sidebar title. Uses the project title if none is specified.",
"The sidebar title. Uses the project title if none is specified.\nSupports markdown formatting.",
"Specification of image that will be displayed in the sidebar.",
"Alternate text for the logo image.",
"Target href from navbar logo / title. By default, the logo and title\nlink to the root page of the site (/index.html).",
Expand Down Expand Up @@ -17822,7 +17917,7 @@
},
"Path to a file containing the Plausible Analytics script snippet",
"Provides an announcement displayed at the top of the page.",
"The content of the announcement",
"The content of the announcement. Supports markdown formatting.",
"Whether this announcement may be dismissed by the user.",
{
"short": "The icon to display in the announcement",
Expand Down Expand Up @@ -17880,7 +17975,7 @@
"Field that contains the section of index entries",
"Additional parameters to pass when executing a search",
"Top navigation options",
"The navbar title. Uses the project title if none is specified.",
"The navbar title. Uses the project title if none is specified.\nSupports markdown formatting.",
"Specification of image that will be displayed to the left of the\ntitle.",
"Alternate text for the logo image.",
"Target href from navbar logo / title. By default, the logo and title\nlink to the root page of the site (/index.html).",
Expand All @@ -17896,7 +17991,7 @@
"Collapse tools into the navbar menu when the display becomes\nnarrow.",
"Side navigation options",
"The identifier for this sidebar.",
"The sidebar title. Uses the project title if none is specified.",
"The sidebar title. Uses the project title if none is specified.\nSupports markdown formatting.",
"Specification of image that will be displayed in the sidebar.",
"Alternate text for the logo image.",
"Target href from navbar logo / title. By default, the logo and title\nlink to the root page of the site (/index.html).",
Expand All @@ -17913,7 +18008,7 @@
"Markdown to place above sidebar content (text or file path)",
"Markdown to place below sidebar content (text or file path)",
"The identifier for this sidebar.",
"The sidebar title. Uses the project title if none is specified.",
"The sidebar title. Uses the project title if none is specified.\nSupports markdown formatting.",
"Specification of image that will be displayed in the sidebar.",
"Alternate text for the logo image.",
"Target href from navbar logo / title. By default, the logo and title\nlink to the root page of the site (/index.html).",
Expand Down Expand Up @@ -18346,12 +18441,12 @@
"mermaid": "%%"
},
"handlers/mermaid/schema.yml": {
"_internalId": 222617,
"_internalId": 222663,
"type": "object",
"description": "be an object",
"properties": {
"mermaid-format": {
"_internalId": 222609,
"_internalId": 222655,
"type": "enum",
"enum": [
"png",
Expand All @@ -18367,7 +18462,7 @@
"exhaustiveCompletions": true
},
"theme": {
"_internalId": 222616,
"_internalId": 222662,
"type": "anyOf",
"anyOf": [
{
Expand Down
15 changes: 15 additions & 0 deletions src/resources/formats/html/beblob/beblob.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<% let srcHref = beblob['client-url'] || ("https://unpkg.com/beblob@" + beblob.version + "/dist/beblob.js"); %>
<div id="beblob_thread"></div>
<script
id="beblob-script"
src="<%- srcHref %>"
data-client-id="<%- beblob['client-id'] %>"
data-redirect-uri="<%- beblob['redirect-uri'] %>"
data-project-name="<%- beblob['project-name'] %>"
data-issue-mapping-strategy="<%- beblob['issue-mapping-strategy'] %>"
<% if (beblob['issue-mapping-strategy'] === 'issueId' && beblob['issue-id']) { %>data-issue-id="<%- beblob['issue-id'] %>"
<% } %>data-gitlab-url="<%- beblob['gitlab-url'] %>"
data-dev-mode="<%- beblob['dev-mode'] ? 'true' : 'false' %>"
data-beblob-version="<%- beblob.version %>"
data-theme="<%- beblob.theme %>"
></script>
Loading
Loading