summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmanda Kassay <akassay@google.com>2016-05-16 15:47:11 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-05-16 15:47:11 +0000
commitb0668d560f47e320c5ab30f8a3d719997ea006b3 (patch)
tree620874154e1e70767d4d4826ce90ef20b7e2d38f
parentcedb740343378187fa677c1c162b2f116ca9b743 (diff)
parent12ee1dfbaf2e3fba0346ae9fb649bb7bb1f86119 (diff)
downloadplatform_external_doclava-b0668d560f47e320c5ab30f8a3d719997ea006b3.tar.gz
platform_external_doclava-b0668d560f47e320c5ab30f8a3d719997ea006b3.tar.bz2
platform_external_doclava-b0668d560f47e320c5ab30f8a3d719997ea006b3.zip
Add href paths to samples project index pages in _book.yaml am: 12180455b0
am: 12ee1dfbaf * commit '12ee1dfbaf2e3fba0346ae9fb649bb7bb1f86119': Add href paths to samples project index pages in _book.yaml Change-Id: Iea0a956e91c2371bab31200b19a7a9f6f09920fa
-rw-r--r--src/com/google/doclava/SampleCode.java27
1 files changed, 17 insertions, 10 deletions
diff --git a/src/com/google/doclava/SampleCode.java b/src/com/google/doclava/SampleCode.java
index 31a390f..4932ba5 100644
--- a/src/com/google/doclava/SampleCode.java
+++ b/src/com/google/doclava/SampleCode.java
@@ -72,7 +72,7 @@ public class SampleCode {
*
* @param offlineMode Ignored -- offline-docs mode is not currently supported for
* browsable sample code projects.
- * @return A root Node for the project containing its metadata and tree structure.
+ * @return A root Node for the project containing its metadata and tree structure.
*/
public Node setSamplesTOC(boolean offlineMode) {
List<Node> filelist = new ArrayList<Node>();
@@ -124,7 +124,7 @@ public class SampleCode {
boolean writeFiles = true;
String link = "samples/" + name + "/index" + Doclava.htmlExtension;
//Write root _index.jd to out and add metadata to Node.
- writeSampleIndexCs(hdf, f,
+ writeSampleIndexCs(hdf, f,
new Node.Builder().setLabel(mProjectDir).setLink(link).build(), true);
}
@@ -135,7 +135,7 @@ public class SampleCode {
* the root project node.
*
* @param parent The root Node that represents this sample code project.
- * @param dir The current dir being processed.
+ * @param dir The current dir being processed.
* @param relative Relative path for creating links to this file.
*/
public void setProjectStructure(List<Node> parent, File dir, String relative) {
@@ -158,7 +158,7 @@ public class SampleCode {
String dirpath = relative + name + "/";
setProjectStructure(mchildren, f, dirpath);
if (mchildren.size() > 0) {
- parent.add(new Node.Builder().setLabel(name).setLink(ClearPage.toroot
+ parent.add(new Node.Builder().setLabel(name).setLink(ClearPage.toroot
+ dirpath).setChildren(mchildren).build());
}
}
@@ -626,12 +626,19 @@ public class SampleCode {
for (int i = 0; i < n; i++) {
if (isChild == true && list.get(i).getChildren() != null) {
buf.append(indent + "- title: " + list.get(i).getLabel() + "/\n");
- buf.append(indent + " path: \"#\"\n");
- buf.append(indent + " path_attributes:\n");
- buf.append(indent + " - name: onclick\n");
- buf.append(indent + " value: return false;\n");
- buf.append(indent + " - name: title\n");
- buf.append(indent + " value: " + list.get(i).getLabel() + "\n");
+ if (list.get(i).getLink().indexOf(".html") > -1) {
+ buf.append(indent + " path: " + list.get(i).getLink() + "\n");
+ buf.append(indent + " path_attributes:\n");
+ buf.append(indent + " - name: title\n");
+ buf.append(indent + " value: " + list.get(i).getLabel() + "\n");
+ } else {
+ buf.append(indent + " path: \"#\"\n");
+ buf.append(indent + " path_attributes:\n");
+ buf.append(indent + " - name: onclick\n");
+ buf.append(indent + " value: return false;\n");
+ buf.append(indent + " - name: title\n");
+ buf.append(indent + " value: " + list.get(i).getLabel() + "\n");
+ }
} else {
String xmlToHtmlPath = list.get(i).getLink().replace(".xml", ".html");
buf.append(indent + "- title: " + list.get(i).getLabel() + "\n");