summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Goldstein <markgoldstein@google.com>2020-09-21 20:24:05 +0000
committerTiem Song <tiem@google.com>2020-10-02 15:34:01 -0700
commite29e5c7cda1070ab15428a1579472e2b54a8a733 (patch)
treef95263c33a855c69a499c737fe82a0ab9970ddd7
parentabc7105f9b725c3862b7c441954bf79f428183d3 (diff)
downloaddoc_generation-e29e5c7cda1070ab15428a1579472e2b54a8a733.tar.gz
Add the language switcher to the packages and classes pages for the Android Platform.
Cherry pick of 775276b7739f7253de9d0c6cb80cae77fe354053 from AOSP Bug: 169960963 Test: generated reference docs before/after change and verified that switcher appears in the packages and classes pages. Change-Id: I3b7bcc1489206f6b7eb84846dfdc157d6ffc8306 Merged-In: I3b7bcc1489206f6b7eb84846dfdc157d6ffc8306
-rw-r--r--switcher4.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/switcher4.py b/switcher4.py
index 90abb60..7e06fac 100644
--- a/switcher4.py
+++ b/switcher4.py
@@ -49,6 +49,28 @@ if root != "reference":
sys.exit()
+# This method inserts the language switcher into the two top-level Android
+# Platform pages: packages.html and classes.html
+# For both Java and Kotlin
+def insert_platform_summaries():
+ global stubs
+ global java_stubs, kotlin_stubs
+ global verbose, work, show_solo
+ global java_source_abs_path
+ global kotlin_source_abs_path
+
+ stubs = 0
+ java_stubs = 0
+ kotlin_stubs = 0
+
+ java_source_abs_path = java_ref_root
+ kotlin_source_abs_path = kotlin_ref_root
+ insert_stub(os.path.join(java_ref_root, "packages.html"), True, True)
+ insert_stub(os.path.join(kotlin_ref_root, "packages.html"), False, True)
+
+ insert_stub(os.path.join(java_ref_root, "classes.html"), True, True)
+ insert_stub(os.path.join(kotlin_ref_root, "classes.html"), False, True)
+
# This method uses switcher2, which assumes the refdocs stay in their current
# assymetrical dirs (ref/android and ref/kotlin/android)
# And just puts the switcher in the existing docs
@@ -247,6 +269,9 @@ def main(argv):
print "*** PLATFORM PAGES ***"
print "======================"
+ # Insert the switchers at the top level first
+ insert_platform_summaries()
+
elif source == "androidx":
stem = "androidx"
print