Bug 1474746 - [docs] Normalize keys from MOZ_SPHINX_TREES; r=gps
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Wed, 11 Jul 2018 16:01:21 +0000
changeset 426592 2f80a6085cbb
parent 426591 abc9aece7e63
child 426593 b30d58d58f69
push id34276
push userncsoregi@mozilla.com
push dateSat, 14 Jul 2018 09:41:08 +0000
treeherdermozilla-central@04dd259d71db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs1474746
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1474746 - [docs] Normalize keys from MOZ_SPHINX_TREES; r=gps This will allow developers to use '.' as the key, e.g: MOZ_SPHINX_TREES['.'] = 'docs' This will give consumers the ability to remove redundancies from their urls. For example, the telemetry docs currently have: MOZ_SPHINX_TREES['telemetry'] = 'docs' This results in a url like: https://firefox-source-docs.mozilla.org/main/latest/toolkit/components/telemetry/telemetry/index.html If they changed their key to '.' instead, the new url would become: https://firefox-source-docs.mozilla.org/main/latest/toolkit/components/telemetry/index.html Depends on D2079. Differential Revision: https://phabricator.services.mozilla.com/D2080
tools/docs/moztreedocs/__init__.py
--- a/tools/docs/moztreedocs/__init__.py
+++ b/tools/docs/moztreedocs/__init__.py
@@ -48,17 +48,17 @@ def read_build_config(docdir):
             absdir = os.path.join(build.topsrcdir, reldir, value)
             if not is_main and absdir not in (docdir, MAIN_DOC_PATH):
                 continue
 
             assert key
             if key.startswith('/'):
                 key = key[1:]
             else:
-                key = os.path.join(reldir, key)
+                key = os.path.normpath(os.path.join(reldir, key))
 
             if key in trees:
                 raise Exception('%s has already been registered as a destination.' % key)
             trees[key] = os.path.join(reldir, value)
 
         if name == 'SPHINX_PYTHON_PACKAGE_DIRS':
             python_package_dirs.add(os.path.join(reldir, value))