mdio
v0.0.1
Published
A markdown document player
Downloads
3
Maintainers
Readme
mdio
A markdown document player. See example:
Installation
For webpack
$ npm install mdioGetting Started
Markup the content
<div id='mdio'>
# The Three Little Pigs

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

...Speech under the Scene

sentence 1
sentence 2
sentence 3

sentence 4
sentence 5Local Action Optional Settings
Image Scene
 <!-- {...} -->Single Speech
sentence 1 <!-- {"utteranceRate": 0.4} -->Multiple Speech
<!-- block {"utteranceRate": 0.4} -->

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)
utteranceLang: The language of the utterance, SeeSpeechSynthesisUtterance.lang(default:en-US)utteranceRate: The speed of the utterance, SeeSpeechSynthesisUtterance.rate(default:1)utterancePitch: The pitch of the utterance, SeeSpeechSynthesisUtterance.lang(default:1)utteranceVolume: The volume of the utterance, SeeSpeechSynthesisUtterance.rate(default:1)
API
play(callback)
...
pause(callback)
...
stop(callback)
...
forward(callback)
...
backward(callback)
...
