Javascript SDK of WoopChain protocol
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
sdk/docs/README.md

3.1 KiB

Harmony JS-SDK Documentation

CLICK ME!! to see the documentation

metaDocumentation

Summary

The following content demonstrate how to generate our documentation!

Step 1: Generate Documentation

Introduction of TypeDoc

TypeDoc is used to generate HTML

See TypeDoc command line arguments, to understand how to use them.
Using typedoc --help to see them

For example:
typedoc --name <Name> to set the name of header
typedoc --theme <default | minimal | path/to/theme> to set the theme of documation
typedoc --readme <path/to/readme | none> path to readme file that should be displayed on the index page.
typedoc --ignoreCompilerErrors Should TypeDoc generate documentation pages even after the compiler has returned errors?

Install TypeDoc

Local installation (prefered)

$ npm install typedoc --save-dev

Golbal CLI installation

$ npm install --global typedoc

Install Environemnt

$ npm install

Generate HTML

$ cd docs
$ npx typedoc --out ./build ../packages/ --ignoreCompilerErrors --theme default --name Harmony_SDK_Doc --readme ../README.md

See the generated doc at local

open the index.html under the path sdk/docs/build/index.html

Step 2: Deploy on AWS (harmony core only!)

Create an AWS s3 bucket

Actually, there are just two points needed!

  1. Create an AWS S3 bucket, UNCHECK Block all public access
  2. Put the files into the bucket, and set the public permission to Grant public read access to this object(s)

Method 1: Use Console

Here is the documentation of AWS, just follow it!

Don't forget the two points mentioned above

Method 2: Use AWS CLI

Reference: AWS CLI documentation

If you have never used AWS CLI, you need follow these to set up your environment first!

After that, use AWS CLI to do following

  1. Create a Bucket
aws s3 mb s3://harmony-js-sdk-doc
  1. List all buckets you have created
aws s3 ls
  1. Uploade the files into bucket
$ cd build
$ aws s3 cp ./ s3://your-bucket-name --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --recursive

Here is some explanations

./account
the path of folder which we want to upload

s3://harmony-js-sdk-doc
the bucket name on AWS S3

--grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers
Grant read access to all user

--recursive
Command is performed on all files or objects under the specified directory or prefix.

  1. Open the folder in S3 bucket and find index.html, get the Object URL, then make it public!