From f60d242137ba399adaf7c45fd97dad59b3178417 Mon Sep 17 00:00:00 2001 From: Darragh Bailey Date: Mon, 10 Apr 2017 15:43:35 +0100 Subject: [PATCH] Update to latest Sphinx for documentation Roll forward to recent version of sphinx for documentation generation. Change-Id: I9dadd6304cad15b58d39a1014c6804b4e32363ad --- doc/source/transform_github_links.py | 21 +++++++++++---------- test-requirements.txt | 2 +- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/doc/source/transform_github_links.py b/doc/source/transform_github_links.py index 695d51d..ad862dd 100644 --- a/doc/source/transform_github_links.py +++ b/doc/source/transform_github_links.py @@ -73,16 +73,17 @@ def transform_github_links(app, doctree, fromdocname): # Replace the suffix with the correct target format file ending, # but only if the link ends with both the correct source suffix # and refers to a local file. - if link.endswith(source_suffix): - # absolute paths are considered relative to repo - if link.startswith("/"): - basepath = "" - # relative paths are against the current doctree source path - else: - basepath = doc_dir - if os.path.exists(os.path.join(basepath, link)): - node['refuri'] = (link[:-len(source_suffix)] + target_format + - anchor) + for src_suffix in source_suffix: + if link.endswith(src_suffix): + # absolute paths are considered relative to repo + if link.startswith("/"): + basepath = "" + # relative paths are against the current doctree source path + else: + basepath = doc_dir + if os.path.exists(os.path.join(basepath, link)): + node['refuri'] = (link[:-len(source_suffix)] + target_format + + anchor) def setup(app): diff --git a/test-requirements.txt b/test-requirements.txt index 62e3253..e2cbaaf 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,7 +1,7 @@ hacking>=0.11.0,<0.12 # Apache-2.0 loremipsum mock!=1.1.1,<=1.3.0 -Sphinx>=1.1.2,<1.2 +sphinx>=1.5.1 # BSD discover coverage>=3.6 # Apache-2.0 fixtures>=0.3.14