react-ssml-dom
Advanced tools
Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "react-ssml-dom", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "A proof of concept react host implementation for ssml strings", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
@@ -8,4 +8,58 @@ <h1 align="center"> | ||
## 🌟 Quick Start | ||
## ❓What is this? | ||
Utilize the full power of React to develop voice UIs. ReactSSML provides a simple custom React renderer that let's you use React and JSX to create SSML output. | ||
I wrote a small article about [my motivation](https://medium.com/@andre.timo.landgraf/a-react-renderer-for-ssml-91cdd1d66b3e). | ||
This project is brand new, so if you run into issues or have questions, open up an issue and let me know! Any feedback is highly appreciated. | ||
## 🚀 Installing ReactSSML | ||
Get the package from [npm](https://www.npmjs.com/package/react-ssml-dom). | ||
```bash | ||
npm i react-ssml-dom | ||
``` | ||
Create an App component | ||
```javascript | ||
import React from 'react'; | ||
const App = () => <s>Hello World</s>; | ||
export default App; | ||
``` | ||
Render your App | ||
```javascript | ||
import ReactSMML, { Document, Node } from 'react-ssml-dom'; | ||
// create a document similar to the DOM's document | ||
const ssmlDocument = new Document(); | ||
// create a root node similar to the body in HTML | ||
const root = new Node('speak'); | ||
ssmlDocument.body = root; | ||
ReactSMML.render(<App />, root); | ||
``` | ||
***Done!*** | ||
```javascript | ||
console.log(ssmlDocument.toString()) | ||
``` | ||
```html | ||
<speak> | ||
<s>Hello World!</s> | ||
</speak> | ||
``` | ||
## 🌟 Next steps | ||
***Clone this repo and play around with the demo application*** | ||
Get the source code | ||
@@ -28,3 +82,3 @@ | ||
> react-ssml@1.0.0 start:demo /Users/anlandg/workspaces/react-ssml | ||
> react-ssml@1.0.2 start:demo /react-ssml | ||
> node dist/main.js | ||
@@ -40,3 +94,3 @@ | ||
```bash | ||
curl -X POST http://localhost:8080/api/login/ | ||
curl -X POST http://localhost:8888 | ||
``` | ||
@@ -43,0 +97,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2033221
117