Skip to content

Commit 4077c42

Browse files
committed
update quarto
1 parent da12d37 commit 4077c42

File tree

199 files changed

+4745
-5700
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

199 files changed

+4745
-5700
lines changed

_freeze/site_libs/quarto-listing/list.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

_freeze/site_libs/quarto-listing/quarto-listing.js

+14-4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const kProgressiveAttr = "data-src";
22
let categoriesLoaded = false;
33

44
window.quartoListingCategory = (category) => {
5+
category = atob(category);
56
if (categoriesLoaded) {
67
activateCategory(category);
78
setCategoryHash(category);
@@ -15,7 +16,9 @@ window["quarto-listing-loaded"] = () => {
1516
if (hash) {
1617
// If there is a category, switch to that
1718
if (hash.category) {
18-
activateCategory(hash.category);
19+
// category hash are URI encoded so we need to decode it before processing
20+
// so that we can match it with the category element processed in JS
21+
activateCategory(decodeURIComponent(hash.category));
1922
}
2023
// Paginate a specific listing
2124
const listingIds = Object.keys(window["quarto-listings"]);
@@ -58,7 +61,10 @@ window.document.addEventListener("DOMContentLoaded", function (_event) {
5861
);
5962

6063
for (const categoryEl of categoryEls) {
61-
const category = categoryEl.getAttribute("data-category");
64+
// category needs to support non ASCII characters
65+
const category = decodeURIComponent(
66+
atob(categoryEl.getAttribute("data-category"))
67+
);
6268
categoryEl.onclick = () => {
6369
activateCategory(category);
6470
setCategoryHash(category);
@@ -208,7 +214,9 @@ function activateCategory(category) {
208214

209215
// Activate this category
210216
const categoryEl = window.document.querySelector(
211-
`.quarto-listing-category .category[data-category='${category}'`
217+
`.quarto-listing-category .category[data-category='${btoa(
218+
encodeURIComponent(category)
219+
)}']`
212220
);
213221
if (categoryEl) {
214222
categoryEl.classList.add("active");
@@ -231,7 +239,9 @@ function filterListingCategory(category) {
231239
list.filter(function (item) {
232240
const itemValues = item.values();
233241
if (itemValues.categories !== null) {
234-
const categories = itemValues.categories.split(",");
242+
const categories = decodeURIComponent(
243+
atob(itemValues.categories)
244+
).split(",");
235245
return categories.includes(category);
236246
} else {
237247
return false;

_freeze/site_libs/revealjs/dist/reveal.css

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

_freeze/site_libs/revealjs/dist/reveal.esm.js

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

_freeze/site_libs/revealjs/dist/reveal.esm.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

_freeze/site_libs/revealjs/dist/reveal.js

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

_freeze/site_libs/revealjs/dist/reveal.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

_freeze/site_libs/revealjs/dist/theme/fonts/league-gothic/league-gothic.eot

100644100755
File mode changed.

_freeze/site_libs/revealjs/dist/theme/fonts/league-gothic/league-gothic.ttf

100644100755
File mode changed.

_freeze/site_libs/revealjs/dist/theme/fonts/league-gothic/league-gothic.woff

100644100755
File mode changed.

_freeze/site_libs/revealjs/dist/theme/fonts/source-sans-pro/source-sans-pro-italic.eot

100644100755
File mode changed.

_freeze/site_libs/revealjs/dist/theme/fonts/source-sans-pro/source-sans-pro-italic.ttf

100644100755
File mode changed.

_freeze/site_libs/revealjs/dist/theme/fonts/source-sans-pro/source-sans-pro-italic.woff

100644100755
File mode changed.

_freeze/site_libs/revealjs/dist/theme/fonts/source-sans-pro/source-sans-pro-regular.eot

100644100755
File mode changed.

_freeze/site_libs/revealjs/dist/theme/fonts/source-sans-pro/source-sans-pro-regular.ttf

100644100755
File mode changed.

_freeze/site_libs/revealjs/dist/theme/fonts/source-sans-pro/source-sans-pro-regular.woff

100644100755
File mode changed.

_freeze/site_libs/revealjs/dist/theme/fonts/source-sans-pro/source-sans-pro-semibold.eot

100644100755
File mode changed.

_freeze/site_libs/revealjs/dist/theme/fonts/source-sans-pro/source-sans-pro-semibold.ttf

100644100755
File mode changed.

_freeze/site_libs/revealjs/dist/theme/fonts/source-sans-pro/source-sans-pro-semibold.woff

100644100755
File mode changed.

_freeze/site_libs/revealjs/dist/theme/fonts/source-sans-pro/source-sans-pro-semibolditalic.eot

100644100755
File mode changed.

_freeze/site_libs/revealjs/dist/theme/fonts/source-sans-pro/source-sans-pro-semibolditalic.ttf

100644100755
File mode changed.

_freeze/site_libs/revealjs/dist/theme/fonts/source-sans-pro/source-sans-pro-semibolditalic.woff

100644100755
File mode changed.

_freeze/site_libs/revealjs/dist/theme/quarto-5b48f34d633aed70c74c672477009ffc.css

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

_freeze/site_libs/revealjs/dist/theme/quarto-bbe7401fe57d4b791b917637bb662036.css

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

_freeze/site_libs/revealjs/dist/theme/quarto.css

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

_freeze/site_libs/revealjs/plugin/highlight/highlight.esm.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

_freeze/site_libs/revealjs/plugin/highlight/highlight.js

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

_freeze/site_libs/revealjs/plugin/highlight/plugin.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const Plugin = {
1919
hljs,
2020

2121
/**
22-
* Highlights code blocks withing the given deck.
22+
* Highlights code blocks within the given deck.
2323
*
2424
* Note that this can be called multiple times if
2525
* there are multiple presentations on one page.
@@ -138,7 +138,7 @@ const Plugin = {
138138

139139
// Scroll highlights into view as we step through them
140140
fragmentBlock.addEventListener( 'visible', Plugin.scrollHighlightedLineIntoView.bind( Plugin, fragmentBlock, scrollState ) );
141-
fragmentBlock.addEventListener( 'hidden', Plugin.scrollHighlightedLineIntoView.bind( Plugin, fragmentBlock.previousSibling, scrollState ) );
141+
fragmentBlock.addEventListener( 'hidden', Plugin.scrollHighlightedLineIntoView.bind( Plugin, fragmentBlock.previousElementSibling, scrollState ) );
142142

143143
} );
144144

_freeze/site_libs/revealjs/plugin/markdown/markdown.esm.js

+7-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

_freeze/site_libs/revealjs/plugin/markdown/markdown.js

+7-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

_freeze/site_libs/revealjs/plugin/markdown/plugin.js

100644100755
+64-48
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,16 @@
77
import { marked } from 'marked';
88

99
const DEFAULT_SLIDE_SEPARATOR = '\r?\n---\r?\n',
10-
DEFAULT_NOTES_SEPARATOR = 'notes?:',
10+
DEFAULT_VERTICAL_SEPARATOR = null,
11+
DEFAULT_NOTES_SEPARATOR = '^\s*notes?:',
1112
DEFAULT_ELEMENT_ATTRIBUTES_SEPARATOR = '\\\.element\\\s*?(.+?)$',
1213
DEFAULT_SLIDE_ATTRIBUTES_SEPARATOR = '\\\.slide:\\\s*?(\\\S.+?)$';
1314

1415
const SCRIPT_END_PLACEHOLDER = '__SCRIPT_END__';
1516

16-
const CODE_LINE_NUMBER_REGEX = /\[([\s\d,|-]*)\]/;
17+
// match an optional line number offset and highlight line numbers
18+
// [<line numbers>] or [<offset>: <line numbers>]
19+
const CODE_LINE_NUMBER_REGEX = /\[\s*((\d*):)?\s*([\s\d,|-]*)\]/;
1720

1821
const HTML_ESCAPE_MAP = {
1922
'&': '&amp;',
@@ -35,22 +38,22 @@ const Plugin = () => {
3538
function getMarkdownFromSlide( section ) {
3639

3740
// look for a <script> or <textarea data-template> wrapper
38-
var template = section.querySelector( '[data-template]' ) || section.querySelector( 'script' );
41+
const template = section.querySelector( '[data-template]' ) || section.querySelector( 'script' );
3942

4043
// strip leading whitespace so it isn't evaluated as code
41-
var text = ( template || section ).textContent;
44+
let text = ( template || section ).textContent;
4245

4346
// restore script end tags
4447
text = text.replace( new RegExp( SCRIPT_END_PLACEHOLDER, 'g' ), '</script>' );
4548

46-
var leadingWs = text.match( /^\n?(\s*)/ )[1].length,
49+
const leadingWs = text.match( /^\n?(\s*)/ )[1].length,
4750
leadingTabs = text.match( /^\n?(\t*)/ )[1].length;
4851

4952
if( leadingTabs > 0 ) {
50-
text = text.replace( new RegExp('\\n?\\t{' + leadingTabs + '}','g'), '\n' );
53+
text = text.replace( new RegExp('\\n?\\t{' + leadingTabs + '}(.*)','g'), function(m, p1) { return '\n' + p1 ; } );
5154
}
5255
else if( leadingWs > 1 ) {
53-
text = text.replace( new RegExp('\\n? {' + leadingWs + '}', 'g'), '\n' );
56+
text = text.replace( new RegExp('\\n? {' + leadingWs + '}(.*)', 'g'), function(m, p1) { return '\n' + p1 ; } );
5457
}
5558

5659
return text;
@@ -65,11 +68,11 @@ const Plugin = () => {
6568
*/
6669
function getForwardedAttributes( section ) {
6770

68-
var attributes = section.attributes;
69-
var result = [];
71+
const attributes = section.attributes;
72+
const result = [];
7073

71-
for( var i = 0, len = attributes.length; i < len; i++ ) {
72-
var name = attributes[i].name,
74+
for( let i = 0, len = attributes.length; i < len; i++ ) {
75+
const name = attributes[i].name,
7376
value = attributes[i].value;
7477

7578
// disregard attributes that are used for markdown loading/parsing
@@ -92,10 +95,12 @@ const Plugin = () => {
9295
* values for what's not defined.
9396
*/
9497
function getSlidifyOptions( options ) {
98+
const markdownConfig = deck?.getConfig?.().markdown;
9599

96100
options = options || {};
97-
options.separator = options.separator || DEFAULT_SLIDE_SEPARATOR;
98-
options.notesSeparator = options.notesSeparator || DEFAULT_NOTES_SEPARATOR;
101+
options.separator = options.separator || markdownConfig?.separator || DEFAULT_SLIDE_SEPARATOR;
102+
options.verticalSeparator = options.verticalSeparator || markdownConfig?.verticalSeparator || DEFAULT_VERTICAL_SEPARATOR;
103+
options.notesSeparator = options.notesSeparator || markdownConfig?.notesSeparator || DEFAULT_NOTES_SEPARATOR;
99104
options.attributes = options.attributes || '';
100105

101106
return options;
@@ -109,7 +114,7 @@ const Plugin = () => {
109114

110115
options = getSlidifyOptions( options );
111116

112-
var notesMatch = content.split( new RegExp( options.notesSeparator, 'mgi' ) );
117+
const notesMatch = content.split( new RegExp( options.notesSeparator, 'mgi' ) );
113118

114119
if( notesMatch.length === 2 ) {
115120
content = notesMatch[0] + '<aside class="notes">' + marked(notesMatch[1].trim()) + '</aside>';
@@ -131,10 +136,10 @@ const Plugin = () => {
131136

132137
options = getSlidifyOptions( options );
133138

134-
var separatorRegex = new RegExp( options.separator + ( options.verticalSeparator ? '|' + options.verticalSeparator : '' ), 'mg' ),
139+
const separatorRegex = new RegExp( options.separator + ( options.verticalSeparator ? '|' + options.verticalSeparator : '' ), 'mg' ),
135140
horizontalSeparatorRegex = new RegExp( options.separator );
136141

137-
var matches,
142+
let matches,
138143
lastIndex = 0,
139144
isHorizontal,
140145
wasHorizontal = true,
@@ -143,7 +148,7 @@ const Plugin = () => {
143148

144149
// iterate until all blocks between separators are stacked up
145150
while( matches = separatorRegex.exec( markdown ) ) {
146-
var notes = null;
151+
const notes = null;
147152

148153
// determine direction (horizontal by default)
149154
isHorizontal = horizontalSeparatorRegex.test( matches[0] );
@@ -172,10 +177,10 @@ const Plugin = () => {
172177
// add the remaining slide
173178
( wasHorizontal ? sectionStack : sectionStack[sectionStack.length-1] ).push( markdown.substring( lastIndex ) );
174179

175-
var markdownSections = '';
180+
let markdownSections = '';
176181

177182
// flatten the hierarchical stack, and insert <section data-markdown> tags
178-
for( var i = 0, len = sectionStack.length; i < len; i++ ) {
183+
for( let i = 0, len = sectionStack.length; i < len; i++ ) {
179184
// vertical
180185
if( sectionStack[i] instanceof Array ) {
181186
markdownSections += '<section '+ options.attributes +'>';
@@ -204,7 +209,7 @@ const Plugin = () => {
204209

205210
return new Promise( function( resolve ) {
206211

207-
var externalPromises = [];
212+
const externalPromises = [];
208213

209214
[].slice.call( scope.querySelectorAll( 'section[data-markdown]:not([data-markdown-parsed])') ).forEach( function( section, i ) {
210215

@@ -257,13 +262,13 @@ const Plugin = () => {
257262

258263
return new Promise( function( resolve, reject ) {
259264

260-
var xhr = new XMLHttpRequest(),
265+
const xhr = new XMLHttpRequest(),
261266
url = section.getAttribute( 'data-markdown' );
262267

263-
var datacharset = section.getAttribute( 'data-charset' );
268+
const datacharset = section.getAttribute( 'data-charset' );
264269

265270
// see https://developer.mozilla.org/en-US/docs/Web/API/element.getAttribute#Notes
266-
if( datacharset != null && datacharset != '' ) {
271+
if( datacharset !== null && datacharset !== '' ) {
267272
xhr.overrideMimeType( 'text/html; charset=' + datacharset );
268273
}
269274

@@ -308,17 +313,17 @@ const Plugin = () => {
308313
*/
309314
function addAttributeInElement( node, elementTarget, separator ) {
310315

311-
var mardownClassesInElementsRegex = new RegExp( separator, 'mg' );
312-
var mardownClassRegex = new RegExp( "([^\"= ]+?)=\"([^\"]+?)\"|(data-[^\"= ]+?)(?=[\" ])", 'mg' );
313-
var nodeValue = node.nodeValue;
314-
var matches,
316+
const markdownClassesInElementsRegex = new RegExp( separator, 'mg' );
317+
const markdownClassRegex = new RegExp( "([^\"= ]+?)=\"([^\"]+?)\"|(data-[^\"= ]+?)(?=[\" ])", 'mg' );
318+
let nodeValue = node.nodeValue;
319+
let matches,
315320
matchesClass;
316-
if( matches = mardownClassesInElementsRegex.exec( nodeValue ) ) {
321+
if( matches = markdownClassesInElementsRegex.exec( nodeValue ) ) {
317322

318-
var classes = matches[1];
319-
nodeValue = nodeValue.substring( 0, matches.index ) + nodeValue.substring( mardownClassesInElementsRegex.lastIndex );
323+
const classes = matches[1];
324+
nodeValue = nodeValue.substring( 0, matches.index ) + nodeValue.substring( markdownClassesInElementsRegex.lastIndex );
320325
node.nodeValue = nodeValue;
321-
while( matchesClass = mardownClassRegex.exec( classes ) ) {
326+
while( matchesClass = markdownClassRegex.exec( classes ) ) {
322327
if( matchesClass[2] ) {
323328
elementTarget.setAttribute( matchesClass[1], matchesClass[2] );
324329
} else {
@@ -336,34 +341,34 @@ const Plugin = () => {
336341
*/
337342
function addAttributes( section, element, previousElement, separatorElementAttributes, separatorSectionAttributes ) {
338343

339-
if ( element != null && element.childNodes != undefined && element.childNodes.length > 0 ) {
340-
var previousParentElement = element;
341-
for( var i = 0; i < element.childNodes.length; i++ ) {
342-
var childElement = element.childNodes[i];
344+
if ( element !== null && element.childNodes !== undefined && element.childNodes.length > 0 ) {
345+
let previousParentElement = element;
346+
for( let i = 0; i < element.childNodes.length; i++ ) {
347+
const childElement = element.childNodes[i];
343348
if ( i > 0 ) {
344-
var j = i - 1;
349+
let j = i - 1;
345350
while ( j >= 0 ) {
346-
var aPreviousChildElement = element.childNodes[j];
347-
if ( typeof aPreviousChildElement.setAttribute == 'function' && aPreviousChildElement.tagName != "BR" ) {
351+
const aPreviousChildElement = element.childNodes[j];
352+
if ( typeof aPreviousChildElement.setAttribute === 'function' && aPreviousChildElement.tagName !== "BR" ) {
348353
previousParentElement = aPreviousChildElement;
349354
break;
350355
}
351356
j = j - 1;
352357
}
353358
}
354-
var parentSection = section;
355-
if( childElement.nodeName == "section" ) {
359+
let parentSection = section;
360+
if( childElement.nodeName === "section" ) {
356361
parentSection = childElement ;
357362
previousParentElement = childElement ;
358363
}
359-
if ( typeof childElement.setAttribute == 'function' || childElement.nodeType == Node.COMMENT_NODE ) {
364+
if ( typeof childElement.setAttribute === 'function' || childElement.nodeType === Node.COMMENT_NODE ) {
360365
addAttributes( parentSection, childElement, previousParentElement, separatorElementAttributes, separatorSectionAttributes );
361366
}
362367
}
363368
}
364369

365-
if ( element.nodeType == Node.COMMENT_NODE ) {
366-
if ( addAttributeInElement( element, previousElement, separatorElementAttributes ) == false ) {
370+
if ( element.nodeType === Node.COMMENT_NODE ) {
371+
if ( addAttributeInElement( element, previousElement, separatorElementAttributes ) === false ) {
367372
addAttributeInElement( element, section, separatorSectionAttributes );
368373
}
369374
}
@@ -375,14 +380,14 @@ const Plugin = () => {
375380
*/
376381
function convertSlides() {
377382

378-
var sections = deck.getRevealElement().querySelectorAll( '[data-markdown]:not([data-markdown-parsed])');
383+
const sections = deck.getRevealElement().querySelectorAll( '[data-markdown]:not([data-markdown-parsed])');
379384

380385
[].slice.call( sections ).forEach( function( section ) {
381386

382387
section.setAttribute( 'data-markdown-parsed', true )
383388

384-
var notes = section.querySelector( 'aside.notes' );
385-
var markdown = getMarkdownFromSlide( section );
389+
const notes = section.querySelector( 'aside.notes' );
390+
const markdown = getMarkdownFromSlide( section );
386391

387392
section.innerHTML = marked( markdown );
388393
addAttributes( section, section, null, section.getAttribute( 'data-element-attributes' ) ||
@@ -429,14 +434,23 @@ const Plugin = () => {
429434
renderer.code = ( code, language ) => {
430435

431436
// Off by default
437+
let lineNumberOffset = '';
432438
let lineNumbers = '';
433439

434440
// Users can opt in to show line numbers and highlight
435441
// specific lines.
436442
// ```javascript [] show line numbers
437443
// ```javascript [1,4-8] highlights lines 1 and 4-8
444+
// optional line number offset:
445+
// ```javascript [25: 1,4-8] start line numbering at 25,
446+
// highlights lines 1 (numbered as 25) and 4-8 (numbered as 28-32)
438447
if( CODE_LINE_NUMBER_REGEX.test( language ) ) {
439-
lineNumbers = language.match( CODE_LINE_NUMBER_REGEX )[1].trim();
448+
let lineNumberOffsetMatch = language.match( CODE_LINE_NUMBER_REGEX )[2];
449+
if (lineNumberOffsetMatch){
450+
lineNumberOffset = `data-ln-start-from="${lineNumberOffsetMatch.trim()}"`;
451+
}
452+
453+
lineNumbers = language.match( CODE_LINE_NUMBER_REGEX )[3].trim();
440454
lineNumbers = `data-line-numbers="${lineNumbers}"`;
441455
language = language.replace( CODE_LINE_NUMBER_REGEX, '' ).trim();
442456
}
@@ -446,7 +460,9 @@ const Plugin = () => {
446460
// highlight.js is able to read it
447461
code = escapeForHTML( code );
448462

449-
return `<pre><code ${lineNumbers} class="${language}">${code}</code></pre>`;
463+
// return `<pre><code ${lineNumbers} class="${language}">${code}</code></pre>`;
464+
465+
return `<pre><code ${lineNumbers} ${lineNumberOffset} class="${language}">${code}</code></pre>`;
450466
};
451467
}
452468

_freeze/site_libs/revealjs/plugin/math/katex.js

100644100755
File mode changed.

_freeze/site_libs/revealjs/plugin/math/math.esm.js

+6-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

_freeze/site_libs/revealjs/plugin/math/math.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

_freeze/site_libs/revealjs/plugin/math/mathjax3.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const MathJax3 = () => {
2121
ready: () => {
2222
MathJax.startup.defaultReady();
2323
MathJax.startup.promise.then(() => {
24-
Reveal.layout();
24+
deck.layout();
2525
});
2626
}
2727
}
@@ -66,7 +66,7 @@ export const MathJax3 = () => {
6666

6767
loadScript( url, function() {
6868
// Reprocess equations in slides when they turn visible
69-
Reveal.addEventListener( 'slidechanged', function( event ) {
69+
deck.addEventListener( 'slidechanged', function( event ) {
7070
MathJax.typeset();
7171
} );
7272
} );

_freeze/site_libs/revealjs/plugin/notes/notes.esm.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

_freeze/site_libs/revealjs/plugin/notes/notes.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)