Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1119)

Unified Diff: native_client_sdk/src/doc/doxygen/rst_index.py

Issue 591683002: [NaCl SDK Docs] Fix many issues with the doc generator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove doxygen 1.8 stuff Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « native_client_sdk/src/doc/doxygen/generate_docs.py ('k') | native_client_sdk/src/doc/sitemap.rst » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: native_client_sdk/src/doc/doxygen/rst_index.py
diff --git a/native_client_sdk/src/doc/doxygen/rst_index.py b/native_client_sdk/src/doc/doxygen/rst_index.py
index cf1a31f10ed3384006ea52a2a159c48403ecc0f9..9706f97c4dbad8d5e59241ae6bde67f8a2c1d61b 100755
--- a/native_client_sdk/src/doc/doxygen/rst_index.py
+++ b/native_client_sdk/src/doc/doxygen/rst_index.py
@@ -12,7 +12,9 @@ import sys
VALID_CHANNELS = ('stable', 'beta', 'dev')
-ROOT_FILE_CONTENTS = """.. _pepper_%(channel)s_index:
+ROOT_FILE_CONTENTS = """\
+.. _pepper_%(channel)s_index:
+
:orphan:
@@ -33,7 +35,9 @@ run in Chrome %(version)s or higher.
"""
-C_FILE_CONTENTS = """.. _pepper_%(channel)s_c_index:
+C_FILE_CONTENTS = """\
+.. _pepper_%(channel)s_c_index:
+.. _c-api%(channel_alt)s:
.. DO NOT EDIT! This document is auto-generated by doxygen/rst_index.py.
@@ -44,25 +48,25 @@ Pepper C API Reference (%(channel_title)s)
This page lists the C API for Pepper %(version)s. Apps that use this API can
run in Chrome %(version)s or higher.
-`Interfaces <group___interfaces.html>`_
-=======================================
+`Interfaces <pepper_%(channel)s/c/group___interfaces.html>`__
+=============================================================
%(interfaces)s
-`Structures <group___structs.html>`_
-====================================
+`Structures <pepper_%(channel)s/c/group___structs.html>`__
+==========================================================
%(structures)s
-`Functions <group___functions.html>`_
-=====================================
+`Functions <pepper_%(channel)s/c/group___functions.html>`__
+===========================================================
-`Enums <group___enums.html>`_
-=============================
+`Enums <pepper_%(channel)s/c/group___enums.html>`__
+===================================================
-`Typedefs <group___typedefs.html>`_
-===================================
+`Typedefs <pepper_%(channel)s/c/group___typedefs.html>`__
+=========================================================
-`Macros <globals_defs.html>`_
-=============================
+`Macros <pepper_%(channel)s/c/globals_defs.html>`__
+===================================================
Files
=====
@@ -73,7 +77,9 @@ C_INTERFACE_WILDCARDS = ['struct_p_p_p__*', 'struct_p_p_b__*']
C_STRUCT_WILDCARDS = ['struct_p_p__*', 'union_p_p__*']
-CPP_FILE_CONTENTS = """.. _pepper_%(channel)s_cpp_index:
+CPP_FILE_CONTENTS = """\
+.. _pepper_%(channel)s_cpp_index:
+.. _cpp-api%(channel_alt)s:
.. DO NOT EDIT! This document is auto-generated by doxygen/rst_index.py.
@@ -84,8 +90,8 @@ Pepper C++ API Reference (%(channel_title)s)
This page lists the C++ API for Pepper %(version)s. Apps that use this API can
run in Chrome %(version)s or higher.
-`Classes <inherits.html>`_
-==========================
+`Classes <pepper_%(channel)s/cpp/inherits.html>`__
+==================================================
%(classes)s
Files
@@ -147,10 +153,10 @@ def GetName(filename):
def GetPath(filepath):
if os.path.exists(filepath):
return filepath
- raise OSError('Couldnt find: ' + filepath)
+ raise OSError('Couldn\'t find: ' + filepath)
-def MakeReSTListFromFiles(path, matches, excludes=None):
+def MakeReSTListFromFiles(prefix, path, matches, excludes=None):
dir_files = os.listdir(path)
good_files = []
for match in matches:
@@ -162,15 +168,23 @@ def MakeReSTListFromFiles(path, matches, excludes=None):
if not fnmatch.fnmatch(filename, exclude)]
good_files.sort()
- return '\n'.join(' * `%s <%s>`_\n' % (GetName(f), f) for f in good_files)
+ return '\n'.join(' * `%s <%s/%s>`__\n' % (GetName(f), prefix, f)
+ for f in good_files)
def MakeTitleCase(s):
return s[0].upper() + s[1:]
+def MakeChannelAlt(channel):
+ if channel == 'stable':
+ return ''
+ else:
+ return '-' + channel
+
def GenerateRootIndex(channel, version, out_filename):
channel_title = MakeTitleCase(channel)
+ channel_alt = MakeChannelAlt(channel)
# Use StringIO so we don't write out a partial file on error.
output = cStringIO.StringIO()
@@ -181,10 +195,12 @@ def GenerateRootIndex(channel, version, out_filename):
def GenerateCIndex(root_dir, channel, version, out_filename):
- interfaces = MakeReSTListFromFiles(root_dir, C_INTERFACE_WILDCARDS)
- structures = MakeReSTListFromFiles(root_dir, C_STRUCT_WILDCARDS)
- files = MakeReSTListFromFiles(root_dir, FILE_WILDCARDS)
+ prefix = 'pepper_%s/c' % channel
+ interfaces = MakeReSTListFromFiles(prefix, root_dir, C_INTERFACE_WILDCARDS)
+ structures = MakeReSTListFromFiles(prefix, root_dir, C_STRUCT_WILDCARDS)
+ files = MakeReSTListFromFiles(prefix, root_dir, FILE_WILDCARDS)
channel_title = MakeTitleCase(channel)
+ channel_alt = MakeChannelAlt(channel)
# Use StringIO so we don't write out a partial file on error.
output = cStringIO.StringIO()
@@ -195,10 +211,12 @@ def GenerateCIndex(root_dir, channel, version, out_filename):
def GenerateCppIndex(root_dir, channel, version, out_filename):
- classes = MakeReSTListFromFiles(root_dir, CPP_CLASSES_WILDCARDS,
+ prefix = 'pepper_%s/cpp' % channel
+ classes = MakeReSTListFromFiles(prefix, root_dir, CPP_CLASSES_WILDCARDS,
CPP_CLASSES_EXCLUDES)
- files = MakeReSTListFromFiles(root_dir, FILE_WILDCARDS)
+ files = MakeReSTListFromFiles(prefix, root_dir, FILE_WILDCARDS)
channel_title = MakeTitleCase(channel)
+ channel_alt = MakeChannelAlt(channel)
# Use StringIO so we don't write out a partial file on error.
output = cStringIO.StringIO()
« no previous file with comments | « native_client_sdk/src/doc/doxygen/generate_docs.py ('k') | native_client_sdk/src/doc/sitemap.rst » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698