Presentation of “Markdown-Processor”

Today, we won’t speak about a open source tool or talk about how to do something.

Today, I’m proud to present you a personal project: “Markdown-Processor”

Presentation

What is Markdown-Processor ?

Markdown-Processor is a npm CLI to h…


This content originally appeared on DEV Community and was authored by Maxime Guilbert

Today, we won't speak about a open source tool or talk about how to do something.

Today, I'm proud to present you a personal project: "Markdown-Processor"

Presentation

What is Markdown-Processor ?

Markdown-Processor is a npm CLI to help you to generate HTML or PDF from Markdown files.

Why creating a new CLI to do it?

For two reasons :

  • to be extensible
  • to be able to choose a theme!

To be extensible

One thing I really want is to be able to add elements if needed. (Like liquid tags or completly new tags) You will see later that I already have one extension applied.

To be able to choose a theme

Depending if you are working, writing a book, writing some notes for your next tabletop rpg session..., you may need a specific theme.

So here it is! Currently, 3 themes are available :

  • default
  • dark
  • rpg

And you already can create and use yours!

If you want to add your theme to the project, don't hesitate to do a Pull Request! ?

Demo

Setup

First, you need to install it with the following command

npm i markdown-processor

If you want to generate some PDF files, install pagedjs and pagedjs-cli too.

npm install -g pagedjs-cli pagedjs

Commands

Process the TEST.md process (by default it will be an HTML file with a timestamped name)

md-processor process -f "TEST.md"

Process multiple files

md-processor process -f "TEST.md" -f "TEST2.md"

Use a specific theme

md-processor process -f "TEST.md" -t "rpg"

Create a pdf file

md-processor process -f "TEST.md" -t "rpg" -o pdf

Extensions

Here is the first extension that we have : Have differents styles of blockquotes

If it's a classic message, an info, an alert or a warning, I don't want to have exactly the same display. So, with a simple element on the first line, we are now able to have more customizations available.

Normal

> Normal

blockquote normal

Info

> **[INFO]**
> Info

blockquote info

Warning

> **[WARNING]**
> Warning

blockquote warning

Alert

> **[ALERT]**
> Alert

blockquote alert

I hope you enjoyed this quick presentation. ?

You need to know that I haven't talked about all the options available (add a table of content, process a full folder of markdown files...) and a lot of other elements will come.

So if you want to have other posts to describe all the functionalities, please leave a comment to let me know.

Links


This content originally appeared on DEV Community and was authored by Maxime Guilbert


Print Share Comment Cite Upload Translate Updates
APA

Maxime Guilbert | Sciencx (2021-08-17T11:12:03+00:00) Presentation of “Markdown-Processor”. Retrieved from https://www.scien.cx/2021/08/17/presentation-of-markdown-processor/

MLA
" » Presentation of “Markdown-Processor”." Maxime Guilbert | Sciencx - Tuesday August 17, 2021, https://www.scien.cx/2021/08/17/presentation-of-markdown-processor/
HARVARD
Maxime Guilbert | Sciencx Tuesday August 17, 2021 » Presentation of “Markdown-Processor”., viewed ,<https://www.scien.cx/2021/08/17/presentation-of-markdown-processor/>
VANCOUVER
Maxime Guilbert | Sciencx - » Presentation of “Markdown-Processor”. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/08/17/presentation-of-markdown-processor/
CHICAGO
" » Presentation of “Markdown-Processor”." Maxime Guilbert | Sciencx - Accessed . https://www.scien.cx/2021/08/17/presentation-of-markdown-processor/
IEEE
" » Presentation of “Markdown-Processor”." Maxime Guilbert | Sciencx [Online]. Available: https://www.scien.cx/2021/08/17/presentation-of-markdown-processor/. [Accessed: ]
rf:citation
» Presentation of “Markdown-Processor” | Maxime Guilbert | Sciencx | https://www.scien.cx/2021/08/17/presentation-of-markdown-processor/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.