Wen Zhang
4217f89fdf
|
5 years ago | |
---|---|---|
.. | ||
README.md | 5 years ago |
README.md
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.
Usingtypedoc --help
to see themFor 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 pathsdk/docs/build/index.html
Step 2: Deploy on AWS (harmony core only!)
Create an AWS s3 bucket
Actually, there are just two points needed!
- Create an AWS S3 bucket, UNCHECK
Block all public access
- 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
- Create a Bucket
aws s3 mb s3://harmony-js-sdk-doc
- List all buckets you have created
aws s3 ls
- 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 uploads3://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.
- Open the folder in S3 bucket and find
index.html
, get theObject URL
, then make it public!