Fix the front page building issue on Ubuntu 12.04
See http://daringfireball.net/projects/markdown/syntax#html
Note that Markdown formatting syntax is not processed within block-level
HTML tags. E.g., you can’t use Markdown-style *emphasis* inside an HTML block.
Python-Markdown conforms to the syntax rule above since version 2.1
This change moves the inside markdown text as the separate files.
Change-Id: I0b88d5c93836f9ee5c35cbeda87b11f2944b7662
diff --git a/scripts/build.py b/scripts/build.py
index 33a1e33..f33fe0c 100755
--- a/scripts/build.py
+++ b/scripts/build.py
@@ -102,6 +102,16 @@
else:
sidebar3 = parent[2]
+ if 'index-intro.md' in files:
+ intro = md(os.path.join(curdir, 'index-intro.md'))
+ else:
+ intro = ''
+
+ if 'index-news.md' in files:
+ news = md(os.path.join(curdir, 'index-news.md'))
+ else:
+ news = ''
+
parents[curdir] = (sidebar, sidebar2, sidebar3)
# Step D: mirror all non-*.md files, and translate (file).md files into (file).html
@@ -115,6 +125,9 @@
final = template.safe_substitute(main=main, sidebar=sidebar, sidebar2=sidebar2, \
sidebar3=sidebar3, category=category, title=get_title(absfilename))
+ if cmp(absfilename, 'src/index.md') == 0:
+ final = string.Template(final).safe_substitute(intro=intro, news=news)
+
html = codecs.open(os.path.join(outdir, f.replace('.md', '.html')), 'w', encoding="utf8")
html.write(final)
else:
diff --git a/src/index-intro.md b/src/index-intro.md
new file mode 100644
index 0000000..963a84d
--- /dev/null
+++ b/src/index-intro.md
@@ -0,0 +1,28 @@
+<!--
+ Copyright 2013 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+Here you can find the information and source code you need to build an
+Android-compatible device.
+
+Android is an open-source software stack for mobile devices, and a
+corresponding open-source project led by Google. We created Android in
+response to our own experiences launching mobile apps. We wanted to make
+sure that there was no central point of failure, so that no industry player
+can restrict or control the innovations of any other. That's why we
+created Android, and made its source code open.
+
+[Learn more »](about/index.html)
+
diff --git a/src/index-news.md b/src/index-news.md
new file mode 100644
index 0000000..0ecce69
--- /dev/null
+++ b/src/index-news.md
@@ -0,0 +1,33 @@
+<!--
+ Copyright 2013 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+## News ##
+
+### Source Code Available for Android 4.1 ###
+
+The source code for the Android 4.1 platform and software stack has been
+released! This release allows OEMs to begin preparing Android 4.1 for
+installation on new and existing devices, and allows hobbyists, enthusiasts,
+and researchers to develop custom builds. For information on how to obtain the
+software, visit our [Getting the Source](source/downloading.html) page.
+
+### Compatibility Definition for Android 4.0 ###
+
+The Compatibility Definition Document for Android 4.0 has been published.
+Android 4.0 allows device manufacturers to use the Android source code to ship
+a significantly wider variety of devices including phones and tablets.
+For more information, visit the [Compatibility](compatibility/index.html) page.
+
diff --git a/src/index.md b/src/index.md
index 300b663..5c168bc 100644
--- a/src/index.md
+++ b/src/index.md
@@ -17,42 +17,13 @@
# Welcome to Android #
<div style="float: right; width: 35%;">
-
-## News ##
-
-### Source Code Available for Android 4.1 ###
-
-The source code for the Android 4.1 platform and software stack has been
-released! This release allows OEMs to begin preparing Android 4.1 for
-installation on new and existing devices, and allows hobbyists, enthusiasts,
-and researchers to develop custom builds. For information on how to obtain the
-software, visit our [Getting the Source](source/downloading.html) page.
-
-### Compatibility Definition for Android 4.0 ###
-
-The Compatibility Definition Document for Android 4.0 has been published.
-Android 4.0 allows device manufacturers to use the Android source code to ship
-a significantly wider variety of devices including phones and tablets.
-For more information, visit the [Compatibility](compatibility/index.html) page.
-
+$news
</div>
<img style="float: right; padding-right: 1.5em;" src="images/home-bugdroid.png" alt="Android Mascot"/>
<div style="font-size: 1.3em;">
-
-Here you can find the information and source code you need to build an
-Android-compatible device.
-
-Android is an open-source software stack for mobile devices, and a
-corresponding open-source project led by Google. We created Android in
-response to our own experiences launching mobile apps. We wanted to make
-sure that there was no central point of failure, so that no industry player
-can restrict or control the innovations of any other. That's why we
-created Android, and made its source code open.
-
-[Learn more »](about/index.html)
-
+$intro
</div>
<div style="clear: both;"/>