Skip to content

A javascript library that converts from markdown to an opinionated PRESENTA config object.

License

Notifications You must be signed in to change notification settings

presenta-software/md2pjson

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Markdown to PRESENTA JSON

This library converts from markdown to an opinionated PRESENTA config object.

A quick example here.

Usage

Parse a raw markdown string to get a JSON object:

md2pjson.parse(md)

Get the index of the scene passing the line number of the raw markdown:

const index = md2pjson.findIndex(res, 7)

Get the lines range in the raw markdown passing the index of the scene:

const range = md2pjson.findRange(res, 1)

Change the separators string used for both the scenes and fragments, before parsing:

md2pjson.setting.sceneSeparator = '---'
md2pjson.setting.fragmentSeparator = '–'

The library parses the HTML comments as scene and block properties:

<!--
textVar: section
colorBack: red
-->

# hello 

Also, you can create blocks using this notation:

# hello

```youtube
url: YTcodeID
```  

The above chunk creates a scene with two blocks, the first one is a text block, the last one a youtube block.

This library understands a subset of emoji shortcodes, such as:

# Hello! :heart:

Development

Run the watcher:

npm start

and the local webserver

npm run test

Licence

This plugin is released under the 3-Clause BSD license.

Copyright © 2020 Fabio Franchino, https://fabiofranchino.com

About

A javascript library that converts from markdown to an opinionated PRESENTA config object.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published