File tree Expand file tree Collapse file tree 9 files changed +61
-12
lines changed Expand file tree Collapse file tree 9 files changed +61
-12
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ frontmatter : go
3+ ---
4+
5+ ## Math
6+
7+ $$ f'(x), \frac{dy}{dx},\dot{x}, y' ... $$
8+
9+ ---
10+
11+ ## Slide 1: Test Formula
12+
13+ Different math rendering with and without show grid
14+ - with grid: rendering like inline formula
15+ - without grid: rendering like block
16+ (position of $t \to \infty$ changes)
17+
18+ $$ \lim_{t \to \infty} (w(t) - y(t)) = 0 $$
19+
20+ ---
21+
22+ <!-- slide template="[[template_formula]]" -->
23+
24+ ## Slide 2: Test Equation with Templates
25+
26+ - Test equation-template
27+ - Formula is rendered as inline-formula independent of grid on/off settings like (like
28+
29+ ::: formula
30+ $$ \lim_{t \to \infty} (w(t) - y(t)) = 0 $$
31+ :::
32+
33+ ---
34+
35+ ## Test
36+
37+ Problems with inline code ` $ ... $ `
Original file line number Diff line number Diff line change @@ -43,12 +43,6 @@ _emphasis_ **bold** ==highlight==
4343
4444---
4545
46- ## Math
47-
48- $$ f'(x), \frac{dy}{dx},\dot{x}, y' ... $$
49-
50- ---
51-
5246## Included H1
5347
5448This will include everything under H1
Original file line number Diff line number Diff line change 1+ <!-- content -->
2+ <% content %>
3+ <!-- content -->
4+
5+ <grid drag =" 100 20 " drop =" bottom " bg =" silver " align =" center " pad =" 0 20px " >
6+ <!-- formula -->
7+ <% formula %>
8+ <!-- formula -->
9+ </grid >
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ export class DebugViewProcessor implements Processor {
2020 if ( notes . length > 0 ) {
2121 newSlide += `\n\n${ notes } ` ;
2222 }
23- output = output . replace ( slide , newSlide ) ;
23+ output = output . replace ( slide , ( ) => newSlide ) ;
2424 return newSlide ;
2525 } )
2626 . join ( options . verticalSeparator ) ;
Original file line number Diff line number Diff line change @@ -150,6 +150,13 @@ export class TemplateProcessor implements Processor {
150150 fileWithExtension = `${ fileWithExtension } .md` ;
151151 }
152152 let templateContent = this . utils . parseFile ( fileWithExtension , null ) ;
153+
154+ if ( templateContent == null ) {
155+ throw new Error (
156+ `Template file not found: [[${ file } ]] (resolved to: ${ fileWithExtension } )` ,
157+ ) ;
158+ }
159+
153160 templateContent =
154161 this . multipleFileProcessor . process ( templateContent ) ;
155162 templateContent = templateContent
@@ -187,9 +194,9 @@ export class TemplateProcessor implements Processor {
187194 name = `<% ${ name . trim ( ) } %>` ;
188195 result = result . replaceAll (
189196 optionalName ,
190- `${ content } \n${ optionalName } ` ,
197+ ( ) => `${ content } \n${ optionalName } ` ,
191198 ) ;
192- result = result . replaceAll ( name , content ) ;
199+ result = result . replaceAll ( name , ( ) => content ) ;
193200 result = result . replaceAll ( match , "" ) ;
194201 }
195202 result = this . footnoteProcessor . transformFootNotes ( result ) ;
Original file line number Diff line number Diff line change @@ -28,4 +28,4 @@ exports[`Extended Markdown Syntax > Speaker Notes 1`] = `""<!-- .slide: class=\
2828
2929exports[`Extended Markdown Syntax > Horizontal / Vertical Slides 1`] = `""<!-- .slide: class=\\"drop\\" -->\\n<div class =\\"\\" style =\\"position: absolute; left: 0px; top: 0px; height: 700px; width: 960px; min-height: 700px; display: flex; flex-direction: column; align-items: center; justify-content: center\\" absolute =\\"true\\">\\n\\n# Slide 1\\n</div>\\n---\\n<!-- .slide: class =\\"drop\\" -->\\n<div class =\\"\\" style =\\"position: absolute; left: 0px; top: 0px; height: 700px; width: 960px; min-height: 700px; display: flex; flex-direction: column; align-items: center; justify-content: center\\" absolute =\\"true\\">\\n\\n# Slide 2.1\\n</div>\\n--\\n<!-- .slide: class =\\"drop\\" -->\\n<div class =\\"\\" style =\\"position: absolute; left: 0px; top: 0px; height: 700px; width: 960px; min-height: 700px; display: flex; flex-direction: column; align-items: center; justify-content: center\\" absolute =\\"true\\">\\n\\n# Slide 2.2\\n</div>""`;
3030
31- exports[`Slides Extended Feature > Show Debug Grid 1`] = `""<!-- .slide: class=\\"drop\\" -->\\n<div class=\\"\\" style=\\"position: absolute; left: 0px; top: 0px; height: 700px; width: 960px; min-height: 700px; display: flex; flex-direction: column; align-items: center; justify-content: center\\" absolute=\\"true\\">\\n\\n## My Slide\\n\\nThis slide shows the debug view feature\\n\\n\\n<div class=\\"\\" style=\\"border: thin dotted blue; box-sizing: border-box; position: absolute; left: 0%; top: 0%; height: 10%; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center\\" >\\n</div>\\n<div class=\\"\\" style=\\"border: thin dotted blue; box-sizing: border-box; position: absolute; left: 0%; top: 10%; height: 10%; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center\\" >\\n</div>\\n<div class=\\"\\" style=\\"border: thin dotted blue; box-sizing: border-box; position: absolute; left: 0%; top: 20%; height: 10%; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center\\" >\\n</div>\\n<div class=\\"\\" style=\\"border: thin dotted blue; box-sizing: border-box; position: absolute; left: 0%; top: 30%; height: 10%; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center\\" >\\n</div>\\n<div class=\\"\\" style=\\"border: thin dotted blue; box-sizing: border-box; position: absolute; left: 0%; top: 40%; height: 10%; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center\\" >\\n</div>\\n<div class=\\"\\" style=\\"border: thin dotted blue; box-sizing: border-box; position: absolute; left: 0%; top: 50%; height: 10%; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center\\" >\\n</div>\\n<div class=\\"\\" style=\\"border: thin dotted blue; box-sizing: border-box; position: absolute; left: 0%; top: 60%; height: 10%; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center\\" >\\n</div>\\n<div class=\\"\\" style=\\"border: thin dotted blue; box-sizing: border-box; position: absolute; left: 0%; top: 70%; height: 10%; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center\\" >\\n</div>\\n<div class=\\"\\" style=\\"border: thin dotted blue; box-sizing: border-box; position: absolute; left: 0%; top: 80%; height: 10%; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center\\" >\\n</div>\\n<div class=\\"\\" style=\\"border: thin dotted blue; box-sizing: border-box; position: absolute; left: 0%; top: 90%; height: 10%; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center\\" >\\n</div>\\n<div class=\\"\\" style=\\"border: thin dotted blue; box-sizing: border-box; position: absolute; left: 0%; top: 0%; height: 100%; width: 10%; display: flex; flex-direction: column; align-items: center; justify-content: center\\" >\\n</div>\\n<div class=\\"\\" style=\\"border: thin dotted blue; box-sizing: border-box; position: absolute; left: 10%; top: 0%; height: 100%; width: 10%; display: flex; flex-direction: column; align-items: center; justify-content: center\\" >\\n</div>\\n<div class=\\"\\" style=\\"border: thin dotted blue; box-sizing: border-box; position: absolute; left: 20%; top: 0%; height: 100%; width: 10%; display: flex; flex-direction: column; align-items: center; justify-content: center\\" >\\n</div>\\n<div class=\\"\\" style=\\"border: thin dotted blue; box-sizing: border-box; position: absolute; left: 30%; top: 0%; height: 100%; width: 10%; display: flex; flex-direction: column; align-items: center; justify-content: center\\" >\\n</div>\\n<div class=\\"\\" style=\\"border: thin dotted blue; box-sizing: border-box; position: absolute; left: 40%; top: 0%; height: 100%; width: 10%; display: flex; flex-direction: column; align-items: center; justify-content: center\\" >\\n</div>\\n<div class=\\"\\" style=\\"border: thin dotted blue; box-sizing: border-box; position: absolute; left: 50%; top: 0%; height: 100%; width: 10%; display: flex; flex-direction: column; align-items: center; justify-content: center\\" >\\n</div>\\n<div class=\\"\\" style=\\"border: thin dotted blue; box-sizing: border-box; position: absolute; left: 60%; top: 0%; height: 100%; width: 10%; display: flex; flex-direction: column; align-items: center; justify-content: center\\" >\\n</div>\\n<div class=\\"\\" style=\\"border: thin dotted blue; box-sizing: border-box; position: absolute; left: 70%; top: 0%; height: 100%; width: 10%; display: flex; flex-direction: column; align-items: center; justify-content: center\\" >\\n</div>\\n<div class=\\"\\" style=\\"border: thin dotted blue; box-sizing: border-box; position: absolute; left: 80%; top: 0%; height: 100%; width: 10%; display: flex; flex-direction: column; align-items: center; justify-content: center\\" >\\n</div>\\n<div class=\\"\\" style=\\"border: thin dotted blue; box-sizing: border-box; position: absolute; left: 90%; top: 0%; height: 100%; width: 10%; display: flex; flex-direction: column; align-items: center; justify-content: center\\" >\\n</div>\\n</div>""`;
31+ exports[`Slides Extended Feature > Show Debug Grid 1`] = `""<!-- .slide: class=\\"drop\\" -->\\n<div class=\\"\\" style=\\"position: absolute; left: 0px; top: 0px; height: 700px; width: 960px; min-height: 700px; display: flex; flex-direction: column; align-items: center; justify-content: center\\" absolute=\\"true\\">\\n\\n## My Slide\\n\\nThis slide shows the debug view feature\\n\\n$$lim_{t \\to infty} (w(t) - y(t)) = 0$$\\n\\n\\n<div class=\\"\\" style=\\"border: thin dotted blue; box-sizing: border-box; position: absolute; left: 0%; top: 0%; height: 10%; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center\\" >\\n</div>\\n<div class=\\"\\" style=\\"border: thin dotted blue; box-sizing: border-box; position: absolute; left: 0%; top: 10%; height: 10%; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center\\" >\\n</div>\\n<div class=\\"\\" style=\\"border: thin dotted blue; box-sizing: border-box; position: absolute; left: 0%; top: 20%; height: 10%; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center\\" >\\n</div>\\n<div class=\\"\\" style=\\"border: thin dotted blue; box-sizing: border-box; position: absolute; left: 0%; top: 30%; height: 10%; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center\\" >\\n</div>\\n<div class=\\"\\" style=\\"border: thin dotted blue; box-sizing: border-box; position: absolute; left: 0%; top: 40%; height: 10%; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center\\" >\\n</div>\\n<div class=\\"\\" style=\\"border: thin dotted blue; box-sizing: border-box; position: absolute; left: 0%; top: 50%; height: 10%; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center\\" >\\n</div>\\n<div class=\\"\\" style=\\"border: thin dotted blue; box-sizing: border-box; position: absolute; left: 0%; top: 60%; height: 10%; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center\\" >\\n</div>\\n<div class=\\"\\" style=\\"border: thin dotted blue; box-sizing: border-box; position: absolute; left: 0%; top: 70%; height: 10%; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center\\" >\\n</div>\\n<div class=\\"\\" style=\\"border: thin dotted blue; box-sizing: border-box; position: absolute; left: 0%; top: 80%; height: 10%; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center\\" >\\n</div>\\n<div class=\\"\\" style=\\"border: thin dotted blue; box-sizing: border-box; position: absolute; left: 0%; top: 90%; height: 10%; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center\\" >\\n</div>\\n<div class=\\"\\" style=\\"border: thin dotted blue; box-sizing: border-box; position: absolute; left: 0%; top: 0%; height: 100%; width: 10%; display: flex; flex-direction: column; align-items: center; justify-content: center\\" >\\n</div>\\n<div class=\\"\\" style=\\"border: thin dotted blue; box-sizing: border-box; position: absolute; left: 10%; top: 0%; height: 100%; width: 10%; display: flex; flex-direction: column; align-items: center; justify-content: center\\" >\\n</div>\\n<div class=\\"\\" style=\\"border: thin dotted blue; box-sizing: border-box; position: absolute; left: 20%; top: 0%; height: 100%; width: 10%; display: flex; flex-direction: column; align-items: center; justify-content: center\\" >\\n</div>\\n<div class=\\"\\" style=\\"border: thin dotted blue; box-sizing: border-box; position: absolute; left: 30%; top: 0%; height: 100%; width: 10%; display: flex; flex-direction: column; align-items: center; justify-content: center\\" >\\n</div>\\n<div class=\\"\\" style=\\"border: thin dotted blue; box-sizing: border-box; position: absolute; left: 40%; top: 0%; height: 100%; width: 10%; display: flex; flex-direction: column; align-items: center; justify-content: center\\" >\\n</div>\\n<div class=\\"\\" style=\\"border: thin dotted blue; box-sizing: border-box; position: absolute; left: 50%; top: 0%; height: 100%; width: 10%; display: flex; flex-direction: column; align-items: center; justify-content: center\\" >\\n</div>\\n<div class=\\"\\" style=\\"border: thin dotted blue; box-sizing: border-box; position: absolute; left: 60%; top: 0%; height: 100%; width: 10%; display: flex; flex-direction: column; align-items: center; justify-content: center\\" >\\n</div>\\n<div class=\\"\\" style=\\"border: thin dotted blue; box-sizing: border-box; position: absolute; left: 70%; top: 0%; height: 100%; width: 10%; display: flex; flex-direction: column; align-items: center; justify-content: center\\" >\\n</div>\\n<div class=\\"\\" style=\\"border: thin dotted blue; box-sizing: border-box; position: absolute; left: 80%; top: 0%; height: 100%; width: 10%; display: flex; flex-direction: column; align-items: center; justify-content: center\\" >\\n</div>\\n<div class=\\"\\" style=\\"border: thin dotted blue; box-sizing: border-box; position: absolute; left: 90%; top: 0%; height: 100%; width: 10%; display: flex; flex-direction: column; align-items: center; justify-content: center\\" >\\n</div>\\n</div>""`;
Original file line number Diff line number Diff line change @@ -8,4 +8,4 @@ exports[`Template with variable in frontmatter 1`] = `""<!-- .slide: class=\\"dr
88
99exports [` Template with variable not set 1` ] = ` ""<!-- .slide: class=\\ "drop\\ " -->\\ n<div class =\\"\\" style =\\"position: absolute; left: 0px; top: 0px; height: 700px; width: 960px; min-height: 700px; display: flex; flex-direction: column; align-items: center; justify-content: center\\" absolute =\\"true\\">\\n\\n# MyContent\\n\\n # After<div class =\\"\\" style =\\"position: absolute; left: 0%; top: 94%; height: 6%; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center\\" >\\n\\n <% footer %>\\n </div >\\ n</div>""` ;
1010
11- exports [` Template with variable set 1` ] = ` ""<!-- .slide: class=\\ "drop\\ " -->\\ n<div class =\\"\\" style =\\"position: absolute; left: 0px; top: 0px; height: 700px; width: 960px; min-height: 700px; display: flex; flex-direction: column; align-items: center; justify-content: center\\" absolute =\\"true\\">\\n\\n# MyContent\\n\\n\\n\\n\\n # After<div class =\\"\\" style =\\"position: absolute; left: 0%; top: 94%; height: 6%; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center\\" >\\n\\n <div class =\\"block\\">\\n\\n# Hello \\n</div>\\n\\n\\n </div>\\n</div>""`;
11+ exports [` Template with variable set 1` ] = ` ""<!-- .slide: class=\\ "drop\\ " -->\\ n<div class =\\"\\" style =\\"position: absolute; left: 0px; top: 0px; height: 700px; width: 960px; min-height: 700px; display: flex; flex-direction: column; align-items: center; justify-content: center\\" absolute =\\"true\\">\\n\\n# MyContent\\n\\n\\n\\n\\n # After<div class =\\"\\" style =\\"position: absolute; left: 0%; top: 94%; height: 6%; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center\\" >\\n\\n <div class =\\"block\\">\\n\\n$$lim_{t \\to infty} (w(t) - y(t)) = 0$$ \\n</div>\\n\\n\\n </div>\\n</div>""`;
Original file line number Diff line number Diff line change @@ -412,6 +412,8 @@ test('Slides Extended Feature > Show Debug Grid', () => {
412412
413413This slide shows the debug view feature
414414
415+ $$\lim_{t \to \infty} (w(t) - y(t)) = 0$$
416+
415417` ;
416418
417419 const { options, markdown } = prepare ( input ) ;
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ test('Template with variable set', () => {
8787# MyContent
8888
8989::: footer
90- # Hello
90+ $$\lim_{t \to \infty} (w(t) - y(t)) = 0$$
9191:::
9292
9393` ;
You can’t perform that action at this time.
0 commit comments