Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Unified Diff: chrome/common/extensions/docs/js/api_page_generator.js

Issue 10642015: Basic setup for generating app docs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/docs/js/api_page_generator.js
diff --git a/chrome/common/extensions/docs/js/api_page_generator.js b/chrome/common/extensions/docs/js/api_page_generator.js
index 25711c516d01fa9649587d5c5ea530548cc95143..f0f864fbfbc5b2c5113a135ee792c075bc212e88 100644
--- a/chrome/common/extensions/docs/js/api_page_generator.js
+++ b/chrome/common/extensions/docs/js/api_page_generator.js
@@ -18,7 +18,8 @@
*
*/
-var API_TEMPLATE = 'template/api_template.html';
+var API_TEMPLATE_EXTENSIONS = 'template/api_template.html';
+var API_TEMPLATE_APPS = 'template/api_template_apps.html';
var MODULE_SCHEMAS = [
'../api/alarms.json', // autogenerated
'../api/bookmarks.json',
@@ -156,8 +157,17 @@ function renderPage() {
pageName = pageBase.replace(/([A-Z])/g, ' $1');
pageName = pageName.substring(0, 1).toUpperCase() + pageName.substring(1);
+ // TODO(aa): Ugh, this is horrible. FIXME.
Yoyo Zhou 2012/06/22 19:05:55 Not sure of the best thing to do here, but one alt
Aaron Boodman 2012/06/22 22:16:48 Won't work. Added additional commentary.
Yoyo Zhou 2012/06/22 22:26:06 Oh, I misread the length - 2 as 2 for some reason.
Aaron Boodman 2012/06/22 22:34:14 It's not the hard-code number that bothers me, but
+ var docFamily = location.pathname.split("/");
+ docFamily = docFamily[docFamily.length - 2];
+ if (docFamily != "extensions" && docFamily != "apps")
+ docFamily = "";
+
+ var apiTemplate = docFamily == "extensions" ?
Yoyo Zhou 2012/06/22 19:05:55 I wonder if there should be an error if it's neith
Aaron Boodman 2012/06/22 22:16:48 Done.
+ API_TEMPLATE_EXTENSIONS : API_TEMPLATE_APPS;
+
// Fetch the api template and insert into the <body>.
- fetchContent(API_TEMPLATE, function(templateContent) {
+ fetchContent(apiTemplate, function(templateContent) {
document.getElementsByTagName('body')[0].innerHTML = templateContent;
fetchStatic();
}, function(error) {

Powered by Google App Engine
This is Rietveld 408576698