11[ ![ TypeScript version] [ ts-badge ]] [ typescript-34 ]
22[ ![ Node.js version] [ nodejs-badge ]] [ nodejs ]
3- [ ![ MIT] [ license-badge ]] [ LICENSE ]
3+ [ ![ MIT] [ license-badge ]] [ license ]
44
55# speechmarkdown-js
66
77Speech Markdown grammar, parser, and formatters for use with JavaScript.
88
99Supported platforms:
10- * amazon-alexa
11- * amazon-polly
12- * amazon-polly-neural
13- * google-assistant
14- * microsoft-azure
15- * samsung-bixby
1610
11+ - amazon-alexa
12+ - amazon-polly
13+ - amazon-polly-neural
14+ - google-assistant
15+ - microsoft-azure
16+ - samsung-bixby
1717
1818Find the architecture [ here] ( ./docs/architecture.md )
1919
20-
2120## Quick start
2221
2322### SSML - Amazon Alexa
23+
2424Convert Speech Markdown to SSML for Amazon Alexa
2525
2626``` js
2727const smd = require (' speechmarkdown-js' );
2828
2929const markdown = ` Sample [3s] speech [250ms] markdown` ;
3030const options = {
31- platform: ' amazon-alexa'
31+ platform: ' amazon-alexa' ,
3232};
3333
3434const speech = new smd.SpeechMarkdown ();
@@ -43,16 +43,16 @@ Sample <break time="3s"/> speech <break time="250ms"/> markdown
4343</speak >
4444```
4545
46-
4746### SSML - Google Assistant
47+
4848Convert Speech Markdown to SSML for Google Assistant
4949
5050``` js
5151const smd = require (' speechmarkdown-js' );
5252
5353const markdown = ` Sample [3s] speech [250ms] markdown` ;
5454const options = {
55- platform: ' google-assistant'
55+ platform: ' google-assistant' ,
5656};
5757
5858const speech = new smd.SpeechMarkdown ();
@@ -67,8 +67,8 @@ Sample <break time="3s"/> speech <break time="250ms"/> markdown
6767</speak >
6868```
6969
70-
7170### Plain Text
71+
7272Convert Speech Markdown to Plain Text
7373
7474``` js
@@ -92,26 +92,27 @@ Sample speech markdown
9292### Options
9393
9494You can pass ` options ` into the constructor:
95+
9596``` js
9697const smd = require (' speechmarkdown-js' );
9798
9899const markdown = ` Sample [3s] speech [250ms] markdown` ;
99100const options = {
100- platform: ' amazon-alexa'
101+ platform: ' amazon-alexa' ,
101102};
102103
103104const speech = new smd.SpeechMarkdown (options);
104105const ssml = speech .toSSML (markdown);
105106```
106107
107-
108108Or in the methods ` toSSML ` and ` toText ` :
109+
109110``` js
110111const smd = require (' speechmarkdown-js' );
111112
112113const markdown = ` Sample [3s] speech [250ms] markdown` ;
113114const options = {
114- platform: ' amazon-alexa'
115+ platform: ' amazon-alexa' ,
115116};
116117
117118const speech = new smd.SpeechMarkdown ();
@@ -120,120 +121,123 @@ const ssml = speech.toSSML(markdown, options);
120121
121122Available options are:
122123
123- * ` platform ` (string) - Determines the formatter to use to render SSML. Valid values are:
124- * "amazon-alexa"
125- * "amazon-polly"
126- * "amazon-polly-neural"
127- * "google-assistant"
128- * "microsoft-azure"
129- * "samsung-bixby"
124+ - ` platform ` (string) - Determines the formatter to use to render SSML. Valid values are:
130125
131- * ` includeFormatterComment ` (boolean) - Adds an XML comment to the SSML output indicating the formatter used. Default is ` false ` .
126+ - "amazon-alexa"
127+ - "amazon-polly"
128+ - "amazon-polly-neural"
129+ - "google-assistant"
130+ - "microsoft-azure"
131+ - "samsung-bixby"
132132
133- * ` includeSpeakTag ` (boolean) - Determines if the ` <speak> ` tag will be rendered in the SSML output . Default is ` true ` .
133+ - ` includeFormatterComment ` (boolean) - Adds an XML comment to the SSML output indicating the formatter used . Default is ` false ` .
134134
135- * ` includeParagraphTag ` (boolean) - Determines if the ` <p > ` tag will be rendered in the SSML output. Default is ` false ` .
135+ - ` includeSpeakTag ` (boolean) - Determines if the ` <speak > ` tag will be rendered in the SSML output. Default is ` true ` .
136136
137- * ` preserveEmptyLines ` (boolean) - keep empty lines in markdown in SSML. Default is ` true ` .
137+ - ` includeParagraphTag ` (boolean) - Determines if the ` <p> ` tag will be rendered in the SSML output . Default is ` false ` .
138138
139- * ` escapeXmlSymbols ` (boolean) - Currently only for ` amazon-alexa ` . Escape XML text . Default is ` false ` .
139+ - ` preserveEmptyLines ` (boolean) - keep empty lines in markdown in SSML . Default is ` true ` .
140140
141- * ` voices ` (object ) - give custom names to voices and use that in your markdown:
141+ - ` escapeXmlSymbols ` (boolean ) - Currently only for ` amazon-alexa ` . Escape XML text. Default is ` false ` .
142142
143- ``` json
144- {
145- "platform" : " amazon-alexa" ,
146- "voices" : {
147- "Scott" : {"voice" : {"name" : " Brian" }},
148- "Sarah" : {"voice" : {"name" : " Kendra" }}
149- }
143+ - ` voices ` (object) - give custom names to voices and use that in your markdown:
144+
145+ ``` json
146+ {
147+ "platform" : " amazon-alexa" ,
148+ "voices" : {
149+ "Scott" : { "voice" : { "name" : " Brian" } },
150+ "Sarah" : { "voice" : { "name" : " Kendra" } }
150151 }
151- ```
152-
153- ```json
154- {
155- "platform" : " google-assistant" ,
156- "voices" : {
157- "Brian" : {"voice" : {"gender" : " male" , "variant" : 1 , "language" : " en-US" }},
158- "Sarah" : {"voice" : {"gender" : " female" , "variant" : 3 , "language" : " en-US" }},
159- }
152+ }
153+ ```
154+
155+ ``` json
156+ {
157+ "platform" : " google-assistant" ,
158+ "voices" : {
159+ "Brian" : {
160+ "voice" : { "gender" : " male" , "variant" : 1 , "language" : " en-US" }
161+ },
162+ "Sarah" : {
163+ "voice" : { "gender" : " female" , "variant" : 3 , "language" : " en-US" }
164+ }
160165 }
161- ```
162-
166+ }
167+ ```
163168
164169## Working on this project?
165170
166171### Grammar
172+
167173The biggest place we need help right now is with the completion of the grammar and formatters.
168174
169175#### Short Format
170176
171- * [x] break
172- * [x] emphasis - strong
173- * [x] emphasis - moderate
174- * [x] emphasis - none
175- * [x] emphasis - reduced
176- * [ ] ipa
177- * [ ] sub
177+ - [x] break
178+ - [x] emphasis - strong
179+ - [x] emphasis - moderate
180+ - [x] emphasis - none
181+ - [x] emphasis - reduced
182+ - [ ] ipa
183+ - [ ] sub
178184
179185#### Standard Format
180186
181- * [x] address
182- * [x] audio
183- * [x] break (time)
184- * [x] break (strength)
185- * [x] characters / chars
186- * [x] date
187- * [x] defaults (section)
188- * [x] disappointed
189- * [x] disappointed (section)
190- * [x] dj (section)
191- * [x] emphasis
192- * [x] excited
193- * [x] excited (section)
194- * [x] expletive / bleep
195- * [x] fraction
196- * [x] interjection
197- * [x] ipa
198- * [x] lang
199- * [x] lang (section)
200- * [x] mark
201- * [x] newscaster (section)
202- * [x] number
203- * [x] ordinal
204- * [x] telephone / phone
205- * [x] pitch
206- * [x] rate
207- * [x] sub
208- * [x] time
209- * [x] unit
210- * [x] voice
211- * [x] voice (section)
212- * [x] volume / vol
213- * [x] whisper
187+ - [x] address
188+ - [x] audio
189+ - [x] break (time)
190+ - [x] break (strength)
191+ - [x] characters / chars
192+ - [x] date
193+ - [x] defaults (section)
194+ - [x] disappointed
195+ - [x] disappointed (section)
196+ - [x] dj (section)
197+ - [x] emphasis
198+ - [x] excited
199+ - [x] excited (section)
200+ - [x] expletive / bleep
201+ - [x] fraction
202+ - [x] interjection
203+ - [x] ipa
204+ - [x] lang
205+ - [x] lang (section)
206+ - [x] mark
207+ - [x] newscaster (section)
208+ - [x] number
209+ - [x] ordinal
210+ - [x] telephone / phone
211+ - [x] pitch
212+ - [x] rate
213+ - [x] sub
214+ - [x] time
215+ - [x] unit
216+ - [x] voice
217+ - [x] voice (section)
218+ - [x] volume / vol
219+ - [x] whisper
214220
215221### Available scripts
216222
217- + `clean` - remove coverage data, Jest cache and transpiled files,
218- + `build` - transpile TypeScript to ES5,
219- + `build:browser` - creates single file `./dist.browser/speechmarkdown.js` file for use in browser,
220- + `build:minify` - creates single file `./dist.browser/speechmarkdown.min.js` file for use in browser,
221- + `build:watch` - interactive watch mode to automatically transpile source files,
222- + `lint` - lint source files and tests,
223- + `test` - run tests,
224- + `test:watch` - interactive watch mode to automatically re-run tests
225-
226-
223+ - ` clean ` - remove coverage data, Jest cache and transpiled files,
224+ - ` build ` - perform all build tasks
225+ - ` build:ts ` - transpile TypeScript to ES5
226+ - ` build:browser ` - creates single file ` ./dist.browser/speechmarkdown.js ` file for use in browser,
227+ - ` build:minify ` - creates single file ` ./dist.browser/speechmarkdown.min.js ` file for use in browser,
228+ - ` watch ` - interactive watch mode to automatically transpile source files,
229+ - ` lint ` - lint source files and tests,
230+ - ` test ` - run tests,
231+ - ` test:watch ` - interactive watch mode to automatically re-run tests
227232
228233## License
234+
229235Licensed under the MIT. See the [ LICENSE] ( https://github.com/speechmarkdown/speechmarkdown-js/blob/master/LICENSE ) file for details.
230236
231237[ ts-badge ] : https://img.shields.io/badge/TypeScript-3.4-blue.svg
232238[ typescript ] : https://www.typescriptlang.org/
233239[ typescript-34 ] : https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-4.html
234-
235240[ nodejs-badge ] : https://img.shields.io/badge/Node.js->=%2010.13-blue.svg
236241[ nodejs ] : https://nodejs.org/dist/latest-v10.x/docs/api/
237-
238242[ license-badge ] : https://img.shields.io/badge/license-MIT-blue.svg
239243[ license ] : https://github.com/speechmarkdown/speechmarkdown-js/blob/master/LICENSE
0 commit comments