googledocs-to-html

1.0.6 • Public • Published

GoogleDocsToHTML

Installation

  1. 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
    
    
  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

  1. Static Json sample

    Please refer to Static Json Sample

  2. Fetch from API sample

    Please refer to Fetch from API Sample

License

googledocs-to-html is under MIT license.

Package Sidebar

Install

npm i googledocs-to-html

Weekly Downloads

1

Version

1.0.6

License

MIT

Unpacked Size

45.2 kB

Total Files

7

Last publish

Collaborators

  • yejin_ho