Skip to content

Commit 19e1b14

Browse files
VoVAllenjermainewang
authored andcommitted
[Docs] Move file_pattern option from Makefile to conf.py (#352)
* 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
1 parent ddc2faa commit 19e1b14

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

docs/Makefile

+2-4
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,15 @@ mxnet:
1919
@echo "# Step 1: Building MXNet tutorials #"
2020
@echo "# #"
2121
@echo "##################################################################"
22-
@DGLBACKEND=mxnet $(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \
23-
-D sphinx_gallery_conf.filename_pattern="/*(?<=mx)\.py"
22+
@DGLBACKEND=mxnet $(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
2423

2524
pytorch:
2625
@echo "##################################################################"
2726
@echo "# #"
2827
@echo "# Step 2: Building PyTorch tutorials #"
2928
@echo "# #"
3029
@echo "##################################################################"
31-
@DGLBACKEND=pytorch $(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \
32-
-D sphinx_gallery_conf.filename_pattern="/*(?<!mx)\.py"
30+
@DGLBACKEND=pytorch $(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
3331

3432
html-noexec:
3533
$(SPHINXBUILD) -D plot_gallery=0 -b html "$(SOURCEDIR)" "$(BUILDDIR)/html"

docs/source/conf.py

+6
Original file line numberDiff line numberDiff line change
@@ -213,3 +213,9 @@
213213
'filename_pattern' : '.py',
214214
'download_all_examples' : False,
215215
}
216+
217+
# Compatibility for different backend when builds tutorials
218+
if os.environ['DGLBACKEND'] == 'mxnet':
219+
sphinx_gallery_conf['filename_pattern'] = "/*(?<=mx)\.py"
220+
if os.environ['DGLBACKEND'] == 'pytorch':
221+
sphinx_gallery_conf['filename_pattern'] = "/*(?<!mx)\.py"

readthedocs.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
build:
2+
image: latest
3+
4+
formats: []
5+
6+
python:
7+
version: 3.6
8+
use_system_site_packages: true
9+
setup_py_install: false

0 commit comments

Comments
 (0)