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
1 change: 1 addition & 0 deletions news/changelog-1.12.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ All changes included in 1.12:
### `revealjs`

- ([#7378](https://github.com/quarto-dev/quarto-cli/issues/7378)): Add `code-line-fragment-indices` to set the fragment index of each step of stepped `code-line-numbers` highlighting. (author: @mcanouil)
- ([#15332](https://github.com/quarto-dev/quarto-cli/pull/15332)): Add `tabset-fragments` option for `revealjs` presentations to step through the tabs of a tabset as fragments, so that a PDF print shows every tab. Use the `.tabset-fragments` and `.no-tabset-fragments` classes to turn it on or off for one tabset. (author: @mcanouil)

### `typst`

Expand Down
1 change: 1 addition & 0 deletions src/format/reveal/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const kRevealJsConfig = "revealjs-config";
export const kSlideLogo = "logo";
export const kSlideFooter = "footer";
export const kHashType = "hash-type";
export const kTabsetFragments = "tabset-fragments";
export const kScrollable = "scrollable";
export const kSmaller = "smaller";
export const kCenter = "center";
Expand Down
31 changes: 31 additions & 0 deletions src/format/reveal/format-reveal-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { formatResourcePath } from "../../core/resources.ts";
import { TempContext } from "../../core/temp.ts";
import { optionsToKebab, revealMetadataFilter } from "./metadata.ts";
import { revealMultiplexPlugin } from "./format-reveal-multiplex.ts";
import { kTabsetFragments } from "./constants.ts";
import { isSelfContained } from "../../command/render/render-info.ts";

import { readAndValidateYamlFromFile } from "../../core/schema/validated-yaml.ts";
Expand Down Expand Up @@ -98,8 +99,32 @@ export function isPluginBundle(
return (plugin as RevealPluginBundle).plugin !== undefined;
}

const kTabsetFragmentsClass = /(^|[\s{])\.tabset-fragments(?=[\s}])/m;

export function hasTabsetFragmentsClass(markdown: string): boolean {
return kTabsetFragmentsClass.test(markdown);
}

export function revealTabsetFragmentsPlugin(
format: Format,
markdown: string,
): RevealPluginBundle | undefined {
const deckOn = format.metadata[kTabsetFragments] === true;
if (deckOn || hasTabsetFragmentsClass(markdown)) {
return {
plugin: formatResourcePath(
"revealjs",
join("plugins", "tabset-fragments"),
),
config: { tabsetFragments: deckOn },
};
}
return undefined;
}

export async function revealPluginExtras(
input: string,
markdown: string,
format: Format,
flags: PandocFlags,
temp: TempContext,
Expand Down Expand Up @@ -153,6 +178,12 @@ export async function revealPluginExtras(
pluginBundles.push(multiplexPlugin);
}

// tabset fragments plugin (optional)
const tabsetFragmentsPlugin = revealTabsetFragmentsPlugin(format, markdown);
if (tabsetFragmentsPlugin) {
pluginBundles.push(tabsetFragmentsPlugin);
}

const resolvePluginPath = async (plugin: string) => {
// Look for an extension
let extensions = await extensionContext?.find(
Expand Down
3 changes: 2 additions & 1 deletion src/format/reveal/format-reveal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export function revealjsFormat() {
formatPreviewFile: revealMuliplexPreviewFile,
formatExtras: async (
input: string,
_markdown: string,
markdown: string,
flags: PandocFlags,
format: Format,
libDir: string,
Expand Down Expand Up @@ -224,6 +224,7 @@ export function revealjsFormat() {

const revealPluginData = await revealPluginExtras(
input,
markdown,
format,
flags,
services.temp,
Expand Down
18 changes: 15 additions & 3 deletions src/resources/editor/tools/vs-code.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19102,6 +19102,17 @@ var init_yaml_intelligence_resources = __esm({
long: "Footer to include on all slides. Can also be set per-slide by including a\ndiv with class `.footer` on the slide.\n"
}
},
{
name: "tabset-fragments",
tags: {
formats: [
"revealjs"
]
},
schema: "boolean",
default: false,
description: "Step through the tabs of each tabset as fragments.\nUse the `.tabset-fragments` or `.no-tabset-fragments` class on a tabset to turn it on or off for that tabset.\nA tabset inside a tabset that does not step does not step either.\n"
},
{
name: "scrollable",
tags: {
Expand Down Expand Up @@ -24720,6 +24731,7 @@ var init_yaml_intelligence_resources = __esm({
short: "Footer to include on all slides",
long: "Footer to include on all slides. Can also be set per-slide by\nincluding a div with class <code>.footer</code> on the slide."
},
"Step through the tabs of each tabset as fragments. Use the\n<code>.tabset-fragments</code> or <code>.no-tabset-fragments</code>\nclass on a tabset to turn it on or off for that tabset. A tabset inside\na tabset that does not step does not step either.",
{
short: "Allow content that overflows slides vertically to scroll",
long: "<code>true</code> to allow content that overflows slides vertically\nto scroll. This can also be set per-slide by including the\n<code>.scrollable</code> class on the slide title."
Expand Down Expand Up @@ -25909,12 +25921,12 @@ var init_yaml_intelligence_resources = __esm({
mermaid: "%%"
},
"handlers/mermaid/schema.yml": {
_internalId: 222313,
_internalId: 222475,
type: "object",
description: "be an object",
properties: {
"mermaid-format": {
_internalId: 222305,
_internalId: 222467,
type: "enum",
enum: [
"png",
Expand All @@ -25930,7 +25942,7 @@ var init_yaml_intelligence_resources = __esm({
exhaustiveCompletions: true
},
theme: {
_internalId: 222312,
_internalId: 222474,
type: "anyOf",
anyOf: [
{
Expand Down

Large diffs are not rendered by default.

18 changes: 15 additions & 3 deletions src/resources/editor/tools/yaml/web-worker.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 15 additions & 3 deletions src/resources/editor/tools/yaml/yaml-intelligence-resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -12075,6 +12075,17 @@
"long": "Footer to include on all slides. Can also be set per-slide by including a\ndiv with class `.footer` on the slide.\n"
}
},
{
"name": "tabset-fragments",
"tags": {
"formats": [
"revealjs"
]
},
"schema": "boolean",
"default": false,
"description": "Step through the tabs of each tabset as fragments.\nUse the `.tabset-fragments` or `.no-tabset-fragments` class on a tabset to turn it on or off for that tabset.\nA tabset inside a tabset that does not step does not step either.\n"
},
{
"name": "scrollable",
"tags": {
Expand Down Expand Up @@ -17693,6 +17704,7 @@
"short": "Footer to include on all slides",
"long": "Footer to include on all slides. Can also be set per-slide by\nincluding a div with class <code>.footer</code> on the slide."
},
"Step through the tabs of each tabset as fragments. Use the\n<code>.tabset-fragments</code> or <code>.no-tabset-fragments</code>\nclass on a tabset to turn it on or off for that tabset. A tabset inside\na tabset that does not step does not step either.",
{
"short": "Allow content that overflows slides vertically to scroll",
"long": "<code>true</code> to allow content that overflows slides vertically\nto scroll. This can also be set per-slide by including the\n<code>.scrollable</code> class on the slide title."
Expand Down Expand Up @@ -18882,12 +18894,12 @@
"mermaid": "%%"
},
"handlers/mermaid/schema.yml": {
"_internalId": 222313,
"_internalId": 222475,
"type": "object",
"description": "be an object",
"properties": {
"mermaid-format": {
"_internalId": 222305,
"_internalId": 222467,
"type": "enum",
"enum": [
"png",
Expand All @@ -18903,7 +18915,7 @@
"exhaustiveCompletions": true
},
"theme": {
"_internalId": 222312,
"_internalId": 222474,
"type": "anyOf",
"anyOf": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name: QuartoTabsetFragments
script: tabset-fragments.js
Loading
Loading