From 28b7691a59ea9788e10c4ca087c1ad063ee327fe Mon Sep 17 00:00:00 2001 From: Matthias Geier Date: Thu, 11 Feb 2016 21:50:46 +0100 Subject: [PATCH] Check local links for all source suffixes --- nbsphinx.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/nbsphinx.py b/nbsphinx.py index 4995e1d1..a88f8448 100644 --- a/nbsphinx.py +++ b/nbsphinx.py @@ -597,8 +597,15 @@ def apply(self): continue # Not a local link elif uri.startswith('#'): continue # Nothing to be done - elif uri.lower().endswith('.ipynb'): - target = uri[:-len('.ipynb')] + + for suffix in env.config.source_suffix: + if uri.lower().endswith(suffix.lower()): + target = uri[:-len(suffix)] + break + else: + target = '' + + if target: target_ext = '' reftype = 'doc' refdomain = None