Skip to content

Commit

Permalink
add docs/README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ambrussimon committed Jul 6, 2017
1 parent 6c95637 commit 2d274f0
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
### Updating api-console

1. Run a node container with the core root-dir bind-mounted:

`$ docker run -itv $(pwd):/core -w /core node bash`


2. Install [api-console](https://github.com/mulesoft/api-console)'s recommended [cli build tool](https://github.com/mulesoft/api-console/blob/master/docs/build-tools.md):

`$ npm install -g api-console-cli`


3. Generate "standalone" console into `./docs`:

`$ api-console build https://raw.githubusercontent.com/scitran/core/master/raml/api.raml --output ./docs`

Notes:
* This can take a couple minutes
* The `./docs` folder is recreated in the container
- Owned by root - use `sudo chown -R $USER:$USER docs` on the host
- This readme gets wiped - use `git checkout docs/README.md`


4. Enable branch selection via search & replace in `docs/index.html`:

```javascript
document.querySelector("raml-js-parser").loadApi("https://raw.githubusercontent.com/scitran/core/master/raml/api.raml")
```

```javascript
var url=new URL(location.href);var branch=url.searchParams.get("branch")||"master";document.querySelector("raml-js-parser").loadApi("https://raw.githubusercontent.com/scitran/core/"+branch+"/raml/api.raml")
```

0 comments on commit 2d274f0

Please sign in to comment.