Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Commit

Permalink
enable edit on github link (#337)
Browse files Browse the repository at this point in the history
* enable edit on github link

* fix notedown notebooks
  • Loading branch information
szha authored Sep 24, 2018
1 parent 5895627 commit 7a10dca
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ lint:

docs: release
make -C docs html SPHINXOPTS=-W
for f in $(shell find docs/examples -type f -name '*.md' -print) ; do \
FILE=`echo $$f | sed 's/docs\///g'` ; \
DIR=`dirname $$FILE` ; \
BASENAME=`basename $$FILE` ; \
HTML_BASENAME=`echo $$BASENAME | sed 's/md/html/'` ; \
IPYNB_BASENAME=`echo $$BASENAME | sed 's/md/ipynb/'` ; \
TARGET_HTML="docs/_build/html/$$DIR/$$HTML_BASENAME" ; \
echo "processing" $$BASENAME ; \
sed -i "s/$$IPYNB_BASENAME/$$BASENAME/g" $$TARGET_HTML; \
done;

clean:
git clean -f -d -x --exclude="$(ROOTDIR)/tests/externaldata/*" --exclude=conda
Expand Down
11 changes: 10 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode',
'sphinx.ext.napoleon',
'sphinx.ext.mathjax',
'sphinx_gallery.gen_gallery',
Expand All @@ -67,6 +66,16 @@
nbsphinx_timeout = 1200
html_sourcelink_suffix = ''

html_context = {
'display_github': True,
'github_user': 'dmlc',
'github_repo': 'gluon-nlp',
'github_version': 'master',
'conf_py_path': '/docs/',
'last_updated': False,
'commit': True
}

nbsphinx_prolog = """
{% set paths = env.docname.split('/') %}
Expand Down

0 comments on commit 7a10dca

Please sign in to comment.