Skip to content

Commit

Permalink
doc uses external assets
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Goedde committed Aug 10, 2014
1 parent 4bc7de4 commit 211a0f4
Show file tree
Hide file tree
Showing 32 changed files with 318 additions and 2,259 deletions.
2 changes: 2 additions & 0 deletions doc/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
_build
_gen
_upload
_test
_spelling
_static/img/gen
.sconsign.dblite
63 changes: 63 additions & 0 deletions doc/Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,76 @@
all:
@echo "Targets:"
@echo ""
@echo " clean : cleanup build artifacts"
@echo " test : build everything and run locally"
@echo " test_no_network : build everything for no network access and run locally"
@echo " publish : build everything and publish to S3"
@echo " copy : copy over shared files to other AutobahnXXX repos"
@echo " install_deps : install build dependencies"
@echo " spelling : run spell checking"
@echo " doctest : run doctests"
@echo ""

build:
scons

build_no_network:
scons --no_network

test: build
python serve.py --root ./_build --silence

test_no_network: build_no_network
python serve.py --root ./_build --silence

clean:
rm -rf _build
rm -rf _build_uploaded
rm -rf _static/img/gen
rm -rf _test
rm -rf _spelling

publish: clean build
scons publish

doctest:
PYTHONPATH=../autobahn sphinx-build -b doctest -v . _test

copy_makefile:
cp Makefile ../../AutobahnJS/doc/
cp Makefile ../../AutobahnAndroid/doc/
cp Makefile ../../AutobahnCpp/doc/
cp Makefile ../../AutobahnTestsuite/doc/

copy_gitignore:
cp .gitignore ../../AutobahnJS/doc/
cp .gitignore ../../AutobahnAndroid/doc/
cp .gitignore ../../AutobahnCpp/doc/
cp .gitignore ../../AutobahnTestsuite/doc/

copy_serve:
cp serve.py ../../AutobahnJS/doc/
cp serve.py ../../AutobahnAndroid/doc/
cp serve.py ../../AutobahnCpp/doc/
cp serve.py ../../AutobahnTestsuite/doc/

# copy_readme:
# cp README.md ../../AutobahnJS/doc/
# cp README.md ../../AutobahnAndroid/doc/
# cp README.md ../../AutobahnCpp/doc/
# cp README.md ../../AutobahnTestsuite/doc/

copy: copy_makefile copy_gitignore copy_serve

install_deps:
pip install -U scour
pip install -U taschenmesser
#pip install -U scons
pip install -U sphinx
pip install -U sphinx-bootstrap-theme
pip install -U pyenchant
pip install -U sphinxcontrib-spelling
pip install -U repoze.sphinx.autointerface

spelling:
PYTHONPATH=../autobahn sphinx-build -b spelling . _spelling
56 changes: 6 additions & 50 deletions doc/README.md
Original file line number Diff line number Diff line change
@@ -1,61 +1,17 @@
# Documentation

The **Autobahn**|Android documentation is generated using [Sphinx](http://sphinx.pocoo.org/) and the generated documentation is hosted [here](http://autobahn.ws/android).
The documentation is generated using [Sphinx](http://sphinx.pocoo.org/) and the generated documentation is hosted [here](http://autobahn.ws/android).

## Prerequisites

## Generate

You will need to have [SCons](http://scons.org/) installed, plus the following

```sh
pip install taschenmesser
pip install sphinx
pip install sphinx-bootstrap-theme
pip install sphinxcontrib-spelling
pip install repoze.sphinx.autointerface
```

To generate the documentation

```sh
cd doc
scons
```

This will create the documentation under the directory `_build`.


## Test

To build the documentation and start a Web server
```sh
scons test
```

## Clean

To clean up all build artifacts

```sh
scons -uc
```

## Publish

> Note: this section is only relevant for administrators of the [Autobahn web site](http://autobahn.ws/).
Publishing requires a **2 step process**.

**First** do
You will need to have Python and [SCons](http://www.scons.org/) installed. To install the rest of the build dependencies

```sh
scons
make install_deps
```

to build the docs and **second** do
Then, to get help on available build targets, just type

```sh
scons publish
make
```

to actually publish the docs.
30 changes: 18 additions & 12 deletions doc/SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@

## Image file names to process
SVG_FILES = [
"autobahnandroid.svg",
"autobahn.svg"
]

## Directory with image files to process
Expand All @@ -40,6 +38,11 @@ BUCKET = 'autobahn.ws'
## The Bucket Prefix to upload files to
BUCKET_PREFIX = 'android'

## Tavendo shared static assets
CSTATIC = "//tavendo-common-static.s3-eu-west-1.amazonaws.com"
CSTATIC_LOCAL = "http://127.0.0.1:8888"


### END OF CONFIG #############################################################


Expand All @@ -51,6 +54,10 @@ os.environ['PYTHONPATH'] = '../autobahn'

taschenmesser = pkg_resources.resource_filename('taschenmesser', '..')
#taschenmesser = "../../../infrequent/taschenmesser"

AddOption('--no_network', dest = 'no_network', action = 'store_true', default = False,
help = "Run locally and disable anything doing network access")

env = Environment(tools = ['default', 'taschenmesser'],
toolpath = [taschenmesser],
ENV = os.environ)
Expand All @@ -64,7 +71,14 @@ Alias("img", imgs)

## Sphinx Build
##
docs = env.Command(DOCSDIR, [], "sphinx-build -b html . $TARGET")
if GetOption('no_network'):
print("Building for no network")
docs = env.Command(DOCSDIR, [], 'sphinx-build -A no_network=1 -D no_network=1 -A cstatic="{}" -b html . $TARGET'.format(CSTATIC_LOCAL))
else:
docs = env.Command(DOCSDIR, [], 'sphinx-build -A cstatic="{}" -b html . $TARGET'.format(CSTATIC))


# sphinx-build -b spelling . _spelling

env.AlwaysBuild(docs)
Clean(docs, DOCSDIR)
Expand All @@ -73,6 +87,7 @@ Alias("doc", docs)
Default([imgs, docs])



## Upload to Amazon S3
##
uploaded = env.s3_dir_uploader(UPLOADED, DOCSDIR, BUCKET, BUCKET_PREFIX)
Expand All @@ -83,12 +98,3 @@ Depends(uploaded, imgs)
Clean(uploaded, UPLOADED)

Alias("publish", uploaded)


# ## Run a test Web server
# ##
# test = env.Command(None, [imgs, docs], 'twistd.py web -n -p 8080 --path="./_build/"')
# #test = env.Command(None, [imgs, docs], 'python -m SimpleHTTPServer 8080') # cannot set path here =(

# env.AlwaysBuild(test)
# Alias("test", test)
11 changes: 0 additions & 11 deletions doc/_static/css/local.css

This file was deleted.

Loading

0 comments on commit 211a0f4

Please sign in to comment.