Skip to content

Commit

Permalink
Website Update
Browse files Browse the repository at this point in the history
  • Loading branch information
leswing authored and leswing committed Nov 8, 2017
1 parent 80428b6 commit bd92e5c
Show file tree
Hide file tree
Showing 24 changed files with 211 additions and 345 deletions.
27 changes: 27 additions & 0 deletions devtools/jenkins/build_and_upload_docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash
# 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 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
sphinx-build -b html docs/source docs/_build
# Copy
cp -r docs/_build/ website/docs/
echo "About to push docs to s3"
python devtools/jenkins/push-docs-to-s3.py
35 changes: 35 additions & 0 deletions devtools/jenkins/convert_to_rst.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
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()
File renamed without changes.
26 changes: 0 additions & 26 deletions devtools/travis-ci/after_sucess.sh

This file was deleted.

7 changes: 3 additions & 4 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@
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
Expand Down Expand Up @@ -65,9 +64,9 @@
# 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.
Expand Down
4 changes: 0 additions & 4 deletions docs/source/notebooks/BACE.rst

This file was deleted.

4 changes: 0 additions & 4 deletions docs/source/notebooks/Multitask_Networks_on_MUV.rst

This file was deleted.

4 changes: 0 additions & 4 deletions docs/source/notebooks/dataset_preparation.rst

This file was deleted.

This file was deleted.

35 changes: 0 additions & 35 deletions docs/source/notebooks/index.rst

This file was deleted.

4 changes: 0 additions & 4 deletions docs/source/notebooks/mnist.rst

This file was deleted.

Loading

0 comments on commit bd92e5c

Please sign in to comment.