sdk doc change for esr: add "Resources" tab and modify templates to build content for it.
Bug: 2160782 Change-Id: I5c45bdf4861ba2dc150e95d5523367a14b401304
This commit is contained in:
parent
1dd6ff638f
commit
502c498fec
11 changed files with 110 additions and 48 deletions
|
@ -137,6 +137,9 @@ public class DocFile
|
|||
} else if (outfile.indexOf("guide/") != -1) {
|
||||
hdf.setValue("guide", "true");
|
||||
ClearPage.write(hdf, "docpage.cs", outfile);
|
||||
} else if (outfile.indexOf("resources/") != -1) {
|
||||
hdf.setValue("resources", "true");
|
||||
ClearPage.write(hdf, "resourcespage.cs", outfile);
|
||||
} else {
|
||||
ClearPage.write(hdf, "nosidenavpage.cs", outfile);
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ public class SampleCode {
|
|||
System.out.println("-samplecode not a directory: " + mSource);
|
||||
return;
|
||||
}
|
||||
if (offlineMode) writeIndexOnly(f, mDest);
|
||||
if (offlineMode) writeIndexOnly(f, mDest, offlineMode);
|
||||
else writeDirectory(f, mDest);
|
||||
}
|
||||
|
||||
|
@ -118,9 +118,10 @@ public class SampleCode {
|
|||
ClearPage.write(hdf, "sampleindex.cs", relative + "/index" + DroidDoc.htmlExtension);
|
||||
}
|
||||
|
||||
public void writeIndexOnly(File dir, String relative) {
|
||||
public void writeIndexOnly(File dir, String relative, Boolean offline) {
|
||||
HDF hdf = writeIndex(dir);
|
||||
ClearPage.write(hdf, "sampleindex.cs", relative + "/index" +
|
||||
if (!offline) relative = "/" + relative;
|
||||
ClearPage.write(hdf, "sampleindex.cs", relative + "index" +
|
||||
DroidDoc.htmlExtension);
|
||||
}
|
||||
|
||||
|
|
|
@ -108,6 +108,21 @@ def:sdk_nav() ?>
|
|||
</div> <!-- end side-nav -->
|
||||
<?cs /def ?>
|
||||
|
||||
<?cs
|
||||
def:resources_tab_nav() ?>
|
||||
<div class="g-section g-tpl-240" id="body-content">
|
||||
<div class="g-unit g-first side-nav-resizable" id="side-nav">
|
||||
<div id="devdoc-nav"><?cs
|
||||
include:"../../../../frameworks/base/docs/html/resources/resources_toc.cs" ?>
|
||||
</div>
|
||||
</div> <!-- end side-nav -->
|
||||
<script>
|
||||
addLoadEvent(function() {
|
||||
scrollIntoView("devdoc-nav");
|
||||
});
|
||||
</script>
|
||||
<?cs /def ?>
|
||||
|
||||
<?cs
|
||||
def:guide_nav() ?>
|
||||
<div class="g-section g-tpl-240" id="body-content">
|
||||
|
@ -196,6 +211,8 @@ def:default_left_nav() ?>
|
|||
def:custom_left_nav() ?><?cs
|
||||
if:guide ?><?cs
|
||||
call:guide_nav() ?><?cs
|
||||
elif:resources ?><?cs
|
||||
call:resources_tab_nav() ?><?cs
|
||||
elif:sdk ?><?cs
|
||||
call:sdk_nav() ?><?cs
|
||||
else ?><?cs
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
elif:guide ?>guide<?cs
|
||||
elif:sdk ?>sdk<?cs
|
||||
elif:home ?>home<?cs
|
||||
elif:community ?>community<?cs
|
||||
elif:resources ?>resources<?cs
|
||||
elif:videos ?>videos<?cs /if ?>">
|
||||
|
||||
<li id="home-link"><a href="<?cs var:toroot ?><?cs
|
||||
|
@ -47,16 +47,16 @@
|
|||
<span style="display:none" class="zh-TW">參考資料</span>
|
||||
<?cs /if ?>
|
||||
</a></li>
|
||||
<li><a href="http://android-developers.blogspot.com" onClick="return requestAppendHL(this.href)">
|
||||
<li id="resources-link"><a href="<?cs var:toroot ?>resources/index.html" onClick="return loadLast('resources')">
|
||||
<?cs if:!sdk.redirect ?>
|
||||
<span class="en">Blog</span>
|
||||
<span class="en">Resources</span>
|
||||
<span style="display:none" class="de"></span>
|
||||
<span style="display:none" class="es"></span>
|
||||
<span style="display:none" class="fr"></span>
|
||||
<span style="display:none" class="it"></span>
|
||||
<span style="display:none" class="ja">ブログ</span>
|
||||
<span style="display:none" class="zh-CN">博客</span>
|
||||
<span style="display:none" class="zh-TW">網誌</span>
|
||||
<span style="display:none" class="ja"></span>
|
||||
<span style="display:none" class="zh-CN"></span>
|
||||
<span style="display:none" class="zh-TW"></span>
|
||||
<?cs /if ?>
|
||||
</a></li>
|
||||
<li id="videos-link"><a href="<?cs var:toroot ?>videos/index.html" onClick="return loadLast('videos')">
|
||||
|
@ -71,17 +71,19 @@
|
|||
<span style="display:none" class="zh-TW"></span>
|
||||
<?cs /if ?>
|
||||
</a></li>
|
||||
<li id="community-link"><a href="<?cs var:toroot ?>community/index.html">
|
||||
<li><a href="http://android-developers.blogspot.com" onClick="return requestAppendHL(this.href)">
|
||||
<?cs if:!sdk.redirect ?>
|
||||
<span class="en">Community</span>
|
||||
<span class="en">Blog</span>
|
||||
<span style="display:none" class="de"></span>
|
||||
<span style="display:none" class="es">Comunidad</span>
|
||||
<span style="display:none" class="fr">Communauté</span>
|
||||
<span style="display:none" class="es"></span>
|
||||
<span style="display:none" class="fr"></span>
|
||||
<span style="display:none" class="it"></span>
|
||||
<span style="display:none" class="ja">コミュニティ</span>
|
||||
<span style="display:none" class="zh-CN">社区</span>
|
||||
<span style="display:none" class="zh-TW">社群</span>
|
||||
<span style="display:none" class="ja">ブログ</span>
|
||||
<span style="display:none" class="zh-CN">博客</span>
|
||||
<span style="display:none" class="zh-TW">網誌</span>
|
||||
<?cs /if ?>
|
||||
</a></li>
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
|
31
tools/droiddoc/templates-sdk/resourcespage.cs
Normal file
31
tools/droiddoc/templates-sdk/resourcespage.cs
Normal file
|
@ -0,0 +1,31 @@
|
|||
<?cs include:"doctype.cs" ?>
|
||||
<?cs include:"macros.cs" ?>
|
||||
|
||||
<html>
|
||||
<?cs include:"head_tag.cs" ?>
|
||||
|
||||
<body class="gc-documentation">
|
||||
<?cs call:custom_masthead() ?>
|
||||
<?cs call:resources_tab_nav() ?>
|
||||
<a name="top"></a>
|
||||
<div class="g-unit" id="doc-content" >
|
||||
<div id="jd-header" class="guide-header">
|
||||
<span class="crumb"> </span>
|
||||
<h1><?cs var:page.title ?></h1>
|
||||
</div>
|
||||
|
||||
<div id="jd-content">
|
||||
|
||||
<?cs call:tag_list(root.descr) ?>
|
||||
|
||||
<?cs include:"footer.cs" ?>
|
||||
|
||||
</div><!-- end doc-content -->
|
||||
|
||||
<?cs include:"trailer.cs" ?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
|
@ -268,7 +268,7 @@ hr.blue {
|
|||
.guide #guide-link a,
|
||||
.reference #reference-link a,
|
||||
.sdk #sdk-link a,
|
||||
.community #community-link a,
|
||||
.resources #resources-link a,
|
||||
.videos #videos-link a {
|
||||
background-image: url(images/bg_images_sprite.png);
|
||||
background-position: 0 0;
|
||||
|
@ -282,7 +282,7 @@ hr.blue {
|
|||
.guide #guide-link a:hover,
|
||||
.reference #reference-link a:hover,
|
||||
.sdk #sdk-link a:hover,
|
||||
.community #community-link a:hover,
|
||||
.resources #resources-link a:hover,
|
||||
.videos #videos-link a:hover {
|
||||
background-image: url(images/bg_images_sprite.png);
|
||||
background-position: 0 0;
|
||||
|
|
|
@ -140,6 +140,8 @@ function init() {
|
|||
var cookiePath = "reference_";
|
||||
} else if (location.href.indexOf("/guide/") != -1) {
|
||||
var cookiePath = "guide_";
|
||||
} else if (location.href.indexOf("/resources/") != -1) {
|
||||
var cookiePath = "resources_";
|
||||
}
|
||||
|
||||
if (!isMobile) {
|
||||
|
@ -166,9 +168,14 @@ function init() {
|
|||
|
||||
function highlightNav(fullPageName) {
|
||||
var lastSlashPos = fullPageName.lastIndexOf("/");
|
||||
var firstSlashPos = (fullPageName.indexOf("/guide/") != -1) ?
|
||||
fullPageName.indexOf("/guide/") :
|
||||
fullPageName.indexOf("/sdk/"); // first slash after /guide or /sdk
|
||||
var firstSlashPos;
|
||||
if (fullPageName.indexOf("/guide/") != -1) {
|
||||
firstSlashPos = fullPageName.indexOf("/guide/");
|
||||
} else if (fullPageName.indexOf("/sdk/") != -1) {
|
||||
firstSlashPos = fullPageName.indexOf("/sdk/");
|
||||
} else {
|
||||
firstSlashPos = fullPageName.indexOf("/resources/");
|
||||
}
|
||||
if (lastSlashPos == (fullPageName.length - 1)) { // if the url ends in slash (add 'index.html')
|
||||
fullPageName = fullPageName + "index.html";
|
||||
}
|
||||
|
@ -228,6 +235,8 @@ function resizeHeight() {
|
|||
// If in the dev guide docs, also resize the "devdoc-nav" div
|
||||
} else if (href.indexOf("/guide/") != -1) {
|
||||
$("#devdoc-nav").css({height:sidenav.css("height")});
|
||||
} else if (href.indexOf("/resources/") != -1) {
|
||||
$("#devdoc-nav").css({height:sidenav.css("height")});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -308,6 +317,8 @@ $(window).unload(function(){
|
|||
writeCookie("lastpage", path, "reference", null);
|
||||
} else if (path.indexOf("/guide/") != -1) {
|
||||
writeCookie("lastpage", path, "guide", null);
|
||||
} else if (path.indexOf("/resources/") != -1) {
|
||||
writeCookie("lastpage", path, "resources", null);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
<div id="jd-content">
|
||||
|
||||
|
||||
<div class="jd-descr">
|
||||
<?cs call:tag_list(root.descr) ?>
|
||||
</div>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
if:page.title ?><?cs
|
||||
var:page.title ?> | <?cs
|
||||
/if ?>Android Developers</title><?cs
|
||||
if:guide||sdk ?>
|
||||
if:guide||sdk||resources ?>
|
||||
<link href="<?cs var:toroot ?>assets/android-developer-docs-devguide.css" rel="stylesheet" type="text/css" /><?cs
|
||||
else ?>
|
||||
<link href="<?cs var:toroot ?>assets/android-developer-docs.css" rel="stylesheet" type="text/css" /><?cs
|
||||
|
|
|
@ -1,18 +1,16 @@
|
|||
<?cs include:"doctype.cs" ?>
|
||||
<?cs include:"macros.cs" ?>
|
||||
<?cs set:guide="true" ?>
|
||||
<?cs set:resources="true" ?>
|
||||
<html>
|
||||
<?cs include:"head_tag.cs" ?>
|
||||
<?cs include:"header.cs" ?>
|
||||
<body class="gc-documentation">
|
||||
|
||||
<div class="g-unit" id="doc-content"><a name="top"></a>
|
||||
|
||||
<a name="top"></a>
|
||||
<div class="g-unit" id="doc-content">
|
||||
<div id="jd-header" class="guide-header">
|
||||
|
||||
<span class="crumb">
|
||||
<a href="<?cs var:toroot ?>guide/samples/index.html">Sample Code ></a>
|
||||
|
||||
</span>
|
||||
<span class="crumb"> </span>
|
||||
<h1><?cs var:page.title ?></h1>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -1,18 +1,16 @@
|
|||
<?cs include:"doctype.cs" ?>
|
||||
<?cs include:"macros.cs" ?>
|
||||
<?cs set:guide="true" ?>
|
||||
<?cs set:resources="true" ?>
|
||||
<html>
|
||||
<?cs include:"head_tag.cs" ?>
|
||||
<?cs include:"header.cs" ?>
|
||||
<body class="gc-documentation">
|
||||
|
||||
<div class="g-unit" id="doc-content"><a name="top"></a>
|
||||
|
||||
<a name="top"></a>
|
||||
<div class="g-unit" id="doc-content">
|
||||
<div id="jd-header" class="guide-header">
|
||||
|
||||
<span class="crumb">
|
||||
<a href="<?cs var:toroot ?>guide/samples/index.html">Sample Code ></a>
|
||||
|
||||
</span>
|
||||
<span class="crumb"> </span>
|
||||
<h1><?cs var:page.title ?></h1>
|
||||
</div>
|
||||
|
||||
|
@ -54,8 +52,10 @@
|
|||
|
||||
<?cs /if ?><?cs # end if/else online docs ?>
|
||||
|
||||
<?cs include:"footer.cs" ?>
|
||||
</div><!-- end jd-content -->
|
||||
|
||||
<?cs include:"footer.cs" ?>
|
||||
|
||||
</div><!-- end doc-content -->
|
||||
|
||||
<?cs include:"trailer.cs" ?>
|
||||
|
|
Loading…
Reference in a new issue