Skip to content

Commit aef600c

Browse files
authored
Merge pull request #143 from vidartf/docs
Added docs with embedded widgets for a selection of examples
2 parents 5f92aeb + 43eaa02 commit aef600c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+5425
-195
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,18 @@ pythreejs/static/
1515

1616
# Autogen files
1717
*_autogen.py
18+
*_autogen.rst
1819
*.autogen.js
1920
*.autogen.json
2021
js/src/**/index.js
2122
pythreejs/**/__init__.py
23+
docs/source/api/**/index.rst
2224

2325
# Test and coverage
2426
.coverage
2527
.cache
2628
htmlcov/
2729

2830

31+
docs/source/_static/jupyter-threejs.js
32+
docs/source/_static/three.js

.travis.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
language: python
22
python:
3+
- 3.6
34
- 3.5
45
- 3.4
56
- 2.7
67
sudo: false
8+
env:
9+
matrix:
10+
- GROUP=python
11+
matrix:
12+
include:
13+
- python: 3.5
14+
env: GROUP=docs
715
cache:
816
pip: true
917
directories:
@@ -12,7 +20,16 @@ before_install:
1220
- pip install -U pip setuptools
1321
- nvm install 6
1422
install:
15-
- pip install --upgrade -e ".[test, examples]"
23+
- pip install --upgrade -e ".[test, examples, docs]"
1624
script:
17-
- py.test -l --nbval-lax --current-env examples
18-
- python -m pytest_check_links
25+
- if [[ $GROUP == python ]]; then
26+
py.test -l --nbval-lax --current-env examples;
27+
elif [[ $GROUP == docs ]]; then
28+
EXIT_STATUS=0
29+
cd docs
30+
make html || EXIT_STATUS=$?
31+
make linkcheck || EXIT_STATUS=$?
32+
cd ..
33+
python -m pytest_check_links || EXIT_STATUS=$?
34+
exit $EXIT_STATUS;
35+
fi

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS =
6+
SPHINXBUILD = sphinx-build
7+
SPHINXPROJ = pythreejs
8+
SOURCEDIR = source
9+
BUILDDIR = build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/environment.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
name: pythreejs_docs
3+
channels:
4+
- conda-forge
5+
dependencies:
6+
- python=3.5
7+
- nodejs
8+
- numpy
9+
- scipy
10+
- matplotlib
11+
- scikit-image
12+
- sphinx
13+
- nbsphinx
14+
- jupyter_sphinx

docs/make.bat

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=source
11+
set BUILDDIR=build
12+
set SPHINXPROJ=pythreejs
13+
14+
if "%1" == "" goto help
15+
16+
%SPHINXBUILD% >NUL 2>NUL
17+
if errorlevel 9009 (
18+
echo.
19+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
20+
echo.installed, then set the SPHINXBUILD environment variable to point
21+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
22+
echo.may add the Sphinx directory to PATH.
23+
echo.
24+
echo.If you don't have Sphinx installed, grab it from
25+
echo.http://sphinx-doc.org/
26+
exit /b 1
27+
)
28+
29+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
30+
goto end
31+
32+
:help
33+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
34+
35+
:end
36+
popd

docs/source/_static/helper.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
var cache_require = window.require;
2+
3+
window.addEventListener('load', function() {
4+
window.require = cache_require;
5+
});

docs/source/api/_base/Preview.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
.. py:currentmodule:: pythreejs
3+
4+
Preview
5+
====================================================
6+
7+
.. autohastraits:: Preview
8+
:members:
9+
:undoc-members:
10+
:show-inheritance:

docs/source/api/_base/Renderable.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
.. py:currentmodule:: pythreejs
3+
4+
RenderableWidget
5+
====================================================
6+
7+
.. autoclass:: RenderableWidget
8+
:members:
9+
:undoc-members:
10+
:show-inheritance:

docs/source/api/_base/Three.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
.. py:currentmodule:: pythreejs
3+
4+
ThreeWidget
5+
====================================================
6+
7+
.. autoclass:: ThreeWidget
8+
:members:
9+
:undoc-members:
10+
:show-inheritance:

docs/source/api/traits.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
3+
======
4+
traits
5+
======
6+
7+
.. py:currentmodule:: pythreejs
8+
9+
.. automodule:: pythreejs.traits
10+
:members:
11+
:undoc-members:

0 commit comments

Comments
 (0)