Loading tools/droiddoc/src/DroidDoc.java +8 −1 Original line number Diff line number Diff line Loading @@ -96,6 +96,7 @@ public class DroidDoc //Create the dependency graph for the stubs directory boolean apiXML = false; boolean noDocs = false; boolean offlineMode = false; String apiFile = null; String debugStubsFile = ""; HashSet<String> stubPackages = null; Loading Loading @@ -194,6 +195,9 @@ public class DroidDoc else if (a[0].equals("-since")) { sinceTagger.addVersion(a[1], a[2]); } else if (a[0].equals("-offlinemode")) { offlineMode = true; } } // read some prefs from the template Loading Loading @@ -246,7 +250,7 @@ public class DroidDoc // Sample Code for (SampleCode sc: sampleCodes) { sc.write(); sc.write(offlineMode); } // Index page Loading Loading @@ -419,6 +423,9 @@ public class DroidDoc if (option.equals("-since")) { return 3; } if (option.equals("-offlinemode")) { return 1; } return 0; } Loading tools/droiddoc/src/SampleCode.java +25 −9 Original line number Diff line number Diff line Loading @@ -38,13 +38,14 @@ public class SampleCode { } } public void write() { public void write(boolean offlineMode) { File f = new File(mSource); if (!f.isDirectory()) { System.out.println("-samplecode not a directory: " + mSource); return; } writeDirectory(f, mDest); if (offlineMode) writeIndexOnly(f, mDest); else writeDirectory(f, mDest); } public static String convertExtension(String s, String ext) { Loading Loading @@ -99,10 +100,8 @@ public class SampleCode { // write the index page int i; HDF hdf = DroidDoc.makeHDF(); hdf.setValue("page.title", dir.getName() + " - " + mTitle); hdf.setValue("projectTitle", mTitle); HDF hdf = writeIndex(dir); hdf.setValue("subdir", subdir); i=0; for (String d: dirs) { Loading @@ -115,15 +114,32 @@ public class SampleCode { hdf.setValue("files." + i + ".href", convertExtension(f, ".html")); i++; } ClearPage.write(hdf, "sampleindex.cs", relative + "/index" + DroidDoc.htmlExtension); } public void writeIndexOnly(File dir, String relative) { HDF hdf = writeIndex(dir); ClearPage.write(hdf, "sampleindex.cs", relative + "/index" + DroidDoc.htmlExtension); } public HDF writeIndex(File dir) { HDF hdf = DroidDoc.makeHDF(); hdf.setValue("page.title", dir.getName() + " - " + mTitle); hdf.setValue("projectTitle", mTitle); String filename = dir.getPath() + "/_index.html"; String summary = SampleTagInfo.readFile(new SourcePositionInfo(filename, -1,-1), filename, "sample code", true, false, true); String summary = SampleTagInfo.readFile(new SourcePositionInfo(filename, -1,-1), filename, "sample code", true, false, true); if (summary == null) { summary = ""; } hdf.setValue("summary", summary); ClearPage.write(hdf, "sampleindex.cs", relative + "/index" + DroidDoc.htmlExtension); return hdf; } public void writePage(File f, String out, String subdir) { Loading tools/droiddoc/templates/sampleindex.cs +33 −17 Original line number Diff line number Diff line Loading @@ -20,11 +20,15 @@ <?cs var:summary ?> <?cs if:android.whichdoc == "online" ?><?cs # If this is the online docs, build the src code navigation links ?> <?cs if:subcount(subdirs) ?> <h2>Subdirectories</h2> <ul class="nolist"> <?cs each:dir=subdirs ?> <li><a href="<?cs var:dir.name ?>/index.html"><?cs var:dir.name ?>/</a></li> <li><a href="<?cs var:dir.name ?>/index.html"><?cs var:dir.name ?>/</a></li> <?cs /each ?> </ul> <?cs /if ?> Loading @@ -33,11 +37,23 @@ <h2>Files</h2> <ul class="nolist"> <?cs each:file=files ?> <li><a href="<?cs var:file.href ?>"><?cs var:file.name ?></a></li> <li><a href="<?cs var:file.href ?>"><?cs var:file.name ?></a></li> <?cs /each ?> </ul> <?cs /if ?> <?cs else ?><?cs # else, this means it's offline docs, so don't show src links (we don't have the pages!) ?> <p>You can find the source code for this sample in your SDK at:</p> <p style="margin-left:2em"> <code><em><sdk></em>/platforms/android-<em><version></em>/samples/</code> </p> <?cs /if ?><?cs # end if/else online docs ?> <?cs include:"footer.cs" ?> </div><!-- end jd-content --> </div><!-- end doc-content --> Loading Loading
tools/droiddoc/src/DroidDoc.java +8 −1 Original line number Diff line number Diff line Loading @@ -96,6 +96,7 @@ public class DroidDoc //Create the dependency graph for the stubs directory boolean apiXML = false; boolean noDocs = false; boolean offlineMode = false; String apiFile = null; String debugStubsFile = ""; HashSet<String> stubPackages = null; Loading Loading @@ -194,6 +195,9 @@ public class DroidDoc else if (a[0].equals("-since")) { sinceTagger.addVersion(a[1], a[2]); } else if (a[0].equals("-offlinemode")) { offlineMode = true; } } // read some prefs from the template Loading Loading @@ -246,7 +250,7 @@ public class DroidDoc // Sample Code for (SampleCode sc: sampleCodes) { sc.write(); sc.write(offlineMode); } // Index page Loading Loading @@ -419,6 +423,9 @@ public class DroidDoc if (option.equals("-since")) { return 3; } if (option.equals("-offlinemode")) { return 1; } return 0; } Loading
tools/droiddoc/src/SampleCode.java +25 −9 Original line number Diff line number Diff line Loading @@ -38,13 +38,14 @@ public class SampleCode { } } public void write() { public void write(boolean offlineMode) { File f = new File(mSource); if (!f.isDirectory()) { System.out.println("-samplecode not a directory: " + mSource); return; } writeDirectory(f, mDest); if (offlineMode) writeIndexOnly(f, mDest); else writeDirectory(f, mDest); } public static String convertExtension(String s, String ext) { Loading Loading @@ -99,10 +100,8 @@ public class SampleCode { // write the index page int i; HDF hdf = DroidDoc.makeHDF(); hdf.setValue("page.title", dir.getName() + " - " + mTitle); hdf.setValue("projectTitle", mTitle); HDF hdf = writeIndex(dir); hdf.setValue("subdir", subdir); i=0; for (String d: dirs) { Loading @@ -115,15 +114,32 @@ public class SampleCode { hdf.setValue("files." + i + ".href", convertExtension(f, ".html")); i++; } ClearPage.write(hdf, "sampleindex.cs", relative + "/index" + DroidDoc.htmlExtension); } public void writeIndexOnly(File dir, String relative) { HDF hdf = writeIndex(dir); ClearPage.write(hdf, "sampleindex.cs", relative + "/index" + DroidDoc.htmlExtension); } public HDF writeIndex(File dir) { HDF hdf = DroidDoc.makeHDF(); hdf.setValue("page.title", dir.getName() + " - " + mTitle); hdf.setValue("projectTitle", mTitle); String filename = dir.getPath() + "/_index.html"; String summary = SampleTagInfo.readFile(new SourcePositionInfo(filename, -1,-1), filename, "sample code", true, false, true); String summary = SampleTagInfo.readFile(new SourcePositionInfo(filename, -1,-1), filename, "sample code", true, false, true); if (summary == null) { summary = ""; } hdf.setValue("summary", summary); ClearPage.write(hdf, "sampleindex.cs", relative + "/index" + DroidDoc.htmlExtension); return hdf; } public void writePage(File f, String out, String subdir) { Loading
tools/droiddoc/templates/sampleindex.cs +33 −17 Original line number Diff line number Diff line Loading @@ -20,11 +20,15 @@ <?cs var:summary ?> <?cs if:android.whichdoc == "online" ?><?cs # If this is the online docs, build the src code navigation links ?> <?cs if:subcount(subdirs) ?> <h2>Subdirectories</h2> <ul class="nolist"> <?cs each:dir=subdirs ?> <li><a href="<?cs var:dir.name ?>/index.html"><?cs var:dir.name ?>/</a></li> <li><a href="<?cs var:dir.name ?>/index.html"><?cs var:dir.name ?>/</a></li> <?cs /each ?> </ul> <?cs /if ?> Loading @@ -33,11 +37,23 @@ <h2>Files</h2> <ul class="nolist"> <?cs each:file=files ?> <li><a href="<?cs var:file.href ?>"><?cs var:file.name ?></a></li> <li><a href="<?cs var:file.href ?>"><?cs var:file.name ?></a></li> <?cs /each ?> </ul> <?cs /if ?> <?cs else ?><?cs # else, this means it's offline docs, so don't show src links (we don't have the pages!) ?> <p>You can find the source code for this sample in your SDK at:</p> <p style="margin-left:2em"> <code><em><sdk></em>/platforms/android-<em><version></em>/samples/</code> </p> <?cs /if ?><?cs # end if/else online docs ?> <?cs include:"footer.cs" ?> </div><!-- end jd-content --> </div><!-- end doc-content --> Loading