1.0.24 • Published 4 years ago

@presenta/md2pjson v1.0.24

Weekly downloads
37
License
BSD-3-Clause
Repository
-
Last release
4 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

4 years ago

1.0.21

4 years ago

1.0.24

4 years ago

1.0.23

4 years ago

1.0.20

4 years ago

1.0.19

4 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago