Getting Started with Docs
Prerequisites
You're going to need:
- Linux or macOS — Windows may work, but is unsupported.
- Ruby, version 2.3.1 or newer
- (for macOS) You can use Homebrew as the 1st step to install Ruby
- After Homebrew is installed, install Ruby in the terminal with commans
brew install ruby
- Close the current terminal and reopen a new one to proceed with installing bundler.
- Bundler — If Ruby is already installed, but the
bundle
command doesn't work, just run gem install bundler
in a terminal.
Getting Set Up
-
Clone repository to your hard drive with git clone git@github.com:PlatformOfTrust/docs.git
- in macOS, You may need to add a pair of public public/private ssh keys to your SSH agent, if you get the following message in the terminal:
Warning: Permanently added the RSA host key for IP address '<YOUR IP ADDRESS>' to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.
Follow these instructions to generate the SSH key pairs. Follow these instructions to add them in your GitHub user account
Please make sure you have the correct access rights
and the repository exists.
-
cd docs
-
Initialize and start Platform of Trust API Docs:
bundle install
bundle exec middleman server
You can now see the docs at http://localhost:4567.
Rebuild API Docs
The current documentation is fully automated at the moment (except writing the code examples).
build needed tools:
- cd raml2markdown
- npm install
- rm -rf ./oas-raml-converter
- git clone https://github.com/mulesoft/oas-raml-converter.git
- cd oas-raml-converter
- npm install
- npm run build
build the docs:
- Just add RAML to specific folder (https://github.com/PlatformOfTrust/docs/tree/master/raml2markdown/src),
- Generate code examples (https://github.com/PlatformOfTrust/code-examples-generator/tree/master/doc)
- Validate code examples (https://github.com/PlatformOfTrust/code-examples-validator)
- Set generated code examples path e.g.
export CODE_EXAMPLES="../code-examples"
- then run
build.py
and
- new docs is generated to https://github.com/PlatformOfTrust/docs/tree/master/build