This commit is contained in:
Lonami 2018-06-11 13:35:56 +02:00 committed by GitHub
parent 2071ecf8c5
commit c88b8c152b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -113,13 +113,13 @@ def _generate_index(folder, original_paths, root,
elif item not in (INDEX, BOT_INDEX):
files.append(item)
else:
# bots_index_paths should be a list of "namespace\method.html"
# bots_index_paths should be a list of "namespace/method.html"
# or "method.html"
for item in bots_index_paths:
dirname = os.path.dirname(item)
if dirname != '' and dirname not in namespaces:
if dirname and dirname not in namespaces:
namespaces.append(dirname)
elif dirname == '' and item not in (INDEX, BOT_INDEX):
elif not dirname and item not in (INDEX, BOT_INDEX):
files.append(item)
paths = {k: _get_relative_path(v, folder, folder=True)
@ -127,7 +127,6 @@ def _generate_index(folder, original_paths, root,
# Now that everything is setup, write the index.html file
filename = os.path.join(folder, BOT_INDEX if bots_index else INDEX)
with DocsWriter(filename, type_to_path=_get_path_for_type) as docs:
# Title should be the current folder name
docs.write_head(folder.title(),