Skip to content

Commit

Permalink
Better support for rtd.
Browse files Browse the repository at this point in the history
  • Loading branch information
qiuwch committed May 24, 2017
1 parent dfa98b0 commit 6377848
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
2 changes: 2 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
_build/
_rtd/
modules/
tutorials_source/output/

10 changes: 8 additions & 2 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,11 @@ html:
sphinx-build -n -b html . _build/html
xdg-open _build/html/index.html

clean:
rm -rf _build modules tutorials doxygen/html doxygen/latex doxygen/xml
clean: # Clear artifacts
rm -rf _build modules tutorials/*_tutorial.* tutorials/*.zip doxygen/html doxygen/latex doxygen/xml

rtd:
pip install -r requirements.txt
READTHEDOCS=True python conf.py
READTHEDOCS=True sphinx-build -n -b html . _rtd/html
xdg-open _build/html/index.html
18 changes: 9 additions & 9 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os, sys, glob, shutil
sys.path.insert(0, os.path.abspath('.'))

DOC_SOURCES_DIR = os.path.dirname(os.path.abspath(__file__))
PROJECT_ROOT_DIR = os.path.dirname(DOC_SOURCES_DIR)
sys.path.insert(0, DOC_SOURCES_DIR)
print('PROJECT_ROOT_DIR', PROJECT_ROOT_DIR)
import os, sys, glob, shutil, subprocess
doc_dir = os.path.dirname(os.path.abspath(__file__))
project_dir = os.path.dirname(doc_dir)
sys.path.insert(0, doc_dir)

# If runs on ReadTheDocs environment
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'

# Hack for lacking git-lfs support ReadTheDocs
if on_rtd:
print('Fetching files with git_lfs')
print('Fetching files with git_lfs for %s' % project_dir)
from git_lfs import fetch
fetch(PROJECT_ROOT_DIR)
fetch(project_dir)

subprocess.call('doxygen Doxyfile', shell=True)
# Generate xml from doxygen

import sphinx_rtd_theme

Expand Down

0 comments on commit 6377848

Please sign in to comment.