├── LICENSE ├── README.md ├── docs ├── css │ └── sidebar.css └── index.html ├── input.md ├── md-to-bootstrap5.lua ├── media ├── accordion.gif ├── alertdanger.png ├── alertinfo.png ├── button.png ├── buttonsuccess.png ├── card.png ├── carousel.gif ├── carouselquiz.gif ├── icon.png ├── jumbotron.png ├── quiz.gif ├── tabs.gif └── youtube.png ├── template ├── README.md └── bs5.template.html └── test ├── bs5.bat ├── css └── sidebar.css └── result-v2.html /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright © 2021–2022 François PARLANT and contributors. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Pandoc Lua filter : Markdown To Bootstrap 2 | 3 | This pandoc Lua filter converts markdown to Bootstrap components. 4 | 5 | *Useful for rapidly creating visually attractive Moodle courses* 6 | 7 | # USAGE 8 | 9 | 10 | ``` 11 | pandoc sample.md --lua-filter bootstrap.lua -o expected.html -f markdown+inline_code_attributes 12 | ``` 13 | 14 | Or with a template to add the bootstrap headers and navbar with Table of content. 15 | ``` 16 | pandoc sample.md --lua-filter bootstrap.lua -o result.html --template bs5.template.html -f markdown+inline_code_attributes 17 | ``` 18 | 19 | # COMPONENTS 20 | 21 | 22 | ## Header block (jumbotron) 23 | 24 |
Simply type this: | Get that: |
---|---|
28 | 29 | ``` 30 | ::: jumbotron 31 | # Markdown to Bootstrap 32 | Discovert how some simple Mardown can 33 | be converted 34 | 35 | Here is an implementation with pandoc 36 | and Lua filter 37 | ::: 38 | ``` 39 | | 40 |41 | 42 |  43 | 44 | |
Simply type the question and proposals: | And get that : |
---|---|
55 | 56 | ``` 57 | ::: quiz 58 | # This is the question? 59 | 60 | * First proposition 61 | * Explanation about first 62 | * Second proposition 63 | * Third proposition 64 | * Fourth proposition 65 | * Explanation about fourth 66 | 67 | ::: 68 | ``` 69 | | 70 |71 | 72 |  73 | 74 | |
Type simply the slide content: | And get that: |
---|---|
85 | 86 | ``` 87 | ::: carousel carouselId 88 | 89 | # first slide 90 | Some content for first slide 91 | 92 | # Second slide 93 | Some content for second slide 94 | 95 | # Third slide 96 | Some content for third slide 97 | 98 | ::: 99 | 100 | ``` 101 | 102 | | 103 |104 | 105 |  106 | 107 | |
Simply type the content of the toggle: | And get that: |
---|---|
120 | 121 | ``` 122 | ::: accordion accordionId 123 | 124 | # first toggle link 125 | Content of the first toggle 126 | 127 | # Second toggle link 128 | Content of the second toggle 129 | 130 | # Third toggle link 131 | Content of the third toggle 132 | 133 | ::: 134 | 135 | ``` 136 | 137 | 138 | | 139 |140 | 141 |  142 | 143 | |
Type simply this: | Get that |
---|---|
156 | 157 | ``` 158 | ::: tabs 159 | 160 | # Choice 1 161 | Some content for first choice 162 | 163 | # Choice 2 164 | Some content for second choice 165 | 166 | # Choice 3 167 | Some content for third choice 168 | 169 | ::: 170 | 171 | ``` 172 | | 173 |174 | 175 |  176 | 177 | |
Type simply this: | Get that |
---|---|
191 | 192 | ``` 193 | ::: info 194 | This is an info alert 195 | ::: 196 | ``` 197 | 198 | | 199 |200 | 201 |  202 | 203 | |
205 | 206 | ``` 207 | ::: danger 208 | This is an danger alert 209 | ::: 210 | ``` 211 | 212 | | 213 |214 | 215 |  216 | 217 | |
Type simply the card content: | Get that |
---|---|
230 | 231 | ``` 232 | ::: card 233 | 234 | ::: header (optional) 235 | text of the header 236 | ::: 237 | 238 | # a title in the body 239 | 240 | Paragraph one of the body 241 | Paragraph two of the body 242 | 243 | :::footer (optional) 244 | text of the footer 245 | ::: 246 | 247 | ::: 248 | 249 | ``` 250 | 251 | | 252 |253 | 254 |  255 | 256 | |
Type simply this: | Get that |
---|---|
270 | 271 | ``` 272 | 273 | You can [Click me](https://github.com/pandoc) 274 | 275 | ``` 276 | 277 | | 278 |279 | 280 |  281 | 282 | |
284 | 285 | ``` 286 | 287 | You can [Click me](https://github.com/pandoc){.success} 288 | 289 | ``` 290 | 291 | | 292 |293 | 294 |  295 | 296 | |
Type simply this: | Get that |
---|---|
308 | 309 | ``` 310 | 311 | [Bootstrap design](https://www.youtube.com/watch?v=Uz7XbIxHf-4) 312 | 313 | ``` 314 | 315 | | 316 |317 | 318 |  319 | 320 | |
Simply type this: | And get that: |
---|---|
331 | 332 | ``` 333 | [](.bi-bootstrap) 334 | ``` 335 | 336 | | 337 |338 | 339 |  340 | 341 | |
Type simply this: | And get that: |
---|---|
378 | 379 | ``` 380 | ::: carousel 381 | 382 | ::: quiz 383 | 384 | # Check your level 385 | 386 | A little quiz for you! 387 | 388 | # Question 1 389 | 390 | * proposition 1 391 | * feedback for proposition 1 392 | * proposition 2 393 | * proposition c 394 | * proposition d 395 | 396 | 397 | # Question 2 398 | 399 | * Prop A 400 | * Prop B 401 | * Prop C 402 | * feedback prop C 403 | * prop D 404 | ::: 405 | 406 | ::: 407 | ``` 408 | 409 | | 410 |411 | 412 |  413 | 414 | |
Discover how some simple markdown can be converted
125 |Here is an implementation with pandoc and Lua filter
127 | Check the projet on Github 128 |Click on the propositions
135 |This is what a jumbotron (bootrap4) or a header (bs5) looks like.
175 |It should be created automatically from the markdown code below.
177 | 178 |
181 | ::: jumbotron
182 | # This is a big header
183 | This is what a jumbotron (bootrap4) or a header (bs5) looks like.
184 |
185 | It should be created automatically from the markdown code below.
186 | :::
187 |
188 |
189 |
190 |
200 |
201 | ::: danger
202 | This is a danger alert
203 | :::
204 |
205 |
206 |
207 |
217 |
218 | ::: info
219 | This is an info alert
220 | :::
221 |
222 |
223 |
224 |
225 | Paragraph one of the body
235 |Paragraph two of the body
236 |
245 |
246 | ::: card
247 |
248 | ::: header (optional)
249 | text of the header
250 | :::
251 |
252 | # a title in the body
253 |
254 | Paragraph one of the body
255 | Paragraph two of the body
256 |
257 | ::: footer (optional)
258 | text of the footer
259 | :::
260 |
261 | :::
262 |
263 |
264 |
265 |
266 |
267 |
315 |
316 | ::: carousel
317 |
318 | # First slide title
319 | Some content for the first slide.
320 |
321 | # Second slide title
322 | Some content for the second slide.
323 |
324 | # Third slide title
325 | Some content for the third slide.
326 |
327 | :::
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
384 |
385 | ::: accordion
386 |
387 | # Accordion Item #1
388 | First accordion content
389 |
390 | # Accordion Item #2
391 | Second accordion content
392 |
393 | # Accordion Item #3
394 | Third accordion content
395 |
396 | :::
397 |
398 |
399 |
400 |
401 |
402 |
403 |
449 |
450 | ::: tabs
451 |
452 | # Linux
453 | ## Support for Linux users
454 | Create a shell script
455 |
456 | # Mac
457 | ## Support for Mac users
458 | Do it with Cmd.
459 |
460 | # Windows
461 | ## Support for windows users
462 | Do it with Ctrl
463 |
464 | :::
465 |
466 |
467 |
468 |
469 |
470 |
471 |
572 | ::: quiz carousel
573 |
574 | # 2 most frequent questions
575 | Earn points for the exam
576 |
577 |
578 | # Which bootstrap component can be swyped?
579 | * Carousel
580 | * Perfect! yes the carousel has controls to swype on mobile and click on desktop.
581 | * Accordion
582 | * Alert
583 | * Carddeck
584 |
585 | # Which language takes indentation very seriously?
586 | * javascript
587 | * Php
588 | * Python
589 | * yes in Python indenting code is very important
590 |
591 |
592 | :::
593 |
594 |
595 |
596 |
597 |
598 |
599 |
600 |
601 | You can Click me
608 | 609 |
611 | [Pandoc repository](https://github.com/pandoc)
612 |
613 |
614 |
615 |
616 | Pandoc repository
617 |
618 |
620 | [Pandoc repository](https://github.com/pandoc){.success}
621 |
622 |
623 |
624 |
625 |
626 | 632 | [Moodle Bootstrap Design](https://www.youtube.com/watch?v=Uz7XbIxHf-4) 633 |
634 | 635 |
649 | {.bi-bootstrap}
650 |
651 |
653 | (.bi-bootstrap)
654 |
655 |
656 |
659 |
660 | []{.bi .bi-bootstrap}
661 |
662 |
663 |
664 |
665 |
666 |
667 |
668 | ')} .. 39 | para.content .. 40 | {pandoc.RawInline('html', '
\nLead text for this header block
120 |Description part for this jumbotron
122 |Lead text for this header block
127 |Description part for this jumbotron
129 |You must do this to be safe
133 |This is an information
136 |This is an information
139 |text of the header
144 |Paragraph one of the body Paragraph two of the body
148 | 151 |First toggle content
171 |Second toggle content
188 |Third toggle content
205 |Earn points for the exam
284 |311 |
318 |
I love with markdown.
349 |