You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7039273
Browse filesBrowse the repository at this point in the historyBrowse files
feat: add code-line-fragment-indices for Reveal.js line highlights (#15293)
Stepped line highlights in Reveal.js take the next free fragment index,
so a highlight cannot sit between other fragments such as notes on the
slide. The new code-line-fragment-indices attribute and cell option set
the index of each highlight step after the first. The first step is the
code block itself and still shows when the slide opens.
- Accept a comma-separated string, a single number, or a YAML list.
- Require non-negative integers in strictly increasing order. Otherwise
warn at render time and keep the default order.
- Keep the attribute only for Reveal.js with stepped code-line-numbers,
and pass it through knitr, Jupyter and OJS cells.
Fixes#7378Fixes#11585
Copy file name to clipboardExpand all lines: news/changelog-1.12.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,10 @@ All changes included in 1.12:
22
22
23
23
- ([#15251](https://github.com/quarto-dev/quarto-cli/pull/15251)): Fix algorithm blocks (`#alg-`) being set in italics. Their body is now upright, like definitions, examples and exercises. (author: @mcanouil)
24
24
25
+
### `revealjs`
26
+
27
+
- ([#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)
28
+
25
29
### `typst`
26
30
27
31
- ([#15168](https://github.com/quarto-dev/quarto-cli/issues/15168)): Fix definitions, examples and exercises being set in italics in Typst output with the default `theorem-appearance: simple`. Their body is now upright, as in LaTeX output, while theorems, lemmas, corollaries, propositions and conjectures keep an italic body. (author: @mcanouil)
Copy file name to clipboardExpand all lines: src/resources/editor/tools/vs-code.mjs
+32-3Lines changed: 32 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -7459,6 +7459,31 @@ var init_yaml_intelligence_resources = __esm({
7459
7459
long: "Include line numbers in code block output (`true` or `false`).\n\nFor revealjs output only, you can also specify a string to highlight\nspecific lines (and/or animate between sets of highlighted lines).\n\n* Sets of lines are denoted with commas:\n * `3,4,5`\n * `1,10,12`\n* Ranges can be denoted with dashes and combined with commas:\n * `1-3,5` \n * `5-10,12,14`\n* Finally, animation steps are separated by `|`:\n * `1-3|1-3,5` first shows `1-3`, then `1-3,5`\n * `|5|5-10,12` first shows no numbering, then 5, then lines 5-10\n and 12\n"
7460
7460
}
7461
7461
},
7462
+
{
7463
+
name: "code-line-fragment-indices",
7464
+
tags: {
7465
+
formats: [
7466
+
"revealjs"
7467
+
]
7468
+
},
7469
+
schema: {
7470
+
anyOf: [
7471
+
{
7472
+
string: {
7473
+
pattern: "^\\s*\\d+\\s*(,\\s*\\d+\\s*)*$"
7474
+
}
7475
+
},
7476
+
{
7477
+
maybeArrayOf: "number"
7478
+
}
7479
+
],
7480
+
errorDescription: "be a non-negative integer, a list of them, or a comma-separated string of them, such as `1,2`"
7481
+
},
7482
+
description: {
7483
+
short: "Fragment index of each step of stepped code-line-numbers highlighting (Reveal.js only).",
7484
+
long: 'Fragment index of each step of stepped `code-line-numbers` highlighting\n(Reveal.js only).\n\nGive one index for each step after the first, as a comma-separated list\nof non-negative integers, a YAML list, or a single number.\nThe indices must be strictly increasing.\nEach value places its highlight step among the other fragments of the\nslide, in the same way as `fragment-index` on any other fragment.\nA lower value shows earlier.\nFor example, `code-line-numbers: "|1|2"` with\n`code-line-fragment-indices: "1,2"` shows line 1 at fragment index 1 and\nline 2 at fragment index 2.\n\nThe first step is the code block itself and is not a fragment.\nStart `code-line-numbers` with `|` to give the first highlight its own\nindex.\n\nThe number of indices must equal the number of steps minus one.\nIf it does not, or if the indices are not strictly increasing,\nthe list is ignored, a warning is printed, and the steps use\nthe default order.\n'
7485
+
}
7486
+
},
7462
7487
{
7463
7488
name: "lst-label",
7464
7489
schema: "string",
@@ -23555,6 +23580,10 @@ var init_yaml_intelligence_resources = __esm({
23555
23580
short: "Include line numbers in code block output (<code>true</code> or\n<code>false</code>)",
23556
23581
long: "Include line numbers in code block output (<code>true</code> or\n<code>false</code>).\nFor revealjs output only, you can also specify a string to highlight\nspecific lines (and/or animate between sets of highlighted lines)."
23557
23582
},
23583
+
{
23584
+
short: "Fragment index of each step of stepped code-line-numbers highlighting\n(Reveal.js only).",
23585
+
long: 'Fragment index of each step of stepped <code>code-line-numbers</code>\nhighlighting (Reveal.js only).\nGive one index for each step after the first, as a comma-separated\nlist of non-negative integers, a YAML list, or a single number. The\nindices must be strictly increasing. Each value places its highlight\nstep among the other fragments of the slide, in the same way as\n<code>fragment-index</code> on any other fragment. A lower value shows\nearlier. For example, <code>code-line-numbers: "|1|2"</code> with\n<code>code-line-fragment-indices: "1,2"</code> shows line 1 at fragment\nindex 1 and line 2 at fragment index 2.\nThe first step is the code block itself and is not a fragment. Start\n<code>code-line-numbers</code> with <code>|</code> to give the first\nhighlight its own index.\nThe number of indices must equal the number of steps minus one. If it\ndoes not, or if the indices are not strictly increasing, the list is\nignored, a warning is printed, and the steps use the default order.'
23586
+
},
23558
23587
"Unique label for code listing (used in cross references)",
23559
23588
"Caption for code listing",
23560
23589
"Whether to reformat R code.",
@@ -25848,12 +25877,12 @@ var init_yaml_intelligence_resources = __esm({
25848
25877
mermaid: "%%"
25849
25878
},
25850
25879
"handlers/mermaid/schema.yml": {
25851
-
_internalId: 221307,
25880
+
_internalId: 222271,
25852
25881
type: "object",
25853
25882
description: "be an object",
25854
25883
properties: {
25855
25884
"mermaid-format": {
25856
-
_internalId: 221299,
25885
+
_internalId: 222263,
25857
25886
type: "enum",
25858
25887
enum: [
25859
25888
"png",
@@ -25869,7 +25898,7 @@ var init_yaml_intelligence_resources = __esm({
0 commit comments