There are two sets of documentation that need to be generated as the software changes: the API documentation and the Usage documentation. The API docs are build from the grader library source code using Sphinx. The usage docs are built from the markdown in the /docs directory using Gitbook.
## Building the API documentation- The first step to building the API documentation is installing Sphinx. The easiest way to do this is to install using pip.
$ pip install sphinx- Change directory to /docs/apidocs/
$ cd docs/apidocs/- Make sure all the relevant grader library modules are listed in the
grader_lib.rst. This is the configuration file that tells sphinx where and how to extract docstrings from the source code. - Generate static html from the source. This will create the static html for the api docs in the directory
_build/html/.
$ make html- Generate a pdf copy of the api docs. This will generate a pdf using latex in the directory _build/latex/. We will move this into the docs/assets directory for use when we build the usage docs.
$ make latexpdf
$ mv _build/latex/SketchResponse.pdf ../assets/SketchResponseAPI.pdf- Checkout the
gh-pagesbranch.
$ git checkout gh-pages- Move the new docs to the top level directory.
$ rsync -a _build/html/ ../..- Commit and push all the modified files.
$ git commit -a -m "informative commit message here"
$ git push- And you are done. Checkout master (or whatever other branch you prefer).
$ git checkout master- The first step in building the usage documentation is installing Gitbook. Gitbook requires NodeJS to install since Gitbook is an npm package. You will also need Calibre installed because we will need
ebook-convertto generate the pdf version of the gitbook. Follow the instructions here to install Calibre and makeebook-convertaccessible on your PATH.
$ npm install gitbook-cli -g- Change directory to the root of the SketchResponse repository.
$ cd ../..- Build the pdf. This will create a pdf copy of the docs in the current direcotry.
$ gitbook pdf ./ ./docs/assets/SketchResponse.pdf- Build the docs. This will create the html in the directory _book.
$ gitbook build- Clone or pull down the lastest copy of the SketchResponse github.io page.
$ cd ..
$ git clone https://github.com/SketchResponse/SketchResponse.github.io.gitor
$ cd ../SketchResponse.github.io
$ git pull- Change back into the sketchresponse directory and copy the new files to the github.io repository.
$ cd ../sketchresponse
$ rsync -a _book/ ../SketchResponse.github.io/- Change directory to the github.io reponsitory, add any new files that were not a part of an older version of the document, commit and push all changes.
$ cd ../SketchResponse.github.io
$ git add <list of files that are new>
$ git commit -a -m "informative commit message here"
$ git push
8. That's it. You are done.