summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmanda Kassay <akassay@google.com>2016-05-16 15:43:53 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-05-16 15:43:53 +0000
commit12ee1dfbaf2e3fba0346ae9fb649bb7bb1f86119 (patch)
tree8de02f1a11a7679054fded6ebd55f2a7e30f23ce
parent4486e4aa93d75f9798cee7cb35955d3bf5f5edca (diff)
parent12180455b0701954da6ea631b1737d54bb188117 (diff)
downloadplatform_external_doclava-12ee1dfbaf2e3fba0346ae9fb649bb7bb1f86119.tar.gz
platform_external_doclava-12ee1dfbaf2e3fba0346ae9fb649bb7bb1f86119.tar.bz2
platform_external_doclava-12ee1dfbaf2e3fba0346ae9fb649bb7bb1f86119.zip
Add href paths to samples project index pages in _book.yaml
am: 12180455b0 * commit '12180455b0701954da6ea631b1737d54bb188117': Add href paths to samples project index pages in _book.yaml Change-Id: I2b63ecc7f1818d94e29371d5cf849169a25402db
-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");