Skip to content

wonderchang/mdio

Repository files navigation

mdio

Build Status

A markdown document player. See example:

Installation

For webpack

$ npm install mdio

Getting Started

Markup the content

<div id='mdio'>
  # The Three Little Pigs

  ![cover](http://homepages.uni-paderborn.de/odenbach/wwwmath/pics/pigs/pig2.jpg)
  Once upon a time there was a mother pig who had three little pigs.
  The three little pigs grew so big that their mother said to them,
  ...
</div>

Setup the player

const mdio = Mdio({
  selector: '#mdio',
  utteranceLang: 'en-US'
})

Markup Instructions

Title and Cover

The title should be the 1st token with heading1. And the cover should be the 2nd token which is the image type with 'cover' alt.

# This is the title

![cover](image-url)

...

Speech under the Scene

![image-alt1](image-url-1)    
sentence 1
sentence 2
sentence 3

![image-alt2](image-url-2)
sentence 4
sentence 5

Local Action Optional Settings

Image Scene

![image-alt1](image-url-1) <!-- {...} -->

Single Speech

sentence 1 <!-- {"utteranceRate": 0.4} -->

Multiple Speech

<!-- block {"utteranceRate": 0.4} -->
![image-alt1](image-url-1)
sentence 1
sentence 2
sentence 3
<!-- endblock -->

Avaliable Options

  • selector: the CSS selector for refering the element which the player will be set to. (default: #mdio)

API

play(callback)

...

pause(callback)

...

stop(callback)

...

forward(callback)

...

backward(callback)

...

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published