diff options
author | Conley Owens <cco3@android.com> | 2011-07-12 09:52:16 -0700 |
---|---|---|
committer | Android Code Review <code-review@android.com> | 2011-07-12 09:52:16 -0700 |
commit | 86b3fdb1f23583d395216e77a3feab2f76d2bd9e (patch) | |
tree | 2de2a0cfbb596f3c5423052c3c104fc5123df426 | |
parent | 8ea9d7a6ca3eadd182f2475014ad28994064f36b (diff) | |
parent | a049ddecd56271b06d32448c83ddfa5914e29766 (diff) | |
download | source.android.com-86b3fdb1f23583d395216e77a3feab2f76d2bd9e.tar.gz |
Merge "Inherit tech sidebar topic headings."
-rw-r--r-- | README | 8 | ||||
-rwxr-xr-x | scripts/build.py | 23 | ||||
-rw-r--r-- | src/tech/bluetooth/sidebar.md | 7 | ||||
-rw-r--r-- | src/tech/bluetooth/sidebar2.md | 1 | ||||
-rw-r--r-- | src/tech/dalvik/sidebar.md | 10 | ||||
-rw-r--r-- | src/tech/dalvik/sidebar2.md | 4 | ||||
-rw-r--r-- | src/tech/encryption/sidebar.md | 9 | ||||
-rw-r--r-- | src/tech/encryption/sidebar2.md | 3 | ||||
-rw-r--r-- | src/tech/nfc/sidebar.md | 7 | ||||
-rw-r--r-- | src/tech/nfc/sidebar2.md | 1 | ||||
-rw-r--r-- | src/tech/sidebar.md | 4 | ||||
-rw-r--r-- | templates/sidebar | 1 |
12 files changed, 37 insertions, 41 deletions
@@ -37,9 +37,11 @@ For (Goo|U)buntu: % sudo apt-get install python-markdown For Mac: -Eh, haven't tried this yet, not sure. But it should be enough to just install -Python Markdown by hook or crook and make sure it's in your PATH. -http://www.freewisdom.org/projects/python-markdown/ +$ sudo easy_install ElementTree +$ sudo easy_install Markdown + +More information here: +http://www.freewisdom.org/projects/python-markdown/Installation ### Contents Included in Box ### diff --git a/scripts/build.py b/scripts/build.py index d57762d1..8188f511 100755 --- a/scripts/build.py +++ b/scripts/build.py @@ -44,6 +44,7 @@ if os.path.exists(HTML_DIR): os.mkdir(HTML_DIR) category = 'home' +parents = {} for curdir, subdirs, files in os.walk(SRC_DIR): print 'Processing %s...' % (curdir,), outdir = [x for x in curdir.split(os.path.sep) if x] @@ -51,20 +52,36 @@ for curdir, subdirs, files in os.walk(SRC_DIR): if len(outdir) == 2: category = outdir[-1] outdir = os.path.join(*outdir) - + for subdir in subdirs: os.mkdir(os.path.join(outdir, subdir)) + parentdir = os.path.dirname(curdir) + if parentdir in parents: + parent = parents[parentdir] + else: + parent = ('', '') + if 'sidebar.md' in files: sidebar = markdown(os.path.join(curdir, 'sidebar.md')) del files[files.index('sidebar.md')] else: - sidebar = '' + sidebar = parent[0] + + if 'sidebar2.md' in files: + sidebar2 = markdown(os.path.join(curdir, 'sidebar2.md')) + del files[files.index('sidebar2.md')] + else: + sidebar2 = parent[1] + + parents[curdir] = (sidebar, sidebar2) + for f in files: print ' .', if f.endswith('.md'): main = markdown(os.path.join(curdir, f)) - final = template.safe_substitute(main=main, sidebar=sidebar, category=category, title=get_title(os.path.join(curdir, f))) + final = template.safe_substitute(main=main, sidebar=sidebar, sidebar2=sidebar2, \ + category=category, title=get_title(os.path.join(curdir, f))) html = file(os.path.join(outdir, f.replace('.md', '.html')), 'w') html.write(final) diff --git a/src/tech/bluetooth/sidebar.md b/src/tech/bluetooth/sidebar.md deleted file mode 100644 index e57e2b07..00000000 --- a/src/tech/bluetooth/sidebar.md +++ /dev/null @@ -1,7 +0,0 @@ -# Topics # -- [Dalvik](/tech/dalvik/index.html) -- [Bluetooth](/tech/bluetooth/index.html) -- [NFC](/tech/nfc/index.html) -- [Encryption](/tech/encryption/index.html) - -# Bluetooth Topics # diff --git a/src/tech/bluetooth/sidebar2.md b/src/tech/bluetooth/sidebar2.md new file mode 100644 index 00000000..2075d112 --- /dev/null +++ b/src/tech/bluetooth/sidebar2.md @@ -0,0 +1 @@ +# Bluetooth Topics # diff --git a/src/tech/dalvik/sidebar.md b/src/tech/dalvik/sidebar.md deleted file mode 100644 index 2aef4f3c..00000000 --- a/src/tech/dalvik/sidebar.md +++ /dev/null @@ -1,10 +0,0 @@ -# Topics # -- [Dalvik](/tech/dalvik/index.html) -- [Bluetooth](/tech/bluetooth/index.html) -- [NFC](/tech/nfc/index.html) -- [Encryption](/tech/encryption/index.html) - -# Dalvik Topics # -- [Bytecode Format](dalvik-bytecode.html) -- [.Dex Format](dex-format.html) -- [Instruction Formats](instruction-formats.html) diff --git a/src/tech/dalvik/sidebar2.md b/src/tech/dalvik/sidebar2.md new file mode 100644 index 00000000..fa825b31 --- /dev/null +++ b/src/tech/dalvik/sidebar2.md @@ -0,0 +1,4 @@ +# Dalvik Topics # +- [Bytecode Format](dalvik-bytecode.html) +- [.Dex Format](dex-format.html) +- [Instruction Formats](instruction-formats.html) diff --git a/src/tech/encryption/sidebar.md b/src/tech/encryption/sidebar.md deleted file mode 100644 index e1f9ad75..00000000 --- a/src/tech/encryption/sidebar.md +++ /dev/null @@ -1,9 +0,0 @@ -# Topics # -- [Dalvik](/tech/dalvik/index.html) -- [Bluetooth](/tech/bluetooth/index.html) -- [NFC](/tech/nfc/index.html) -- [Encryption](/tech/encryption/index.html) - -# Encryption Topics # -- [Android Encryption Implementation](/tech/encryption/android_crypto_implementation.html) - diff --git a/src/tech/encryption/sidebar2.md b/src/tech/encryption/sidebar2.md new file mode 100644 index 00000000..f2014144 --- /dev/null +++ b/src/tech/encryption/sidebar2.md @@ -0,0 +1,3 @@ +# Encryption Topics # +- [Android Encryption Implementation](/tech/encryption/android_crypto_implementation.html) + diff --git a/src/tech/nfc/sidebar.md b/src/tech/nfc/sidebar.md deleted file mode 100644 index aa51014b..00000000 --- a/src/tech/nfc/sidebar.md +++ /dev/null @@ -1,7 +0,0 @@ -# Topics # -- [Dalvik](/tech/dalvik/index.html) -- [Bluetooth](/tech/bluetooth/index.html) -- [NFC](/tech/nfc/index.html) -- [Encryption](/tech/encryption/index.html) - -# NFC Topics # diff --git a/src/tech/nfc/sidebar2.md b/src/tech/nfc/sidebar2.md new file mode 100644 index 00000000..8579d808 --- /dev/null +++ b/src/tech/nfc/sidebar2.md @@ -0,0 +1 @@ +# NFC Topics # diff --git a/src/tech/sidebar.md b/src/tech/sidebar.md index 11c01b36..d1d6dbb9 100644 --- a/src/tech/sidebar.md +++ b/src/tech/sidebar.md @@ -1,5 +1,5 @@ # Topics # -- [Dalvik](/tech/dalvik/index.html) - [Bluetooth](/tech/bluetooth/index.html) -- [NFC](/tech/nfc/index.html) +- [Dalvik](/tech/dalvik/index.html) - [Encryption](/tech/encryption/index.html) +- [NFC](/tech/nfc/index.html) diff --git a/templates/sidebar b/templates/sidebar index a8c7b554..6b7dbe7e 100644 --- a/templates/sidebar +++ b/templates/sidebar @@ -1,4 +1,5 @@ <div id=sidebar> $sidebar + $sidebar2 </div> |