forked from openedx/edx-documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add some developer doc and additional tools
Note that run_tests.sh was reporting an error, however the CI tests were passing. I added an explicit exit command to ensure the build fails if there are any failed projects. I also added an explicit declaration of the shell to the top of run_tests.sh since I run zsh by default, and this script relies on bash specific features. Also added the "sphinx-autobuild" tool and a "develop.sh" script that can be used to run it. It opens up a live HTML server that reloads your documentation every time it is saved, allowing you to preview it every time you save a file.
- Loading branch information
Showing
7 changed files
with
93 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,4 +50,48 @@ Flow`_. | |
.. _GitHub Flow: https://github.com/blog/1557-github-flow-in-the-browser | ||
|
||
All pull requests need approval from edX. For more information, contact edX at | ||
[email protected]. | ||
[email protected]. | ||
|
||
Before submitting a pull request, it is recommend you run the test suite on | ||
your contribution to ensure it can be compiled without errors. | ||
|
||
To run a test compilation of a contribution, first install the prerequisites: | ||
|
||
.. code:: | ||
pip install -r requirements.txt | ||
Then run the tests: | ||
|
||
.. code:: | ||
./run_tests.sh | ||
Additionally, you can run tests for a single project: | ||
|
||
.. code:: | ||
./run_tests.sh en_us/install_operations/ | ||
A convenience script is provided to help you develop new documentation. To use | ||
it you must first install the optional tools, and then run the script. | ||
|
||
.. code:: | ||
pip install -r shared/tools.txt | ||
./develop.sh en_us/install_operations/ | ||
It will output a line of text that looks like this: | ||
|
||
:: | ||
|
||
Serving on http://127.0.0.1:9090 | ||
|
||
You can copy this URL into a web browser to see the HTML output for your | ||
project. | ||
|
||
The command starts an HTTP server that renders the HTML for the project. This | ||
HTTP server also monitors the project and detects any changes. When you save a | ||
change to a file, the server rebuilds the HTML and refreshes your browser | ||
automatically. In this way you can rapidly see how changes you make will be | ||
rendered as HTML. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
# Allows you to preview the HTML for a project "live" in a browser view that updates everytime an ReST file is changed. | ||
|
||
[ $# -eq 0 ] && { echo "Usage: $0 path/to/project [port]"; exit 1; } | ||
|
||
if [ -z "$(which sphinx-autobuild)" ] | ||
then | ||
echo "sphinx-autobuild not found. You can install it with the command 'pip install -r shared/tools.txt'. Exiting." | ||
exit 2 | ||
fi | ||
|
||
project_dir=$1 | ||
port=${2:-9090} | ||
|
||
cd $1 | ||
make html | ||
sphinx-autobuild -b html -d build/doctrees -c source source build/html --port $port |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
shared/travis_requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sphinx-autobuild==0.4.0 |