Skip to content

A Lua Filter to convert directly markdown into bootstrap components (cards, jumbotrons, carousels, accordions) using Pandoc

License

Notifications You must be signed in to change notification settings

fxpar/markdown-to-bootstrap-pandoc-lua-filter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pandoc Lua filter : Markdown To Bootstrap

This pandoc Lua filter converts markdown to Bootstrap components.

Useful for rapidly creating visually attractive Moodle courses

USAGE

pandoc sample.md --lua-filter bootstrap.lua -o expected.html -f markdown+inline_code_attributes

Or with a template to add the bootstrap headers and navbar with Table of content.

pandoc sample.md --lua-filter bootstrap.lua -o result.html --template bs5.template.html -f markdown+inline_code_attributes

COMPONENTS

Header block (jumbotron)

Simply type this: Get that:
::: jumbotron
# Markdown to Bootstrap
Discovert how some simple Mardown can 
be converted

Here is an implementation with pandoc 
and Lua filter
:::

jumbotron

Simple Quiz

Simply type the question and proposals: And get that :
::: quiz
# This is the question?

* First proposition
 * Explanation about first
* Second proposition
* Third proposition
* Fourth proposition
 * Explanation about fourth

:::

jumbotron

Carousel

Type simply the slide content: And get that:
::: carousel carouselId

# first slide
Some content for first slide

# Second slide
Some content for second slide

# Third slide
Some content for third slide

:::

jumbotron

Accordion

Simply type the content of the toggle: And get that:
::: accordion accordionId

# first toggle link
Content of the first toggle

# Second toggle link
Content of the second toggle

# Third toggle link
Content of the third toggle

:::

jumbotron

Tabs

Type simply this: Get that
::: tabs

# Choice 1
Some content for first choice

# Choice 2
Some content for second choice

# Choice 3
Some content for third choice

:::

jumbotron

Alerts

Type simply this: Get that
::: info
This is an info alert
:::

jumbotron

::: danger
This is an danger alert
:::

jumbotron

Cards

Type simply the card content: Get that
::: card

::: header (optional)
text of the header
:::

# a title in the body

Paragraph one of the body
Paragraph two of the body

:::footer (optional)
text of the footer
:::

:::

jumbotron

Buttons

Type simply this: Get that

You can [Click me](https://github.com/pandoc)

jumbotron


You can [Click me](https://github.com/pandoc){.success}

jumbotron

Media link

Type simply this: Get that

[Bootstrap design](https://www.youtube.com/watch?v=Uz7XbIxHf-4)

youtube embed

Icons

Simply type this: And get that:
[](.bi-bootstrap)

jumbotron

Other tools included

This filter comes with a template to include:

  • Table of content for the sidebar

Another filter can be used to insert social network blocks:

ROADMAP

Here is what is already done and which components are planned:

  • Jumbotrons
  • Accordions
  • Alerts
  • Tabs
  • Carousel
  • Buttons
  • Carddeck
  • ButtonGroups
  • Dropdowns
  • YouTube Embeds

Swyping Quiz

Type simply this: And get that:
::: carousel

::: quiz

# Check your level

A little quiz for you!

# Question 1

* proposition 1
  * feedback for proposition 1
* proposition 2
* proposition c
* proposition d

  
# Question 2

* Prop A
* Prop B
* Prop C
  * feedback prop C
* prop D
:::

:::

jumbotron

Creator

François Parlant

Thanks to Tarleb for his helpful answers about Lua on stackoveflow 👍

About

A Lua Filter to convert directly markdown into bootstrap components (cards, jumbotrons, carousels, accordions) using Pandoc

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published