Skip to content

Commit

Permalink
Merge pull request #287 from kelsos/documentation
Browse files Browse the repository at this point in the history
Adds automatic documentation generation
  • Loading branch information
kelsos authored Aug 28, 2019
2 parents dfe87e1 + 9fab59e commit 1704724
Show file tree
Hide file tree
Showing 7 changed files with 12,741 additions and 5,702 deletions.
20 changes: 19 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,17 @@ jobs:
paths:
- ./*

generate_documentation:
executor: base-executor
working_directory: *sdk_working_dir
steps:
- attach_workspace: *attach_options
- run: cd ../docs && ./generate_documentation.sh
- persist_to_workspace:
root: ~/src/
paths:
- ./raiden-dapp/dist/docs

deploy_gh_pages:
executor: base-executor
working_directory: *dapp_working_dir
Expand Down Expand Up @@ -164,10 +175,17 @@ workflows:
requires:
- lint_dapp
- build_dapp
- deploy_gh_pages:
- generate_documentation:
requires:
- test_dapp
filters:
branches:
only:
- master
- deploy_gh_pages:
requires:
- generate_documentation
filters:
branches:
only:
- master
17 changes: 17 additions & 0 deletions docs/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const sidebar = require('./api-sidebar');

module.exports = {
title: 'Raiden Light Client SDK',
description: 'API Documentation for the Raiden Light Client SDK',
base: '/docs/',
themeConfig: {
repo: 'raiden-network/light-client',
displayAllHeaders: true,
sidebar: sidebar,
lastUpdated: 'Last Updated',
nav: [
{ text: 'Raiden Network', link: 'https://raiden.network/' },
{ text: 'Developer Portal', link: 'https://developer.raiden.network/' }
]
}
};
28 changes: 28 additions & 0 deletions docs/generate_documentation.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env bash

cd ../raiden-ts

if [[ -d './docs' ]]
then
rm -rf docs
fi

npm run docs:generate

[[ -d 'docs/.vuepress' ]] || mkdir docs/.vuepress
[[ -d 'docs/.vuepress/styles' ]] || mkdir docs/.vuepress/styles

cp ../docs/config.js docs/.vuepress/config.js
cp ../docs/palette.styl docs/.vuepress/styles/palette.styl

npm run docs:build

if [[ ! -d '../raiden-dapp/dist/' ]]
then
echo 'The dApp dist directory was not available'
exit 1;
fi

[[ ! -d '../raiden-dapp/dist/docs' ]] || rm -rf ../raiden-dapp/dist/docs

cp -r docs/.vuepress/dist ../raiden-dapp/dist/docs
1 change: 1 addition & 0 deletions docs/palette.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$accentColor = #28a5c8
1 change: 1 addition & 0 deletions raiden-ts/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ contracts/

*.vim
.localstorage
docs
Loading

0 comments on commit 1704724

Please sign in to comment.