Commit bd92e5ce authored by leswing's avatar leswing
Browse files

Website Update

parent 80428b61
Loading
Loading
Loading
Loading
+15 −14
Original line number Diff line number Diff line
#!/usr/bin/env bash
echo '$TRAVIS_PULL_REQUEST $TRAVIS_BRANCH'
echo $TRAVIS_PULL_REQUEST $TRAVIS_BRANCH

if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
    echo "This is a pull request. No deployment will be done."; exit 0
fi

if [[ "$TRAVIS_BRANCH" != "master" ]]; then
    echo "No deployment on BRANCH='$TRAVIS_BRANCH'"; exit 0
fi

# Create the docs and push them to S3
# -----------------------------------
envname=`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1`
sed -i -- 's/tensorflow$/tensorflow-gpu/g' scripts/install_deepchem_conda.sh
bash scripts/install_deepchem_conda.sh $envname
source activate $envname
python setup.py install

echo "About to install numpydoc, s3cmd"
pip install -I sphinx==1.3.5 sphinx_bootstrap_theme
pip install numpydoc s3cmd msmb_theme sphinx_rtd_theme nbsphinx
conda list -e
pip install numpydoc s3cmd msmb_theme sphinx_rtd_theme nbsphinx delegator.py
conda install -y -q jupyter
conda install -y -q matplotlib

cd examples/notebooks
python ../../devtools/jenkins/convert_to_rst.py
cd ../..

mkdir -p docs/_build
echo "About to build docs"
sphinx-apidoc -f -o docs/source deepchem
@@ -23,4 +24,4 @@ sphinx-build -b html docs/source docs/_build
# Copy 
cp -r docs/_build/ website/docs/
echo "About to push docs to s3"
python devtools/travis-ci/push-docs-to-s3.py
python devtools/jenkins/push-docs-to-s3.py
 No newline at end of file
+35 −0
Original line number Diff line number Diff line
import os
import delegator
import shutil

target_dir = "../../docs/source/notebooks/"


def convert_to_rst(fname):
    cmd = "jupyter-nbconvert --to rst %s" % fname
    c = delegator.run(cmd)

    base_name = os.path.splitext(fname)[0]
    image_files = "%s_files" % base_name
    new_path = os.path.join(target_dir, image_files)
    if os.path.isdir(new_path):
        shutil.rmtree(new_path)
    if os.path.isdir(image_files):
        shutil.move(image_files, target_dir)

    rst_file = '%s.rst' % base_name
    new_path = os.path.join(target_dir, rst_file)
    if os.path.isfile(new_path):
        os.remove(new_path)
    shutil.move(rst_file, target_dir)


def main():
    fnames = os.listdir('./')
    fnames = [x for x in filter(lambda x: x.endswith('ipynb') > 0, fnames)]
    for fname in fnames:
        convert_to_rst(fname)


if __name__ == "__main__":
    main()
+3 −4
Original line number Diff line number Diff line
@@ -34,8 +34,7 @@ sys.path.insert(0, os.path.abspath("../sphinxext"))
extensions = [
    'sphinx.ext.autodoc', 'sphinx.ext.autosummary', 'sphinx.ext.doctest',
    'sphinx.ext.intersphinx', 'sphinx.ext.coverage', 'sphinx.ext.mathjax',
    'sphinx.ext.ifconfig', 'numpydoc', 'sphinx.ext.viewcode',
    'notebook_sphinxext'
    'sphinx.ext.ifconfig', 'numpydoc', 'sphinx.ext.viewcode'
]

autosummary_generate = True
@@ -65,9 +64,9 @@ copyright = u'2016, Stanford University and the Authors'
# built documents.
#
# The short X.Y version.
version = '1.2'
version = '1.3.1'
# The full version, including alpha/beta/rc tags.
release = '1.2'
release = '1.3.1'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.

docs/source/notebooks/BACE.rst

deleted100644 → 0
+0 −4
Original line number Diff line number Diff line
Modeling Inhibitors of BACE-1
=============================

.. notebook:: BACE 
Loading