This project builds the following Balanced documentation:
All contributions, even simple grammar fixes, are greatly appreciated.
- Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug.
- Fork the repository on Github to start making your changes to the develop branch (or branch off of it).
- Send a pull request!
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:
- python 2.7+
- virtualenvwrapper
- bower
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