From ca42a39317f1df266a9384f113a714946d5602f1 Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Wed, 28 Feb 2018 14:47:01 -0800 Subject: [PATCH] docs: Fixing lint errors. Signed-off-by: Tim 'mithro' Ansell --- docs/conf.py | 3 ++- docs/markdown_code_symlinks.py | 12 +++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 6e692f52..e4fbfd18 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -47,7 +47,7 @@ templates_path = ['_templates'] # You can specify multiple suffix as a list of string: source_suffix = ['.rst', '.md'] source_parsers = { - '.md': 'recommonmark.parser.CommonMarkParser', + '.md': 'recommonmark.parser.CommonMarkParser', } # The master toctree document. @@ -182,6 +182,7 @@ texinfo_documents = [ # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = {'https://docs.python.org/': None} + def setup(app): MarkdownCodeSymlinks.find_links() app.add_config_value( diff --git a/docs/markdown_code_symlinks.py b/docs/markdown_code_symlinks.py index 023513b4..1955493e 100644 --- a/docs/markdown_code_symlinks.py +++ b/docs/markdown_code_symlinks.py @@ -2,7 +2,6 @@ import logging import os from recommonmark import transform - """ Allow linking of Markdown documentation from the source code tree into the Sphinx documentation tree. @@ -14,6 +13,7 @@ We also want links from two Markdown documents found in the Sphinx docs to work, so that is also fixed up. """ + def path_contains(parent_path, child_path): """Check a path contains another path. @@ -159,11 +159,12 @@ Document Root: {} self.config['github_code_repo'], dst_rsrc) else: url = os.path.relpath( - os.path.join(self.docs_root_dir, self.mapping['code2docs'][dst_rsrc]), + os.path.join( + self.docs_root_dir, self.mapping['code2docs'][dst_rsrc]), start=src_dir) base_url, ext = os.path.splitext(url) - assert ext in (".md", ".markdown"), ( - "Unknown extension {}""".format(ext)) + assert ext in (".md", + ".markdown"), ("Unknown extension {}".format(ext)) url = "{}.html".format(base_url) print("---") @@ -173,9 +174,6 @@ Document Root: {} return url - - - if __name__ == "__main__": import doctest doctest.testmod()