1.0.24 • Published 3 years ago

@presenta/md2pjson v1.0.24

Weekly downloads
37
License
BSD-3-Clause
Repository
-
Last release
3 years ago

Markdown to PRESENTA JSON

npm.io

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

1.0.22

3 years ago

1.0.21

3 years ago

1.0.24

3 years ago

1.0.23

3 years ago

1.0.20

3 years ago

1.0.19

3 years ago

1.0.18

3 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago