docs: Fixing lint errors.

Signed-off-by: Tim 'mithro' Ansell <me@mith.ro>
This commit is contained in:
Tim 'mithro' Ansell 2018-02-28 14:47:01 -08:00
parent 03f901d010
commit ca42a39317
2 changed files with 7 additions and 8 deletions

View File

@ -47,7 +47,7 @@ templates_path = ['_templates']
# You can specify multiple suffix as a list of string: # You can specify multiple suffix as a list of string:
source_suffix = ['.rst', '.md'] source_suffix = ['.rst', '.md']
source_parsers = { source_parsers = {
'.md': 'recommonmark.parser.CommonMarkParser', '.md': 'recommonmark.parser.CommonMarkParser',
} }
# The master toctree document. # The master toctree document.
@ -182,6 +182,7 @@ texinfo_documents = [
# Example configuration for intersphinx: refer to the Python standard library. # Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None} intersphinx_mapping = {'https://docs.python.org/': None}
def setup(app): def setup(app):
MarkdownCodeSymlinks.find_links() MarkdownCodeSymlinks.find_links()
app.add_config_value( app.add_config_value(

View File

@ -2,7 +2,6 @@ import logging
import os import os
from recommonmark import transform from recommonmark import transform
""" """
Allow linking of Markdown documentation from the source code tree into the Sphinx Allow linking of Markdown documentation from the source code tree into the Sphinx
documentation tree. 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. work, so that is also fixed up.
""" """
def path_contains(parent_path, child_path): def path_contains(parent_path, child_path):
"""Check a path contains another path. """Check a path contains another path.
@ -159,11 +159,12 @@ Document Root: {}
self.config['github_code_repo'], dst_rsrc) self.config['github_code_repo'], dst_rsrc)
else: else:
url = os.path.relpath( 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) start=src_dir)
base_url, ext = os.path.splitext(url) base_url, ext = os.path.splitext(url)
assert ext in (".md", ".markdown"), ( assert ext in (".md",
"Unknown extension {}""".format(ext)) ".markdown"), ("Unknown extension {}".format(ext))
url = "{}.html".format(base_url) url = "{}.html".format(base_url)
print("---") print("---")
@ -173,9 +174,6 @@ Document Root: {}
return url return url
if __name__ == "__main__": if __name__ == "__main__":
import doctest import doctest
doctest.testmod() doctest.testmod()