Skip to content

Commit

Permalink
Update show_on_colaboratory.py
Browse files Browse the repository at this point in the history
  • Loading branch information
keisuke-umezawa committed Oct 4, 2018
1 parent 30a6d3f commit e69e5b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/source_ja/_ext/show_on_colaboratory.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
def get_colaboratory_url(path):
fromto = [('hands_on', 'hands_on_ja'), ('official_example', 'official_example_ja')]
for f, t in fromto:
if path.startwith(f):
if path.startswith(f):
path = path.replace(f, t, 1)
return 'https://colab.research.google.com/github/chainer-community/chainer-colab-notebook/blob/master/{path}'.format(
path=path)


def html_page_context(app, pagename, templatename, context, doctree):
path = os.path.relpath(doctree.get('source'), app.builder.srcdir).replace('notebook/', '')
show_url = get_colaboratory_url(str(path))
show_url = get_colaboratory_url(path)

context['show_on_colaboratory_url'] = show_url

Expand Down

0 comments on commit e69e5b5

Please sign in to comment.