This project builds the following Balanced documentation:
All contributions, even simple grammar fixes, are greatly appreciated.
Make sure to add yourself to CONTRIBUTORS
. We will showcase the CONTRIBUTORS
file on our
COMMUNITY PAGE.
After your pull request, email support [@] balancedpayments.com with your address and the link to your pull request with your address and your t-shirt size so we can send you your very own Balanced t-shirt!
You'll first need:
And then you can setup your environment like this:
git clone git@github.com:balanced/balanced-docs.git
cd balanced-docs
git submodule update --init --recursive --remote
mkvirtualenv balanced-docs
python setup.py develop
pip install -r requirements.txt
If you've done that before just do:
cd /path/to/balanced-docs
workon balanced-docs
git submodule update --init --recursive --remote
Now that your environment is setup, let's build the documentation. To build them all at once do:
make all
To build the specification do:
make spec
To build the overview do:
make overview
To build the reference do:
make api
Let's take a look at what we've built using mongoose:
cd build
mongoose
// Mongoose web server v. 3.8 started on port(s) 8080 with web root [.]
Open up http://localhost:8080/spec
Open up http://localhost:8080/overview.shtml
Open up http://localhost:8080/api.shtml
All of the documentation is written in r(e)S(tructured)T(ext) which you can read about here.
We've added a custom rST directive called dcode
which uses external scripts to
generate rST content. For example:
.. dcode:: scenario credit_create_new_bank_account
Here we are asking dcode
to run the credit_create_new_bank_account
. The
output for that scenario
will end up in place of the directive.
You'll also see a corresponding dcode-default
directive. For example:
.. dcode-default:: scenario
:script: ../scenario.py -d ../scenarios -c scenario.cache
:section-chars: ~^
:lang: ruby
Which registers an external script for scenario
. As a result the dcode
directive above will result in this call:
../scenario.py -d ../scenarios -c scenario.cache credit_create_new_bank_account --lang ruby
scripts/lang-scenario.py -d clients/{REVISION}/curl hold_create
Field descriptions are from balanced.rev1.json, which are generated from balanced-api. The "forms" used in balanced-docs are assembled from parameters supplied in the scenarios in balanced-api. Those scenarios should be updated to include the fields missing the specific scenario section and a newly generated balanced.rev1.json be committed into the docs. To generate balanced.rev1.json in balanced-api run:
bundle exec rake features:all
DO NOT run
bundle exec rake parallel:features
doing so causes the file to overwrite itself.