1.0.6 • Published 2 years ago
googledocs-to-html v1.0.6
GoogleDocsToHTML
Installation
Install React (if not available already)
Note: This component is written in React version ^17.0.2
npm i react@^17.0.2 react-dom@^17.0.2
Install GoogleDocsToHTML using npm
npm i googledocs-to-html
Usage
If you get the json object which is the result of Google Docs API and plug into this component, this component will turn it into a HTML page.
Example:
import { GoogleDocsToHTML } from "googledocs-to-html";
export const UsageExample: React.FC<> = () => {
return (
<GoogleDocsToHTML doc={{"body": {
"content": [
{
"endIndex": 1,
"sectionBreak": {
"sectionStyle": {
"columnSeparatorStyle": "NONE",
"contentDirection": "LEFT_TO_RIGHT"
}
}
},
...
}}
/>
)
}
Sample
Static Json sample
Please refer to Static Json Sample
Fetch from API sample
Please refer to Fetch from API Sample
License
googledocs-to-html is under MIT license.