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

--HG--
extra : histedit_source : b34a35d2686553e615c7fc8c48422ee9e7d29179
This commit is contained in:
Andrew Halberstadt 2018-07-11 16:01:21 +00:00
parent b9e99b1dce
commit dbf1f2b689

View file

@ -53,7 +53,7 @@ def read_build_config(docdir):
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)