File tree Expand file tree Collapse file tree 3 files changed +61
-3
lines changed Expand file tree Collapse file tree 3 files changed +61
-3
lines changed Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ You can embed sections from your notes into your presentation
144
144
145
145
---
146
146
147
- ## Element Annotations
147
+ ### Element Annotations
148
148
149
149
You can pass style or class properties for an element by annotating it:
150
150
@@ -156,7 +156,7 @@ You can pass style or class properties for an element by annotating it:
156
156
157
157
---
158
158
159
- ## Slide Annotations
159
+ ### Slide Annotations
160
160
161
161
You can pass style or class properties for the whole slide by annotating it:
162
162
@@ -169,3 +169,40 @@ You can pass style or class properties for the whole slide by annotating it:
169
169
<!-- .slide: style="background-color: green;" -->
170
170
171
171
# Slide with green background color
172
+
173
+ ---
174
+
175
+ ### Block Comments
176
+
177
+ You can use block comments to group parts of your slide.
178
+
179
+ ::: block
180
+
181
+ #### Header
182
+ _and_
183
+ Paragraph content
184
+ *in same block*
185
+
186
+ :::
187
+
188
+ By annotating the block all items inside this block gets the properties of the annotation:
189
+
190
+ no color
191
+
192
+ ::: block <!-- .element: style="background-color: red;" -->
193
+
194
+ everything inside this block has red background color
195
+
196
+ ::: block <!-- .element: style="background-color: blue;" -->
197
+
198
+ blue
199
+
200
+ :::
201
+
202
+ red
203
+
204
+ :::
205
+
206
+ no color
207
+
208
+
Original file line number Diff line number Diff line change
1
+
2
+ export class BlockProcessor {
3
+
4
+ process ( markdown : string ) {
5
+ return this . transformBlock ( markdown ) ;
6
+ }
7
+
8
+ transformBlock ( markdown : string ) {
9
+
10
+ markdown = markdown . replaceAll ( '::: block' , '<div class="block">' ) ;
11
+ markdown = markdown . replaceAll ( ':::' , '</div>' ) ;
12
+ return markdown ;
13
+ }
14
+
15
+ }
16
+
17
+
Original file line number Diff line number Diff line change 1
1
import { App } from "obsidian" ;
2
+ import { BlockProcessor } from "./blockProcessor" ;
2
3
import { MultipleFileProcessor } from "./multipleFileProcessor" ;
3
4
4
5
export class ObsidianMarkdownPreprocessor {
5
6
6
7
private multipleFileProcessor : MultipleFileProcessor ;
8
+ private blockProcessor : BlockProcessor ;
7
9
8
10
constructor ( app : App ) {
9
11
this . multipleFileProcessor = new MultipleFileProcessor ( app ) ;
12
+ this . blockProcessor = new BlockProcessor ( ) ;
10
13
}
11
14
12
15
process ( markdown : string ) {
13
16
const afterMultipleFileProcessor = this . multipleFileProcessor . process ( markdown ) ;
14
- return afterMultipleFileProcessor ;
17
+ const afterBlockProcessor = this . blockProcessor . process ( afterMultipleFileProcessor ) ;
18
+ return afterBlockProcessor ;
15
19
}
16
20
17
21
You can’t perform that action at this time.
0 commit comments