Skip to content

Commit

Permalink
[Docs] Move file_pattern option from Makefile to conf.py (dmlc#352)
Browse files Browse the repository at this point in the history
* add rtfd

* rrr

* update

* change env

* temp fix

* update

* fix

* fix

* add

* conf

* Move file_pattern from Makefile to conf.py

* remove yml

* fix

* fix

* fix

* fix

* remove yml

* remove yml

* add doc docker

* add dgl install script

* change name

* change dockerfile

* fix

* name

* add

* fix

* fix

* fix

* fix

* add doc-build files

* remove unnecessary import os
  • Loading branch information
VoVAllen authored and jermainewang committed Jan 12, 2019
1 parent ddc2faa commit 19e1b14
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
6 changes: 2 additions & 4 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,15 @@ mxnet:
@echo "# Step 1: Building MXNet tutorials #"
@echo "# #"
@echo "##################################################################"
@DGLBACKEND=mxnet $(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \
-D sphinx_gallery_conf.filename_pattern="/*(?<=mx)\.py"
@DGLBACKEND=mxnet $(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

pytorch:
@echo "##################################################################"
@echo "# #"
@echo "# Step 2: Building PyTorch tutorials #"
@echo "# #"
@echo "##################################################################"
@DGLBACKEND=pytorch $(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \
-D sphinx_gallery_conf.filename_pattern="/*(?<!mx)\.py"
@DGLBACKEND=pytorch $(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

html-noexec:
$(SPHINXBUILD) -D plot_gallery=0 -b html "$(SOURCEDIR)" "$(BUILDDIR)/html"
Expand Down
6 changes: 6 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,3 +213,9 @@
'filename_pattern' : '.py',
'download_all_examples' : False,
}

# Compatibility for different backend when builds tutorials
if os.environ['DGLBACKEND'] == 'mxnet':
sphinx_gallery_conf['filename_pattern'] = "/*(?<=mx)\.py"
if os.environ['DGLBACKEND'] == 'pytorch':
sphinx_gallery_conf['filename_pattern'] = "/*(?<!mx)\.py"
9 changes: 9 additions & 0 deletions readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
build:
image: latest

formats: []

python:
version: 3.6
use_system_site_packages: true
setup_py_install: false

0 comments on commit 19e1b14

Please sign in to comment.