diff options
author | rafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-28 23:00:26 +0000 |
---|---|---|
committer | rafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-28 23:00:26 +0000 |
commit | 5cb2348e2a563509b55cfdcd340b87a6e727b228 (patch) | |
tree | 3e799f0855b2813baac4ad744d9275db27bb1ef9 /chrome/common/extensions/docs | |
parent | 7a691a96215f24415dc7e45dd437ff3371ea1225 (diff) | |
download | chromium_src-5cb2348e2a563509b55cfdcd340b87a6e727b228.zip chromium_src-5cb2348e2a563509b55cfdcd340b87a6e727b228.tar.gz chromium_src-5cb2348e2a563509b55cfdcd340b87a6e727b228.tar.bz2 |
Re-org extension docs, template support for new static files.
No chrome code changes (does not affect any files that are used in build or tests).
This is the precursor to a build/check-in step to generate extension docs if underlying api or static content has changed.
TBR
Review URL: http://codereview.chromium.org/159551
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21911 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/extensions/docs')
-rwxr-xr-x | chrome/common/extensions/docs/api_index.html | 46 | ||||
-rwxr-xr-x | chrome/common/extensions/docs/bookmarks.html | 46 | ||||
-rwxr-xr-x | chrome/common/extensions/docs/devguide.html | 146 | ||||
-rwxr-xr-x | chrome/common/extensions/docs/getstarted.html | 46 | ||||
-rwxr-xr-x | chrome/common/extensions/docs/images/bookmarks-hierarchy.png (renamed from chrome/common/extensions/docs/reference/images/bookmark-hierarchy.png) | bin | 50904 -> 50904 bytes | |||
-rwxr-xr-x | chrome/common/extensions/docs/images/bookmarks.png (renamed from chrome/common/extensions/docs/reference/images/bookmarks.png) | bin | 21105 -> 21105 bytes | |||
-rwxr-xr-x | chrome/common/extensions/docs/index.html | 176 | ||||
-rwxr-xr-x | chrome/common/extensions/docs/js/api_page_generator.js | 161 | ||||
-rwxr-xr-x | chrome/common/extensions/docs/overview.html | 196 | ||||
-rwxr-xr-x | chrome/common/extensions/docs/pageActions.html (renamed from chrome/common/extensions/docs/reference/pageActions.html) | 21 | ||||
-rwxr-xr-x | chrome/common/extensions/docs/reference/bookmarks.html | 32 | ||||
-rwxr-xr-x | chrome/common/extensions/docs/self.html (renamed from chrome/common/extensions/docs/reference/self.html) | 21 | ||||
-rwxr-xr-x | chrome/common/extensions/docs/static/api_index.html (renamed from chrome/common/extensions/docs/reference/index.html) | 57 | ||||
-rwxr-xr-x | chrome/common/extensions/docs/static/bookmarks.html (renamed from chrome/common/extensions/docs/reference/bookmarks_overview.html) | 0 | ||||
-rwxr-xr-x | chrome/common/extensions/docs/static/devguide.html (renamed from chrome/common/extensions/docs/reference/chrome-api-index.html) | 64 | ||||
-rwxr-xr-x | chrome/common/extensions/docs/static/getstarted.html (renamed from chrome/common/extensions/docs/helloworld.html) | 86 | ||||
-rwxr-xr-x | chrome/common/extensions/docs/static/index.html | 66 | ||||
-rwxr-xr-x | chrome/common/extensions/docs/static/overview.html | 77 | ||||
-rwxr-xr-x | chrome/common/extensions/docs/static/pageActions.html (renamed from chrome/common/extensions/docs/reference/pageActions_overview.html) | 0 | ||||
-rwxr-xr-x | chrome/common/extensions/docs/static/self.html (renamed from chrome/common/extensions/docs/reference/self_overview.html) | 0 | ||||
-rwxr-xr-x | chrome/common/extensions/docs/static/tabs.html (renamed from chrome/common/extensions/docs/reference/tabs_overview.html) | 0 | ||||
-rwxr-xr-x | chrome/common/extensions/docs/static/windows.html (renamed from chrome/common/extensions/docs/reference/windows_overview.html) | 0 | ||||
-rwxr-xr-x | chrome/common/extensions/docs/tabs.html (renamed from chrome/common/extensions/docs/reference/tabs.html) | 21 | ||||
-rwxr-xr-x | chrome/common/extensions/docs/template/api_template.html | 359 | ||||
-rwxr-xr-x | chrome/common/extensions/docs/template/page_shell.html | 46 | ||||
-rwxr-xr-x | chrome/common/extensions/docs/windows.html (renamed from chrome/common/extensions/docs/reference/windows.html) | 21 |
26 files changed, 807 insertions, 881 deletions
diff --git a/chrome/common/extensions/docs/api_index.html b/chrome/common/extensions/docs/api_index.html new file mode 100755 index 0000000..faf8a37 --- /dev/null +++ b/chrome/common/extensions/docs/api_index.html @@ -0,0 +1,46 @@ +<!DOCTYPE html> +<!-- This page is a placeholder for generated extensions api doc. Note: + 1) The <head> information in this page is significant, should be uniform + across api docs and should be edited only with knowledge of the + templating mechanism. + 2) The <body> tag *must* retain id="body" + 3) All <body>.innerHTML is genereated as an rendering step. If viewed in a + browser, it will be re-generated from the template, json schema and + authored overview content. + 4) The <body>.innerHTML is also generated by an offline step so that this + page may easily be indexed by search engines. + + TODO(rafaelw): Abstract this into a "pageshell" that becomes the single + version of page template shell and the "instance" pages (bookmarks.html, + etc...) can be generated with a build step. +--> +<!-- <html> must retain id="template --> +<html xmlns="http://www.w3.org/1999/xhtml"> + <!-- <head> data is significant and loads the needed libraries and styles --> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title jscontent="pageTitle">pageTitle</title> + <link href="css/ApiRefStyles.css" rel="stylesheet" type="text/css"> + <script type="text/javascript" + src="../../../third_party/jstemplate/jstemplate_compiled.js"> + </script> + <script type="text/javascript" src="js/api_page_generator.js"></script> + <script> +// Re-render the page if the user-agent is chrome and it is being served as +// a file:/// scheme. This allows both the initial render to static as well +// as dynamic re-rendering for developers/doc-writers working on local changes. +window.onload = function() { + var chrome = navigator.userAgent.indexOf("Chrome") > -1; + var fileScheme = location.protocol == "file:"; + var regenerate = chrome && fileScheme; + //if (regenerate) { + window.renderPage(); + //} +} + </script> + </head> + <!-- <body> content is completely generated. Do not edit, as it will be + and rewritten. --> + <body class="hidden"> + </body> +</html> diff --git a/chrome/common/extensions/docs/bookmarks.html b/chrome/common/extensions/docs/bookmarks.html new file mode 100755 index 0000000..faf8a37 --- /dev/null +++ b/chrome/common/extensions/docs/bookmarks.html @@ -0,0 +1,46 @@ +<!DOCTYPE html> +<!-- This page is a placeholder for generated extensions api doc. Note: + 1) The <head> information in this page is significant, should be uniform + across api docs and should be edited only with knowledge of the + templating mechanism. + 2) The <body> tag *must* retain id="body" + 3) All <body>.innerHTML is genereated as an rendering step. If viewed in a + browser, it will be re-generated from the template, json schema and + authored overview content. + 4) The <body>.innerHTML is also generated by an offline step so that this + page may easily be indexed by search engines. + + TODO(rafaelw): Abstract this into a "pageshell" that becomes the single + version of page template shell and the "instance" pages (bookmarks.html, + etc...) can be generated with a build step. +--> +<!-- <html> must retain id="template --> +<html xmlns="http://www.w3.org/1999/xhtml"> + <!-- <head> data is significant and loads the needed libraries and styles --> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title jscontent="pageTitle">pageTitle</title> + <link href="css/ApiRefStyles.css" rel="stylesheet" type="text/css"> + <script type="text/javascript" + src="../../../third_party/jstemplate/jstemplate_compiled.js"> + </script> + <script type="text/javascript" src="js/api_page_generator.js"></script> + <script> +// Re-render the page if the user-agent is chrome and it is being served as +// a file:/// scheme. This allows both the initial render to static as well +// as dynamic re-rendering for developers/doc-writers working on local changes. +window.onload = function() { + var chrome = navigator.userAgent.indexOf("Chrome") > -1; + var fileScheme = location.protocol == "file:"; + var regenerate = chrome && fileScheme; + //if (regenerate) { + window.renderPage(); + //} +} + </script> + </head> + <!-- <body> content is completely generated. Do not edit, as it will be + and rewritten. --> + <body class="hidden"> + </body> +</html> diff --git a/chrome/common/extensions/docs/devguide.html b/chrome/common/extensions/docs/devguide.html index 8c1b2a3..faf8a37 100755 --- a/chrome/common/extensions/docs/devguide.html +++ b/chrome/common/extensions/docs/devguide.html @@ -1,104 +1,46 @@ <!DOCTYPE html> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> - <title>Extensions: Developer's Guide</title> - <link href="css/ApiRefStyles.css" rel="stylesheet" type="text/css"> -</head> -<body> - - <div id="container"> - <a name="top"> </a> - - <!-- API HEADER --> - <div id="pageHeader"> - <!-- BREADCRUMB --> - <!-- TODO: Fix these hrefs --> - <div id="breadcrumbs"> - <a href="./index.html">Google Chrome Extensions</a> > - Developer's Guide - </div> - <div id="searchbox"> - <form action="http://www.google.com/cse" id="cse-search-box"> - <div> - <input type="hidden" name="cx" value="002967670403910741006:61_cvzfqtno" /> - <input type="hidden" name="ie" value="UTF-8" /> - <input type="text" name="q" size="31" /> - <input type="submit" name="sa" value="Search" /> - </div> - </form> - - <script type="text/javascript" src="http://www.google.com/jsapi"></script> - <script type="text/javascript">google.load("elements", "1", {packages: "transliteration"});</script> - <script type="text/javascript" src="http://www.google.com/coop/cse/t13n?form=cse-search-box&t13n_langs=en"></script> - <script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&lang=en"></script> - </div> - <div id="pageTitle"> - <h1>Developer's Guide</h1> - </div> - </div> <!-- /pageHeader --> - - <div id="pageContent"> - <!-- SIDENAV --> - <div id="leftNav"> - <ul> - <li> Overview </li> - <li> Get Started </li> - <li> Developer's Guide </li> - <li> Reference - <ul> - <li> chrome.* APIs - </li> - </ul> - </li> - </ul> - </div> - - <div id="mainColumn"> - - <!-- CONTENT --> -<p> -[PENDING: intro to the guide goes here. say where to go. lots o' links.] -</p> - -<p> -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce sed -elit felis. Vestibulum porta mauris eget mi placerat a condimentum leo -semper. Ut scelerisque, ipsum in cursus semper, lectus enim molestie -ante, a porttitor dolor neque sit amet lorem. Integer dignissim gravida -eros ac rhoncus. Curabitur porttitor hendrerit dolor nec aliquam. Ut -vulputate ultrices eros eu ultrices. Pellentesque tempor mattis -odio in blandit. Proin nulla metus, tristique eget iaculis gravida, -varius at leo. Ut dolor mi, auctor et scelerisque vitae, volutpat -eleifend magna. Pellentesque habitant morbi tristique senectus et -netus et malesuada fames ac turpis egestas. Morbi ut risus nec massa -consectetur accumsan sed non est. Fusce ornare eros et felis dignissim -convallis. Maecenas condimentum purus eget nisl condimentum vitae ornare -diam sollicitudin. Nulla et dictum ante. In lacus odio, dapibus vel -faucibus at, posuere id enim. Nulla tincidunt felis id lectus convallis -vulputate. Phasellus libero dui, posuere sollicitudin egestas eget, -blandit in urna. Sed cursus tellus sed diam hendrerit pulvinar. -</p> - -<p> -Nam tincidunt mollis aliquam. Suspendisse bibendum dignissim dui, -ac mollis ligula fringilla sit amet. Pellentesque dapibus lobortis -dignissim. Cras eu lorem a ligula imperdiet ultricies. Phasellus ipsum -mi, accumsan quis dignissim eu, commodo ut mi. Nulla sagittis aliquet -malesuada. Ut lobortis tellus vitae dolor venenatis eu ullamcorper -lorem gravida. Quisque non pharetra velit. Maecenas elit risus, -ultricies in sagittis eget, facilisis sed neque. Quisque feugiat porta -pharetra. Vestibulum lorem magna, pellentesque et mattis sit amet, -euismod et dui. -</p> - - </div> <!-- /mainColumn --> - </div> <!-- /pageContent --> - <div id="pageFooter" --> - Copyright 2009 - <br /> - TBD: copyright/license should be automatically included here - </div> <!-- /pageFooter --> - </div> <!-- /container --> -</body> +<!-- This page is a placeholder for generated extensions api doc. Note: + 1) The <head> information in this page is significant, should be uniform + across api docs and should be edited only with knowledge of the + templating mechanism. + 2) The <body> tag *must* retain id="body" + 3) All <body>.innerHTML is genereated as an rendering step. If viewed in a + browser, it will be re-generated from the template, json schema and + authored overview content. + 4) The <body>.innerHTML is also generated by an offline step so that this + page may easily be indexed by search engines. + + TODO(rafaelw): Abstract this into a "pageshell" that becomes the single + version of page template shell and the "instance" pages (bookmarks.html, + etc...) can be generated with a build step. +--> +<!-- <html> must retain id="template --> +<html xmlns="http://www.w3.org/1999/xhtml"> + <!-- <head> data is significant and loads the needed libraries and styles --> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title jscontent="pageTitle">pageTitle</title> + <link href="css/ApiRefStyles.css" rel="stylesheet" type="text/css"> + <script type="text/javascript" + src="../../../third_party/jstemplate/jstemplate_compiled.js"> + </script> + <script type="text/javascript" src="js/api_page_generator.js"></script> + <script> +// Re-render the page if the user-agent is chrome and it is being served as +// a file:/// scheme. This allows both the initial render to static as well +// as dynamic re-rendering for developers/doc-writers working on local changes. +window.onload = function() { + var chrome = navigator.userAgent.indexOf("Chrome") > -1; + var fileScheme = location.protocol == "file:"; + var regenerate = chrome && fileScheme; + //if (regenerate) { + window.renderPage(); + //} +} + </script> + </head> + <!-- <body> content is completely generated. Do not edit, as it will be + and rewritten. --> + <body class="hidden"> + </body> </html> diff --git a/chrome/common/extensions/docs/getstarted.html b/chrome/common/extensions/docs/getstarted.html new file mode 100755 index 0000000..faf8a37 --- /dev/null +++ b/chrome/common/extensions/docs/getstarted.html @@ -0,0 +1,46 @@ +<!DOCTYPE html> +<!-- This page is a placeholder for generated extensions api doc. Note: + 1) The <head> information in this page is significant, should be uniform + across api docs and should be edited only with knowledge of the + templating mechanism. + 2) The <body> tag *must* retain id="body" + 3) All <body>.innerHTML is genereated as an rendering step. If viewed in a + browser, it will be re-generated from the template, json schema and + authored overview content. + 4) The <body>.innerHTML is also generated by an offline step so that this + page may easily be indexed by search engines. + + TODO(rafaelw): Abstract this into a "pageshell" that becomes the single + version of page template shell and the "instance" pages (bookmarks.html, + etc...) can be generated with a build step. +--> +<!-- <html> must retain id="template --> +<html xmlns="http://www.w3.org/1999/xhtml"> + <!-- <head> data is significant and loads the needed libraries and styles --> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title jscontent="pageTitle">pageTitle</title> + <link href="css/ApiRefStyles.css" rel="stylesheet" type="text/css"> + <script type="text/javascript" + src="../../../third_party/jstemplate/jstemplate_compiled.js"> + </script> + <script type="text/javascript" src="js/api_page_generator.js"></script> + <script> +// Re-render the page if the user-agent is chrome and it is being served as +// a file:/// scheme. This allows both the initial render to static as well +// as dynamic re-rendering for developers/doc-writers working on local changes. +window.onload = function() { + var chrome = navigator.userAgent.indexOf("Chrome") > -1; + var fileScheme = location.protocol == "file:"; + var regenerate = chrome && fileScheme; + //if (regenerate) { + window.renderPage(); + //} +} + </script> + </head> + <!-- <body> content is completely generated. Do not edit, as it will be + and rewritten. --> + <body class="hidden"> + </body> +</html> diff --git a/chrome/common/extensions/docs/reference/images/bookmark-hierarchy.png b/chrome/common/extensions/docs/images/bookmarks-hierarchy.png Binary files differindex a3902ae..a3902ae 100755 --- a/chrome/common/extensions/docs/reference/images/bookmark-hierarchy.png +++ b/chrome/common/extensions/docs/images/bookmarks-hierarchy.png diff --git a/chrome/common/extensions/docs/reference/images/bookmarks.png b/chrome/common/extensions/docs/images/bookmarks.png Binary files differindex a4d2ca2..a4d2ca2 100755 --- a/chrome/common/extensions/docs/reference/images/bookmarks.png +++ b/chrome/common/extensions/docs/images/bookmarks.png diff --git a/chrome/common/extensions/docs/index.html b/chrome/common/extensions/docs/index.html index 946802f..faf8a37 100755 --- a/chrome/common/extensions/docs/index.html +++ b/chrome/common/extensions/docs/index.html @@ -1,134 +1,46 @@ <!DOCTYPE html> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> - <title>Extensions</title> - <link href="css/ApiRefStyles.css" rel="stylesheet" type="text/css"> -</head> -<body> - - <div id="container"> - <a name="top"> </a> - - <!-- API HEADER --> - <div id="pageHeader"> - <!-- BREADCRUMB --> - <!-- TODO: Fix these hrefs --> - <div id="breadcrumbs"> - Google Chrome Extensions - </div> - <div id="searchbox"> - <form action="http://www.google.com/cse" id="cse-search-box"> - <div> - <input type="hidden" name="cx" value="002967670403910741006:61_cvzfqtno" /> - <input type="hidden" name="ie" value="UTF-8" /> - <input type="text" name="q" size="31" /> - <input type="submit" name="sa" value="Search" /> - </div> - </form> - - <script type="text/javascript" src="http://www.google.com/jsapi"></script> - <script type="text/javascript">google.load("elements", "1", {packages: "transliteration"});</script> - <script type="text/javascript" src="http://www.google.com/coop/cse/t13n?form=cse-search-box&t13n_langs=en"></script> - <script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&lang=en"></script> - </div> - <div id="pageTitle"> - <h1>Google Chrome Extensions</h1> - </div> - </div> <!-- /pageHeader --> - - <div id="pageContent"> - <!-- SIDENAV --> - <div id="leftNav"> - <ul> - <li> Overview </li> - <li> Get Started </li> - <li> Developer's Guide </li> - <li> Reference - <ul> - <li> chrome.* APIs - </li> - </ul> - </li> - </ul> - </div> - - <div id="mainColumn"> - - <!-- CONTENT --> -<p> If you want to customize Google Chrome, you've come to the right place. An <em>extension</em> is a bundle of web code (HTML, JavaScript, perhaps some CSS) that lets you add functionality or a bit of user interface (usually both) to the browser. <a href="http://dev.chromium.org/developers/design-documents/extensions/samples">Examples of extensions</a> include a mail checker, a newsfeed subscriber, and a status monitor.<br> - </p> - -<h3>Contents</h3> - <p> - This documentation is just being written; here's what we have so far. - You might also want to look at <a href="#other">Other resources</a>. - If you just want to <em>make</em> something, - go to <a href="helloworld.html">Get Started</a>. - </p> - - <ul> - <li><a href="overview.html">Overview</a></li> - <li><a href="helloworld.html">Get Started</a> (Hello, World!)</li> - <li><a href="devguide.html">Developer's Guide</a></li> - <li><a href="reference/index.html">Reference</a></li> - <ul> - <li>Supported APIs</li> - <ul> - <li>standard JavaScript libraries</li> - <li>XMLHttpRequest</li> - <li>anything in WebKit</li> - <li>anything in V8</li> - <li>anything you put in your zipfile</li> - </ul> - <li><a href="reference/chrome-api-index.html">chrome.* APIs</a> - <ul> - <li>[PENDING: fill this out automatically. In the meantime, start at the <a href="reference/bookmarks.html">chrome.bookmarks</a> page and click the links in the left column.]</li> - </ul> - </li> - </ul> - <li>Samples</li> - <ul> - <li>#1</li> - <li>#2</li> - </ul> - </ul> - - <h3 id="other">Other resources</h3> - - <ul> - <li><a href="http://dev.chromium.org/developers/design-documents/extensions">Design documents</a>:</li> - <ul> - <li><a href="http://dev.chromium.org/developers/design-documents/extensions/howto">HOWTO</a>: The precursor to Get Started [PENDING: make sure it's still useful]</li> - <li><a href="http://dev.chromium.org/developers/design-documents/extensions/packaging">Packaging</a>: [PENDING: might be obsolete]</li> - <li>APIs:</li> - <ul> - <li><a href="http://dev.chromium.org/developers/design-documents/extensions/bookmarks-api">Bookmarks</a></li> - <li><a href="http://dev.chromium.org/developers/design-documents/extensions/events">Events</a></li> - </ul> - <ul> - <li><a href="http://dev.chromium.org/developers/design-documents/extensions/tabs-api">Tabs</a></li> - </ul> - <ul> - <li><a href="http://dev.chromium.org/developers/design-documents/extensions/windows-api">Windows</a></li> - </ul> - <li>Features:</li> - <ul> - <li><a href="http://dev.chromium.org/developers/design-documents/extensions/toolstrips">Toolstrips</a>: Add UI to the toolbar area</li> - <li><a href="http://dev.chromium.org/developers/design-documents/extensions/content-scripts">Content scripts</a>: Run code within the context of web pages</li> - <li><a href="http://dev.chromium.org/developers/design-documents/extensions/background-pages">Background pages</a>: Run code that's not directly related to the UI</li> - <li><a href="http://dev.chromium.org/developers/design-documents/extensions/cross-origin-xhr">Cross-Origin XMLHttpRequest</a>: Communicate with multiple domains</li> - </ul> - </ul> - <li><a href="http://groups.google.com/group/chromium-extensions">chromium-extensions</a> (discussion group)</li> - </ul> - </div> <!-- /mainColumn --> - </div> <!-- /pageContent --> - <div id="pageFooter" --> - Copyright 2009 - <br /> - TBD: copyright/license should be automatically included here - </div> <!-- /pageFooter --> - </div> <!-- /container --> -</body> +<!-- This page is a placeholder for generated extensions api doc. Note: + 1) The <head> information in this page is significant, should be uniform + across api docs and should be edited only with knowledge of the + templating mechanism. + 2) The <body> tag *must* retain id="body" + 3) All <body>.innerHTML is genereated as an rendering step. If viewed in a + browser, it will be re-generated from the template, json schema and + authored overview content. + 4) The <body>.innerHTML is also generated by an offline step so that this + page may easily be indexed by search engines. + + TODO(rafaelw): Abstract this into a "pageshell" that becomes the single + version of page template shell and the "instance" pages (bookmarks.html, + etc...) can be generated with a build step. +--> +<!-- <html> must retain id="template --> +<html xmlns="http://www.w3.org/1999/xhtml"> + <!-- <head> data is significant and loads the needed libraries and styles --> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title jscontent="pageTitle">pageTitle</title> + <link href="css/ApiRefStyles.css" rel="stylesheet" type="text/css"> + <script type="text/javascript" + src="../../../third_party/jstemplate/jstemplate_compiled.js"> + </script> + <script type="text/javascript" src="js/api_page_generator.js"></script> + <script> +// Re-render the page if the user-agent is chrome and it is being served as +// a file:/// scheme. This allows both the initial render to static as well +// as dynamic re-rendering for developers/doc-writers working on local changes. +window.onload = function() { + var chrome = navigator.userAgent.indexOf("Chrome") > -1; + var fileScheme = location.protocol == "file:"; + var regenerate = chrome && fileScheme; + //if (regenerate) { + window.renderPage(); + //} +} + </script> + </head> + <!-- <body> content is completely generated. Do not edit, as it will be + and rewritten. --> + <body class="hidden"> + </body> </html> diff --git a/chrome/common/extensions/docs/js/api_page_generator.js b/chrome/common/extensions/docs/js/api_page_generator.js index f4bf330..e45a5b7 100755 --- a/chrome/common/extensions/docs/js/api_page_generator.js +++ b/chrome/common/extensions/docs/js/api_page_generator.js @@ -1,34 +1,34 @@ /** - * @fileoverview This file is the controller for generating one api reference - * page of the extension documentation. + * @fileoverview This file is the controller for generating extension + * doc pages. * - * It expects: - * - * - To be called from a "shell" page whose "base" name matches an api module - * name. For instance ../bookmarks.html -> chrome.bookmarks. - * - * - To have available via XHR (relative path): + * It expects to have available via XHR (relative path): * 1) API_TEMPLATE which is the main template for the api pages. * 2) A file located at SCHEMA which is shared with the extension system and * defines the methods and events contained in one api. - * 3) An |apiName| + OVERVIEW_EXTENSION file which contains static authored - * content that is inserted into the "overview" slot in the API_TEMPLATE. + * 3) (Possibly) A static version of the current page url in /static/. I.e. + * if called as ../foo.html, it will look for ../static/foo.html. * * The "shell" page may have a renderering already contained within it so that * the docs can be indexed. * - * TODO(rafaelw): XHR support for IE. - * TODO(rafaelw): JSON support for non-chrome 3.x clients. */ - -var API_TEMPLATE = "../template/api_template.html"; -var SCHEMA = "../../api/extension_api.json"; -var OVERVIEW_EXTENSION = "_overview.html"; + +var API_TEMPLATE = "template/api_template.html"; +var SCHEMA = "../api/extension_api.json"; var REQUEST_TIMEOUT = 2000; -// Global Schema Types (Referenced via $ref). +function staticResource(name) { return "static/" + name + ".html"; } + +// Base name of this page. (i.e. "tabs", "overview", etc...). +var pageName; + +// Data to feed as context into the template. +var pageData = null; + +// Schema Types (Referenced via $ref). var types = {}; - + Array.prototype.each = function(f) { for (var i = 0; i < this.length; i++) { f(this[i], i); @@ -44,34 +44,50 @@ function extend(obj, obj2) { } } -// name of the api this reference page is describing. i.e. "bookmarks", "tabs". -var apiName; - -window.onload = function() { - // Determine api module being rendered. Expect ".../<apiName>.html" +/* + * Main entry point for composing the page. It will fetch it's template, + * the extension api, and attempt to fetch the matching static content. + * It will insert the static content, if any, prepare it's pageData then + * render the template from |pageData|. + */ +function renderPage() { var pathParts = document.location.href.split(/\/|\./); - apiName = pathParts[pathParts.length - 2]; + pageName = pathParts[pathParts.length - 2]; // Fetch the api template and insert into the <body>. fetchContent(API_TEMPLATE, function(templateContent) { document.getElementsByTagName("body")[0].innerHTML = templateContent; + fetchStatic(); + }, function(error) { + alert("Failed to load " + API_TEMPLATE + ". " + error); + }); +} - // Fetch the overview and insert into the "overview" <div>. - fetchContent(apiName + OVERVIEW_EXTENSION, function(overviewContent) { - document.getElementById("overview").innerHTML = overviewContent; +function fetchStatic() { + // Fetch the static content and insert into the "static" <div>. + fetchContent(staticResource(pageName), function(overviewContent) { + document.getElementById("static").innerHTML = overviewContent; + fetchSchema(); + + }, function(error) { + // Not fatal. Some api pages may not have matching static content. + fetchSchema(); + }); +} - // Now the page is composed with the authored content, we fetch the schema - // and populate the templates. - fetchContent(SCHEMA, renderTemplate); - }); - }); +function fetchSchema() { + // Now the page is composed with the authored content, we fetch the schema + // and populate the templates. + fetchContent(SCHEMA, renderTemplate, function(error) { + alert("Failed to load " + SCHEMA); + }); } /** * Fetches |url| and returns it's text contents from the xhr.responseText in * onSuccess(content) */ -function fetchContent(url, onSuccess) { +function fetchContent(url, onSuccess, onError) { var xhr = new XMLHttpRequest(); var abortTimerId = window.setTimeout(function() { xhr.abort(); @@ -80,6 +96,9 @@ function fetchContent(url, onSuccess) { function handleError(error) { window.clearTimeout(abortTimerId); + if (onError) { + onError(error); + } console.error("XHR Failed: " + error); } @@ -107,29 +126,32 @@ function fetchContent(url, onSuccess) { } /** - * Parses the content in |schema| to json, find appropriate api, adds any + * Parses the content in |schemaContent| to json, find appropriate api, adds any * additional required values, renders to html via JSTemplate, and unhides the * <body>. * This uses the root <html> element (the entire document) as the template. */ function renderTemplate(schemaContent) { - var apiDefinition; + pageData = {}; var schema = JSON.parse(schemaContent); schema.each(function(module) { - if (module.namespace == apiName) - apiDefinition = module; + if (module.namespace == pageName) { + // This page is an api page. Setup types and apiDefinition. + if (module.types) { + module.types.each(function(t) { + types[t.id] = t; + }); + } + pageData.apiDefinition = module; + preprocessApi(pageData, schema); + } }); - // Setup Schema Types - apiDefinition.types.each(function(t) { - types[t.id] = t; - }); + setupPageData(pageData, schema); - preprocessApi(apiDefinition, schema, types); - // Render to template - var input = new JsEvalContext(apiDefinition); + var input = new JsEvalContext(pageData); var output = document.getElementsByTagName("html")[0]; jstProcess(input, output); @@ -137,22 +159,42 @@ function renderTemplate(schemaContent) { document.getElementsByTagName("body")[0].className = ""; } +function setupPageData(pageData, schema) { + // Add a list of modules for the master TOC. + pageData.apiModules = []; + schema.each(function(s) { + var m = {}; + m.module = s.namespace; + m.name = s.namespace.substring(0, 1).toUpperCase() + + s.namespace.substring(1); + pageData.apiModules.push(m); + }); + pageData.apiModules.sort(function(a, b) { return a.name > b.name; }); + + if (!pageData.pageTitle) { + pageData.pageTitle = pageName; + pageData.h1Header = pageName; + } +} + /** * Augment the |module| with additional values that are required by the - * template. |schema| is the full schema (including all modules). |types| is an - * array of typeId -> typeSchema. + * template. |schema| is the full schema (including all modules). */ -function preprocessApi(module, schema, types) { +function preprocessApi(pageData, schema) { + var module = pageData.apiDefinition; + pageData.pageTitle = "chrome." + module.namespace + " API Reference"; + pageData.h1Header = "chrome." + module.namespace module.functions.each(function(f) { f.fullName = "chrome." + module.namespace + "." + f.name; - linkTypeReferences(f.parameters, types); + linkTypeReferences(f.parameters); assignTypeNames(f.parameters); // Look for a callback that defines parameters. if (f.parameters.length > 0) { var lastParam = f.parameters[f.parameters.length - 1]; if (lastParam.type == "function" && lastParam.parameters) { - linkTypeReferences(lastParam.parameters, types); + linkTypeReferences(lastParam.parameters); assignTypeNames(lastParam.parameters); f.callbackParameters = lastParam.parameters; f.callbackSignature = generateSignatureString(lastParam.parameters); @@ -170,31 +212,20 @@ function preprocessApi(module, schema, types) { // Setup return typeName & _propertyList, if any. if (f.returns) { - linkTypeReference(f.returns, types); + linkTypeReference(f.returns); f.returns.typeName = typeName(f.returns); addPropertyListIfObject(f.returns); } }); module.events.each(function(e) { - linkTypeReferences(e.parameters, types); + linkTypeReferences(e.parameters); assignTypeNames(e.parameters); e.callSignature = generateSignatureString(e.parameters); e.parameters.each(function(p) { addPropertyListIfObject(p); }); }); - - // Add a list of modules for the master TOC. - module.apiModules = []; - schema.each(function(s) { - var m = {}; - m.module = s.namespace; - m.name = s.namespace.substring(0, 1).toUpperCase() + - s.namespace.substring(1); - module.apiModules.push(m); - }); - module.apiModules.sort(function(a, b) { return a.name > b.name; }); } /* @@ -217,13 +248,13 @@ function addPropertyListIfObject(object) { object._propertyList = propertyList; } -function linkTypeReferences(parameters, types) { +function linkTypeReferences(parameters) { parameters.each(function(p) { linkTypeReference(p, types); }); } -function linkTypeReference(schema, types) { +function linkTypeReference(schema) { if (schema.$ref) extend(schema, types[schema.$ref]); } @@ -270,4 +301,4 @@ function generateSignatureString(parameters) { }); return retval.join(", "); -} +}
\ No newline at end of file diff --git a/chrome/common/extensions/docs/overview.html b/chrome/common/extensions/docs/overview.html index 0c93713..faf8a37 100755 --- a/chrome/common/extensions/docs/overview.html +++ b/chrome/common/extensions/docs/overview.html @@ -1,154 +1,46 @@ <!DOCTYPE html> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> - <title>Extensions: Overview</title> - <link href="css/ApiRefStyles.css" rel="stylesheet" type="text/css"> -</head> -<body> - - <div id="container"> - <a name="top"> </a> - - <!-- API HEADER --> - <div id="pageHeader"> - <!-- BREADCRUMB --> - <!-- TODO: Fix these hrefs --> - <div id="breadcrumbs"> - <a href="./index.html">Google Chrome Extensions</a> > - Overview - </div> - <div id="searchbox"> - <form action="http://www.google.com/cse" id="cse-search-box"> - <div> - <input type="hidden" name="cx" value="002967670403910741006:61_cvzfqtno" /> - <input type="hidden" name="ie" value="UTF-8" /> - <input type="text" name="q" size="31" /> - <input type="submit" name="sa" value="Search" /> - </div> - </form> - - <script type="text/javascript" src="http://www.google.com/jsapi"></script> - <script type="text/javascript">google.load("elements", "1", {packages: "transliteration"});</script> - <script type="text/javascript" src="http://www.google.com/coop/cse/t13n?form=cse-search-box&t13n_langs=en"></script> - <script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&lang=en"></script> - </div> - <div id="pageTitle"> - <h1>Overview</h1> - </div> - </div> <!-- /pageHeader --> - - <div id="pageContent"> - <!-- SIDENAV --> - <div id="leftNav"> - <ul> - <li> Overview </li> - <li> Get Started </li> - <li> Developer's Guide </li> - <li> Reference - <ul> - <li> chrome.* APIs - </li> - </ul> - </li> - </ul> - </div> - - <div id="mainColumn"> - <!-- TABLE OF CONTENTS --> - <div id="toc"> - <p>Contents</p> - [PENDING: links to all h2s and h3s should go here] - </div> - <!-- /TABLE OF CONTENTS --> - - - <!-- CONTENT --> -<p> -[PENDING: technical overview to be provided] -</p> - -<p> -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce sed -elit felis. Vestibulum porta mauris eget mi placerat a condimentum leo -semper. Ut scelerisque, ipsum in cursus semper, lectus enim molestie -ante, a porttitor dolor neque sit amet lorem. Integer dignissim gravida -eros ac rhoncus. Curabitur porttitor hendrerit dolor nec aliquam. Ut -vulputate ultrices eros eu ultrices. Pellentesque tempor mattis -odio in blandit. Proin nulla metus, tristique eget iaculis gravida, -varius at leo. Ut dolor mi, auctor et scelerisque vitae, volutpat -eleifend magna. Pellentesque habitant morbi tristique senectus et -netus et malesuada fames ac turpis egestas. Morbi ut risus nec massa -consectetur accumsan sed non est. Fusce ornare eros et felis dignissim -convallis. Maecenas condimentum purus eget nisl condimentum vitae ornare -diam sollicitudin. Nulla et dictum ante. In lacus odio, dapibus vel -faucibus at, posuere id enim. Nulla tincidunt felis id lectus convallis -vulputate. Phasellus libero dui, posuere sollicitudin egestas eget, -blandit in urna. Sed cursus tellus sed diam hendrerit pulvinar. -</p> - -<p> -Nam tincidunt mollis aliquam. Suspendisse bibendum dignissim dui, -ac mollis ligula fringilla sit amet. Pellentesque dapibus lobortis -dignissim. Cras eu lorem a ligula imperdiet ultricies. Phasellus ipsum -mi, accumsan quis dignissim eu, commodo ut mi. Nulla sagittis aliquet -malesuada. Ut lobortis tellus vitae dolor venenatis eu ullamcorper -lorem gravida. Quisque non pharetra velit. Maecenas elit risus, -ultricies in sagittis eget, facilisis sed neque. Quisque feugiat porta -pharetra. Vestibulum lorem magna, pellentesque et mattis sit amet, -euismod et dui. -</p> - -<p> -Phasellus consectetur dolor auctor mi luctus eu auctor velit -aliquam. Donec malesuada laoreet risus, et facilisis massa rhoncus sit -amet. Vivamus sit amet fermentum lorem. Morbi nulla quam, ultricies -malesuada scelerisque a, convallis vitae nisl. Pellentesque consequat -libero sit amet lectus convallis varius. Donec at mi orci. Duis malesuada -massa nulla. Nam vel tellus mauris. Suspendisse potenti. Cras euismod, -orci volutpat ornare condimentum, eros nibh iaculis lectus, ac euismod -nibh eros nec turpis. Nullam at est elit, quis sagittis est. -</p> - -<p> -Donec aliquet, velit in elementum semper, purus metus laoreet -nisl, in aliquet nulla erat eu quam. Fusce iaculis, augue quis -tristique posuere, massa tortor congue lacus, ac scelerisque -velit tortor eget lorem. Praesent in massa enim, fermentum imperdiet -ligula. Suspendisse purus sapien, sagittis eu condimentum ut, scelerisque -vel purus. Vestibulum ornare faucibus metus eu rutrum. Maecenas convallis -felis vitae lorem tincidunt vitae interdum nunc adipiscing. Proin -a egestas enim. Proin mattis mollis urna id lobortis. Sed id libero -nec purus sollicitudin tristique id vitae purus. Duis rutrum semper -mollis. Nam posuere nulla at mi egestas nec auctor mauris pretium. Ut nec -quam lectus. Vivamus laoreet ligula ut odio ultricies aliquet. Aliquam -erat volutpat. Nunc quis lectus vitae massa consectetur tempus vitae -eu mi. -</p> - -<p> -Duis vel nunc ut orci pretium eleifend ac posuere nisi. Curabitur in -lorem in sapien lobortis facilisis. Vestibulum varius sapien lacus. Morbi -urna sapien, iaculis a mollis eget, pharetra id sapien. Nulla bibendum, -tellus non tristique sodales, eros erat elementum nisl, et ultricies velit -mauris nec odio. Aliquam nisi turpis, accumsan sit amet condimentum non, -volutpat eget arcu. Praesent euismod elementum lorem, in mollis justo -lacinia ut. Cum sociis natoque penatibus et magnis dis parturient montes, -nascetur ridiculus mus. Mauris aliquet elit sit amet dolor iaculis -viverra vehicula magna accumsan. Praesent tempor imperdiet mauris, eu -viverra mauris ultricies sed. In quam lacus, porttitor in facilisis id, -blandit vel massa. Maecenas rutrum ullamcorper enim eu bibendum. Fusce -mauris velit, eleifend vitae consectetur et, condimentum at nunc. Proin -id hendrerit turpis. -</p> - - </div> <!-- /mainColumn --> - </div> <!-- /pageContent --> - <div id="pageFooter" --> - Copyright 2009 - <br /> - TBD: copyright/license should be automatically included here - </div> <!-- /pageFooter --> - </div> <!-- /container --> -</body> +<!-- This page is a placeholder for generated extensions api doc. Note: + 1) The <head> information in this page is significant, should be uniform + across api docs and should be edited only with knowledge of the + templating mechanism. + 2) The <body> tag *must* retain id="body" + 3) All <body>.innerHTML is genereated as an rendering step. If viewed in a + browser, it will be re-generated from the template, json schema and + authored overview content. + 4) The <body>.innerHTML is also generated by an offline step so that this + page may easily be indexed by search engines. + + TODO(rafaelw): Abstract this into a "pageshell" that becomes the single + version of page template shell and the "instance" pages (bookmarks.html, + etc...) can be generated with a build step. +--> +<!-- <html> must retain id="template --> +<html xmlns="http://www.w3.org/1999/xhtml"> + <!-- <head> data is significant and loads the needed libraries and styles --> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title jscontent="pageTitle">pageTitle</title> + <link href="css/ApiRefStyles.css" rel="stylesheet" type="text/css"> + <script type="text/javascript" + src="../../../third_party/jstemplate/jstemplate_compiled.js"> + </script> + <script type="text/javascript" src="js/api_page_generator.js"></script> + <script> +// Re-render the page if the user-agent is chrome and it is being served as +// a file:/// scheme. This allows both the initial render to static as well +// as dynamic re-rendering for developers/doc-writers working on local changes. +window.onload = function() { + var chrome = navigator.userAgent.indexOf("Chrome") > -1; + var fileScheme = location.protocol == "file:"; + var regenerate = chrome && fileScheme; + //if (regenerate) { + window.renderPage(); + //} +} + </script> + </head> + <!-- <body> content is completely generated. Do not edit, as it will be + and rewritten. --> + <body class="hidden"> + </body> </html> diff --git a/chrome/common/extensions/docs/reference/pageActions.html b/chrome/common/extensions/docs/pageActions.html index c05e097..faf8a37 100755 --- a/chrome/common/extensions/docs/reference/pageActions.html +++ b/chrome/common/extensions/docs/pageActions.html @@ -19,12 +19,25 @@ <!-- <head> data is significant and loads the needed libraries and styles --> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> - <title jscontent="namespace">chrome.apiname</title> - <link href="../css/ApiRefStyles.css" rel="stylesheet" type="text/css"> + <title jscontent="pageTitle">pageTitle</title> + <link href="css/ApiRefStyles.css" rel="stylesheet" type="text/css"> <script type="text/javascript" - src="../../../../third_party/jstemplate/jstemplate_compiled.js"> + src="../../../third_party/jstemplate/jstemplate_compiled.js"> </script> - <script type="text/javascript" src="../js/api_page_generator.js"></script> + <script type="text/javascript" src="js/api_page_generator.js"></script> + <script> +// Re-render the page if the user-agent is chrome and it is being served as +// a file:/// scheme. This allows both the initial render to static as well +// as dynamic re-rendering for developers/doc-writers working on local changes. +window.onload = function() { + var chrome = navigator.userAgent.indexOf("Chrome") > -1; + var fileScheme = location.protocol == "file:"; + var regenerate = chrome && fileScheme; + //if (regenerate) { + window.renderPage(); + //} +} + </script> </head> <!-- <body> content is completely generated. Do not edit, as it will be and rewritten. --> diff --git a/chrome/common/extensions/docs/reference/bookmarks.html b/chrome/common/extensions/docs/reference/bookmarks.html deleted file mode 100755 index c771bc1..0000000 --- a/chrome/common/extensions/docs/reference/bookmarks.html +++ /dev/null @@ -1,32 +0,0 @@ -<!DOCTYPE html> -<!-- This page is a placeholder for generated extensions api doc. Note: - 1) The <head> information in this page is significant, should be uniform - across api docs and should be edited only with knowledge of the - templating mechanism. - 2) The <body> tag *must* retain id="body" - 3) All <body>.innerHTML is genereated as an rendering step. If viewed in a - browser, it will be re-generated from the template, json schema and - authored overview content. - 4) The <body>.innerHTML is also generated by an offline step so that this - page may easily be indexed by search engines. - - TODO(rafaelw): Abstract this into a "pageshell" that becomes the single - version of page template shell and the "instance" pages (bookmarks.html, - etc...) can be generated with a build step. ---> -<html xmlns="http://www.w3.org/1999/xhtml"> - <!-- <head> data is significant and loads the needed libraries and styles --> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> - <title jscontent="namespace">chrome.apiname</title> - <link href="../css/ApiRefStyles.css" rel="stylesheet" type="text/css"> - <script type="text/javascript" - src="../../../../third_party/jstemplate/jstemplate_compiled.js"> - </script> - <script type="text/javascript" src="../js/api_page_generator.js"></script> - </head> - <!-- <body> content is completely generated. Do not edit, as it will be - and rewritten. --> - <body class="hidden"> - </body> -</html> diff --git a/chrome/common/extensions/docs/reference/self.html b/chrome/common/extensions/docs/self.html index c05e097..faf8a37 100755 --- a/chrome/common/extensions/docs/reference/self.html +++ b/chrome/common/extensions/docs/self.html @@ -19,12 +19,25 @@ <!-- <head> data is significant and loads the needed libraries and styles --> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> - <title jscontent="namespace">chrome.apiname</title> - <link href="../css/ApiRefStyles.css" rel="stylesheet" type="text/css"> + <title jscontent="pageTitle">pageTitle</title> + <link href="css/ApiRefStyles.css" rel="stylesheet" type="text/css"> <script type="text/javascript" - src="../../../../third_party/jstemplate/jstemplate_compiled.js"> + src="../../../third_party/jstemplate/jstemplate_compiled.js"> </script> - <script type="text/javascript" src="../js/api_page_generator.js"></script> + <script type="text/javascript" src="js/api_page_generator.js"></script> + <script> +// Re-render the page if the user-agent is chrome and it is being served as +// a file:/// scheme. This allows both the initial render to static as well +// as dynamic re-rendering for developers/doc-writers working on local changes. +window.onload = function() { + var chrome = navigator.userAgent.indexOf("Chrome") > -1; + var fileScheme = location.protocol == "file:"; + var regenerate = chrome && fileScheme; + //if (regenerate) { + window.renderPage(); + //} +} + </script> </head> <!-- <body> content is completely generated. Do not edit, as it will be and rewritten. --> diff --git a/chrome/common/extensions/docs/reference/index.html b/chrome/common/extensions/docs/static/api_index.html index d30dc7f..6b7440c 100755 --- a/chrome/common/extensions/docs/reference/index.html +++ b/chrome/common/extensions/docs/static/api_index.html @@ -1,47 +1,3 @@ -<!DOCTYPE html> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> - <title>Extensions: Reference</title> - <link href="../css/ApiRefStyles.css" rel="stylesheet" type="text/css"> -</head> -<body> - - <div id="container"> - <a name="top"> </a> - - <!-- API HEADER --> - <div id="pageHeader"> - <!-- BREADCRUMB --> - <!-- TODO: Fix these hrefs --> - <div id="breadcrumbs"> - <a href="./index.html">Google Chrome Extensions</a> > - Reference - </div> - <div id="pageTitle"> - <h1>Reference</h1> - </div> - </div> <!-- /pageHeader --> - - <div id="pageContent"> - <!-- SIDENAV --> - <div id="leftNav"> - <ul> - <li> Overview </li> - <li> Get Started </li> - <li> Developer's Guide </li> - <li> Reference - <ul> - <li> chrome.* APIs - </li> - </ul> - </li> - </ul> - </div> - - <div id="mainColumn"> - - <!-- CONTENT --> <p> [PENDING: links to reference doc — for example, <a href="chrome-api-index.html">chrome.* APIs</a> @@ -77,15 +33,4 @@ lorem gravida. Quisque non pharetra velit. Maecenas elit risus, ultricies in sagittis eget, facilisis sed neque. Quisque feugiat porta pharetra. Vestibulum lorem magna, pellentesque et mattis sit amet, euismod et dui. -</p> - - </div> <!-- /mainColumn --> - </div> <!-- /pageContent --> - <div id="pageFooter" --> - Copyright 2009 - <br /> - TBD: copyright/license should be automatically included here - </div> <!-- /pageFooter --> - </div> <!-- /container --> -</body> -</html> +</p>
\ No newline at end of file diff --git a/chrome/common/extensions/docs/reference/bookmarks_overview.html b/chrome/common/extensions/docs/static/bookmarks.html index 073f1ca..073f1ca 100755 --- a/chrome/common/extensions/docs/reference/bookmarks_overview.html +++ b/chrome/common/extensions/docs/static/bookmarks.html diff --git a/chrome/common/extensions/docs/reference/chrome-api-index.html b/chrome/common/extensions/docs/static/devguide.html index f0368b6..a4c9646b 100755 --- a/chrome/common/extensions/docs/reference/chrome-api-index.html +++ b/chrome/common/extensions/docs/static/devguide.html @@ -1,54 +1,5 @@ -<!DOCTYPE html> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> - <title>Extensions: chrome.* APIs</title> - <link href="../css/ApiRefStyles.css" rel="stylesheet" type="text/css"> -</head> -<body> - - <div id="container"> - <a name="top"> </a> - - <!-- API HEADER --> - <div id="pageHeader"> - <!-- BREADCRUMB --> - <!-- TODO: Fix these hrefs --> - <div id="breadcrumbs"> - <a href="../index.html">Google Chrome Extensions</a> > - <a href="./index.html">Reference</a> > - chrome.* APIs - </div> - <div id="pageTitle"> - <h1>chrome.* APIs</h1> - </div> - </div> <!-- /pageHeader --> - - <div id="pageContent"> - <!-- SIDENAV --> - <div id="leftNav"> - <ul> - <li> Overview </li> - <li> Get Started </li> - <li> Developer's Guide </li> - <li> Reference - <ul> - <li> chrome.* APIs - </li> - </ul> - </li> - </ul> - </div> - - <div id="mainColumn"> - - <!-- CONTENT --> <p> -[PENDING: links to reference doc — -for example, <a href="bookmarks.html">chrome.bookmarks</a> -— go here. -Discuss conventions -- e.g. how to handle events, -how almost all methods are asynchronous, etc.] +[PENDING: intro to the guide goes here. say where to go. lots o' links.] </p> <p> @@ -80,15 +31,4 @@ lorem gravida. Quisque non pharetra velit. Maecenas elit risus, ultricies in sagittis eget, facilisis sed neque. Quisque feugiat porta pharetra. Vestibulum lorem magna, pellentesque et mattis sit amet, euismod et dui. -</p> - - </div> <!-- /mainColumn --> - </div> <!-- /pageContent --> - <div id="pageFooter" --> - Copyright 2009 - <br /> - TBD: copyright/license should be automatically included here - </div> <!-- /pageFooter --> - </div> <!-- /container --> -</body> -</html> +</p>
\ No newline at end of file diff --git a/chrome/common/extensions/docs/helloworld.html b/chrome/common/extensions/docs/static/getstarted.html index 01a2850..7c843fb 100755 --- a/chrome/common/extensions/docs/helloworld.html +++ b/chrome/common/extensions/docs/static/getstarted.html @@ -1,77 +1,3 @@ -<!DOCTYPE html> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> - <title>Extensions: Getting Started</title> - <link href="css/ApiRefStyles.css" rel="stylesheet" type="text/css"> -</head> -<body> - - <div id="container"> - <a name="top"> </a> - - <!-- API HEADER --> - <div id="pageHeader"> - <!-- BREADCRUMB --> - <!-- TODO: Fix these hrefs --> - <div id="breadcrumbs"> - <a href="./index.html">Google Chrome Extensions</a> > - <a href="devguide.html">Developer's Guide</a> > - Get Started (Hello, World!) - </div> - <div id="searchbox"> - <form action="http://www.google.com/cse" id="cse-search-box"> - <div> - <input type="hidden" name="cx" value="002967670403910741006:61_cvzfqtno" /> - <input type="hidden" name="ie" value="UTF-8" /> - <input type="text" name="q" size="31" /> - <input type="submit" name="sa" value="Search" /> - </div> - </form> - - <script type="text/javascript" src="http://www.google.com/jsapi"></script> - <script type="text/javascript">google.load("elements", "1", {packages: "transliteration"});</script> - <script type="text/javascript" src="http://www.google.com/coop/cse/t13n?form=cse-search-box&t13n_langs=en"></script> - <script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&lang=en"></script> - </div> - <div id="pageTitle"> - <h1>Get Started (Hello, World!) - </div> - </div> <!-- /pageHeader --> - - <div id="pageContent"> - <!-- SIDENAV --> - <div id="leftNav"> - <ul> - <li> Overview </li> - <li> Get Started </li> - <li> Developer's Guide </li> - <li> Reference - <ul> - <li> chrome.* APIs - </li> - </ul> - </li> - </ul> - </div> - - <div id="mainColumn"> - <!-- TABLE OF CONTENTS --> - <div id="toc"> - <p>Contents</p> -<ol> - <li> <a href="#browser">Get your browser ready</a> </li> - <li> <a href="#load">Create and load an extension</a> </li> - <li> <a href="#code">Add code to the extension</a> </li> - <li> <a href="#debug">Debug the extension</a> </li> - <li> <a href="#summary">Summary</a> </li> -</ol> - </div> - <!-- /TABLE OF CONTENTS --> - - - <!-- CONTENT --> - <p> This tutorial walks you through creating a simple extension. To complete this tutorial, you must have Windows; @@ -347,15 +273,3 @@ what it means, what else we would've done if this were a real extension (e.g. package it), and where to find more information. Suggest where to go next.]</p> - - - </div> <!-- /mainColumn --> - </div> <!-- /pageContent --> - <div id="pageFooter" --> - Copyright 2009 - <br /> - TBD: copyright/license should be automatically included here - </div> <!-- /pageFooter --> - </div> <!-- /container --> -</body> -</html> diff --git a/chrome/common/extensions/docs/static/index.html b/chrome/common/extensions/docs/static/index.html new file mode 100755 index 0000000..94a407c --- /dev/null +++ b/chrome/common/extensions/docs/static/index.html @@ -0,0 +1,66 @@ +<p> If you want to customize Google Chrome, you've come to the right place. An <em>extension</em> is a bundle of web code (HTML, JavaScript, perhaps some CSS) that lets you add functionality or a bit of user interface (usually both) to the browser. <a href="http://dev.chromium.org/developers/design-documents/extensions/samples">Examples of extensions</a> include a mail checker, a newsfeed subscriber, and a status monitor.<br> + </p> + +<h3>Contents</h3> + <p> + This documentation is just being written; here's what we have so far. + You might also want to look at <a href="#other">Other resources</a>. + If you just want to <em>make</em> something, + go to <a href="helloworld.html">Get Started</a>. + </p> + + <ul> + <li><a href="overview.html">Overview</a></li> + <li><a href="helloworld.html">Get Started</a> (Hello, World!)</li> + <li><a href="devguide.html">Developer's Guide</a></li> + <li><a href="reference/index.html">Reference</a></li> + <ul> + <li>Supported APIs</li> + <ul> + <li>standard JavaScript libraries</li> + <li>XMLHttpRequest</li> + <li>anything in WebKit</li> + <li>anything in V8</li> + <li>anything you put in your zipfile</li> + </ul> + <li><a href="reference/chrome-api-index.html">chrome.* APIs</a> + <ul> + <li>[PENDING: fill this out automatically. In the meantime, start at the <a href="reference/bookmarks.html">chrome.bookmarks</a> page and click the links in the left column.]</li> + </ul> + </li> + </ul> + <li>Samples</li> + <ul> + <li>#1</li> + <li>#2</li> + </ul> + </ul> + + <h3 id="other">Other resources</h3> + + <ul> + <li><a href="http://dev.chromium.org/developers/design-documents/extensions">Design documents</a>:</li> + <ul> + <li><a href="http://dev.chromium.org/developers/design-documents/extensions/howto">HOWTO</a>: The precursor to Get Started [PENDING: make sure it's still useful]</li> + <li><a href="http://dev.chromium.org/developers/design-documents/extensions/packaging">Packaging</a>: [PENDING: might be obsolete]</li> + <li>APIs:</li> + <ul> + <li><a href="http://dev.chromium.org/developers/design-documents/extensions/bookmarks-api">Bookmarks</a></li> + <li><a href="http://dev.chromium.org/developers/design-documents/extensions/events">Events</a></li> + </ul> + <ul> + <li><a href="http://dev.chromium.org/developers/design-documents/extensions/tabs-api">Tabs</a></li> + </ul> + <ul> + <li><a href="http://dev.chromium.org/developers/design-documents/extensions/windows-api">Windows</a></li> + </ul> + <li>Features:</li> + <ul> + <li><a href="http://dev.chromium.org/developers/design-documents/extensions/toolstrips">Toolstrips</a>: Add UI to the toolbar area</li> + <li><a href="http://dev.chromium.org/developers/design-documents/extensions/content-scripts">Content scripts</a>: Run code within the context of web pages</li> + <li><a href="http://dev.chromium.org/developers/design-documents/extensions/background-pages">Background pages</a>: Run code that's not directly related to the UI</li> + <li><a href="http://dev.chromium.org/developers/design-documents/extensions/cross-origin-xhr">Cross-Origin XMLHttpRequest</a>: Communicate with multiple domains</li> + </ul> + </ul> + <li><a href="http://groups.google.com/group/chromium-extensions">chromium-extensions</a> (discussion group)</li> + </ul> diff --git a/chrome/common/extensions/docs/static/overview.html b/chrome/common/extensions/docs/static/overview.html new file mode 100755 index 0000000..b69bd49 --- /dev/null +++ b/chrome/common/extensions/docs/static/overview.html @@ -0,0 +1,77 @@ +<p> +[PENDING: technical overview to be provided] +</p> + +<p> +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce sed +elit felis. Vestibulum porta mauris eget mi placerat a condimentum leo +semper. Ut scelerisque, ipsum in cursus semper, lectus enim molestie +ante, a porttitor dolor neque sit amet lorem. Integer dignissim gravida +eros ac rhoncus. Curabitur porttitor hendrerit dolor nec aliquam. Ut +vulputate ultrices eros eu ultrices. Pellentesque tempor mattis +odio in blandit. Proin nulla metus, tristique eget iaculis gravida, +varius at leo. Ut dolor mi, auctor et scelerisque vitae, volutpat +eleifend magna. Pellentesque habitant morbi tristique senectus et +netus et malesuada fames ac turpis egestas. Morbi ut risus nec massa +consectetur accumsan sed non est. Fusce ornare eros et felis dignissim +convallis. Maecenas condimentum purus eget nisl condimentum vitae ornare +diam sollicitudin. Nulla et dictum ante. In lacus odio, dapibus vel +faucibus at, posuere id enim. Nulla tincidunt felis id lectus convallis +vulputate. Phasellus libero dui, posuere sollicitudin egestas eget, +blandit in urna. Sed cursus tellus sed diam hendrerit pulvinar. +</p> + +<p> +Nam tincidunt mollis aliquam. Suspendisse bibendum dignissim dui, +ac mollis ligula fringilla sit amet. Pellentesque dapibus lobortis +dignissim. Cras eu lorem a ligula imperdiet ultricies. Phasellus ipsum +mi, accumsan quis dignissim eu, commodo ut mi. Nulla sagittis aliquet +malesuada. Ut lobortis tellus vitae dolor venenatis eu ullamcorper +lorem gravida. Quisque non pharetra velit. Maecenas elit risus, +ultricies in sagittis eget, facilisis sed neque. Quisque feugiat porta +pharetra. Vestibulum lorem magna, pellentesque et mattis sit amet, +euismod et dui. +</p> + +<p> +Phasellus consectetur dolor auctor mi luctus eu auctor velit +aliquam. Donec malesuada laoreet risus, et facilisis massa rhoncus sit +amet. Vivamus sit amet fermentum lorem. Morbi nulla quam, ultricies +malesuada scelerisque a, convallis vitae nisl. Pellentesque consequat +libero sit amet lectus convallis varius. Donec at mi orci. Duis malesuada +massa nulla. Nam vel tellus mauris. Suspendisse potenti. Cras euismod, +orci volutpat ornare condimentum, eros nibh iaculis lectus, ac euismod +nibh eros nec turpis. Nullam at est elit, quis sagittis est. +</p> + +<p> +Donec aliquet, velit in elementum semper, purus metus laoreet +nisl, in aliquet nulla erat eu quam. Fusce iaculis, augue quis +tristique posuere, massa tortor congue lacus, ac scelerisque +velit tortor eget lorem. Praesent in massa enim, fermentum imperdiet +ligula. Suspendisse purus sapien, sagittis eu condimentum ut, scelerisque +vel purus. Vestibulum ornare faucibus metus eu rutrum. Maecenas convallis +felis vitae lorem tincidunt vitae interdum nunc adipiscing. Proin +a egestas enim. Proin mattis mollis urna id lobortis. Sed id libero +nec purus sollicitudin tristique id vitae purus. Duis rutrum semper +mollis. Nam posuere nulla at mi egestas nec auctor mauris pretium. Ut nec +quam lectus. Vivamus laoreet ligula ut odio ultricies aliquet. Aliquam +erat volutpat. Nunc quis lectus vitae massa consectetur tempus vitae +eu mi. +</p> + +<p> +Duis vel nunc ut orci pretium eleifend ac posuere nisi. Curabitur in +lorem in sapien lobortis facilisis. Vestibulum varius sapien lacus. Morbi +urna sapien, iaculis a mollis eget, pharetra id sapien. Nulla bibendum, +tellus non tristique sodales, eros erat elementum nisl, et ultricies velit +mauris nec odio. Aliquam nisi turpis, accumsan sit amet condimentum non, +volutpat eget arcu. Praesent euismod elementum lorem, in mollis justo +lacinia ut. Cum sociis natoque penatibus et magnis dis parturient montes, +nascetur ridiculus mus. Mauris aliquet elit sit amet dolor iaculis +viverra vehicula magna accumsan. Praesent tempor imperdiet mauris, eu +viverra mauris ultricies sed. In quam lacus, porttitor in facilisis id, +blandit vel massa. Maecenas rutrum ullamcorper enim eu bibendum. Fusce +mauris velit, eleifend vitae consectetur et, condimentum at nunc. Proin +id hendrerit turpis. +</p> diff --git a/chrome/common/extensions/docs/reference/pageActions_overview.html b/chrome/common/extensions/docs/static/pageActions.html index 997b579..997b579 100755 --- a/chrome/common/extensions/docs/reference/pageActions_overview.html +++ b/chrome/common/extensions/docs/static/pageActions.html diff --git a/chrome/common/extensions/docs/reference/self_overview.html b/chrome/common/extensions/docs/static/self.html index 997b579..997b579 100755 --- a/chrome/common/extensions/docs/reference/self_overview.html +++ b/chrome/common/extensions/docs/static/self.html diff --git a/chrome/common/extensions/docs/reference/tabs_overview.html b/chrome/common/extensions/docs/static/tabs.html index 997b579..997b579 100755 --- a/chrome/common/extensions/docs/reference/tabs_overview.html +++ b/chrome/common/extensions/docs/static/tabs.html diff --git a/chrome/common/extensions/docs/reference/windows_overview.html b/chrome/common/extensions/docs/static/windows.html index 997b579..997b579 100755 --- a/chrome/common/extensions/docs/reference/windows_overview.html +++ b/chrome/common/extensions/docs/static/windows.html diff --git a/chrome/common/extensions/docs/reference/tabs.html b/chrome/common/extensions/docs/tabs.html index c05e097..faf8a37 100755 --- a/chrome/common/extensions/docs/reference/tabs.html +++ b/chrome/common/extensions/docs/tabs.html @@ -19,12 +19,25 @@ <!-- <head> data is significant and loads the needed libraries and styles --> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> - <title jscontent="namespace">chrome.apiname</title> - <link href="../css/ApiRefStyles.css" rel="stylesheet" type="text/css"> + <title jscontent="pageTitle">pageTitle</title> + <link href="css/ApiRefStyles.css" rel="stylesheet" type="text/css"> <script type="text/javascript" - src="../../../../third_party/jstemplate/jstemplate_compiled.js"> + src="../../../third_party/jstemplate/jstemplate_compiled.js"> </script> - <script type="text/javascript" src="../js/api_page_generator.js"></script> + <script type="text/javascript" src="js/api_page_generator.js"></script> + <script> +// Re-render the page if the user-agent is chrome and it is being served as +// a file:/// scheme. This allows both the initial render to static as well +// as dynamic re-rendering for developers/doc-writers working on local changes. +window.onload = function() { + var chrome = navigator.userAgent.indexOf("Chrome") > -1; + var fileScheme = location.protocol == "file:"; + var regenerate = chrome && fileScheme; + //if (regenerate) { + window.renderPage(); + //} +} + </script> </head> <!-- <body> content is completely generated. Do not edit, as it will be and rewritten. --> diff --git a/chrome/common/extensions/docs/template/api_template.html b/chrome/common/extensions/docs/template/api_template.html index ed0afd3..4f57d23 100755 --- a/chrome/common/extensions/docs/template/api_template.html +++ b/chrome/common/extensions/docs/template/api_template.html @@ -6,9 +6,9 @@ <!-- BREADCRUMB --> <!-- TODO: Fix these hrefs --> <div id="breadcrumbs"> - <a href="../index.html">Google Chrome Extensions</a> > - <a href="./index.html">Reference</a> > - <a href="chrome-api-index.html">chrome.* APIs</a> > + <a href="index.html">Google Chrome Extensions</a> > + <a href="reference_index.html">Reference</a> > + <a href="api_index.html">chrome.* APIs</a> > <span jscontent="namespace">chrome.apiname</span> </div> <div id="searchbox"> @@ -27,7 +27,7 @@ <script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&lang=en"></script> </div> <div id="pageTitle"> - <h1 jscontent="namespace">chrome.apiname</h1> + <h1 jscontent="h1Header">chrome.apiname</h1> </div> </div> <!-- /pageHeader --> @@ -35,15 +35,15 @@ <!-- SIDENAV --> <div id="leftNav"> <ul> - <li> Overview </li> - <li> Get Started </li> - <li> Developer's Guide </li> + <li> <a href="overview.html">Overview</a></li> + <li> <a href="getstarted.html">Get Started</a></li> + <li> <a href="devguide.html">Developer's Guide</a></li> <li> Reference <ul> - <li> chrome.* APIs + <li> <a href="api_index.html">Extension APIs</a> <ul> <li jsselect="apiModules"> - <a jscontent="name" jsvalues=".href:module + '.html'">Foo</a> + <a jscontent="name" jsvalues=".href:module + '.html'">api module</a> </li> </ul> </li> @@ -54,7 +54,7 @@ <div id="mainColumn"> <!-- TABLE OF CONTENTS --> - <div id="toc"> + <div id="toc" jsselect="apiDefinition"> <p>Contents</p> <ol> <li> @@ -99,125 +99,41 @@ <!-- /TABLE OF CONTENTS --> - <!-- OVERVIEW PLACEHOLDER -- THIS GET REPLACED AUTHORED CONTENT --> - <div id="overview"></div> + <!-- STATIC CONTENT PLACEHOLDER --> + <div id="static"></div> + <!-- API PAGE --> + <div class="apiPage" jsselect="apiDefinition"> + + <!-- METHODS --> + <div class="apiGroup" id="methods"> + <a name="#methods"></a> + <h2>Methods</h2> - <!-- METHODS --> - <div class="apiGroup" id="methods"> - <a name="#methods"></a> - <h2>Methods</h2> + <!-- iterates over all functions --> + <div class="apiItem" jsselect="functions"> + <a jsvalues=".name:'method-' + name"></a> <!-- method-anchor --> + <h3 jscontent="name">method name</h3> - <!-- iterates over all functions --> - <div class="apiItem" jsselect="functions"> - <a jsvalues=".name:'method-' + name"></a> <!-- method-anchor --> - <h3 jscontent="name">method name</h3> + <div class="summary"><span jsdisplay="returns" jscontent="returns.typeName">void</span> + <!-- Note: intentionally longer 80 columns --> + <span jscontent="fullName">chrome.module.methodName</span>(<span jsselect="parameters" jsvalues="class:optional ? 'optional' : ''"><span jsdisplay="$index">, </span><span jscontent="typeName"></span> + <var><span jscontent="name"></span></var></span>)</div> - <div class="summary"><span jsdisplay="returns" jscontent="returns.typeName">void</span> - <!-- Note: intentionally longer 80 columns --> - <span jscontent="fullName">chrome.module.methodName</span>(<span jsselect="parameters" jsvalues="class:optional ? 'optional' : ''"><span jsdisplay="$index">, </span><span jscontent="typeName"></span> - <var><span jscontent="name"></span></var></span>)</div> - - <div class="description"> - <p class="todo" jsdisplay="!description">Undocumented.</p> - <p jsdisplay="description" jsvalues=".innerHTML:description"> - A description from the json schema def of the function goes here. - </p> - - <!-- PARAMETERS --> - <h4>Parameters</h4> - <dl> - <div jsselect="parameters"> - <dt> - <!-- Note: intentionally longer 80 columns --> - <var jscontent="name">paramName</var><em> - (<span class="optional" jsdisplay="optional">optional </span><span jscontent="typeName">paramType</span>)</em> - </dt> - <dd class="todo" jsdisplay="!$this.description"> - Undocumented. - </dd> - <dd jsdisplay="$this.description" - jsvalues=".innerHTML:$this.description"> - Description of this parameter from the json schema. - </dd> - - <!-- OBJECT PROPERTIES --> - <dd jsdisplay="_propertyList"> - <dl> - <div jsselect="_propertyList"> - <dt> - <!-- Note: intentionally longer 80 columns --> - <var jscontent="name">paramName</var><em> - (<span class="optional" jsdisplay="optional">optional </span><span jscontent="typeName">paramType</span>)</em> - </dt> - <dd class="todo" jsdisplay="!$this.description"> - Undocumented. - </dd> - <dd jsdisplay="$this.description" - jsvalues=".innerHTML:$this.description"> - Description of this parameter from the json schema. - </dd> - </div> - </dl> - </dd> - </div> - </dl> - - <!-- RETURNS --> - <h4 jsdisplay="returns">Returns</h4> - <dl> - <div jsselect="returns"> - <dt> - <!-- Note: intentionally longer 80 columns --> - <var jscontent="name">paramName</var> - <em>(<span jscontent="typeName">paramType</span>)</em> - </dt> - <dd class="todo" jsdisplay="!$this.description"> - Undocumented. - </dd> - <dd jsdisplay="$this.description" - jsvalues=".innerHTML:$this.description"> - Description of this parameter from the json schema. - </dd> - - <!-- OBJECT PROPERTIES --> - <dd jsdisplay="_propertyList"> - <dl> - <div jsselect="_propertyList"> - <dt> - <!-- Note: intentionally longer 80 columns --> - <var jscontent="name">paramName</var><em> - (<span class="optional" jsdisplay="optional">optional </span><span jscontent="typeName">paramType</span>)</em> - </dt> - <dd class="todo" jsdisplay="!$this.description"> - Undocumented. - </dd> - <dd jsdisplay="$this.description" - jsvalues=".innerHTML:$this.description"> - Description of this parameter from the json schema. - </dd> - </div> - </dl> - </dd> - </div> - </dl> - - <!-- CALLBACK --> - <div jsdisplay="callbackParameters"> - <h4>Callback function</h4> - <p> - If you specify the <em>callback</em> parameter, - it should specify a function that looks like this: + <div class="description"> + <p class="todo" jsdisplay="!description">Undocumented.</p> + <p jsdisplay="description" jsvalues=".innerHTML:description"> + A description from the json schema def of the function goes here. </p> - - <!-- Note: intentionally longer 80 columns --> - <pre>function(<span jscontent="callbackSignature">Type param1, Type param2</span>) <span class="subdued">{...}</span>);</pre> + + <!-- PARAMETERS --> + <h4>Parameters</h4> <dl> - <div jsselect="callbackParameters"> + <div jsselect="parameters"> <dt> <!-- Note: intentionally longer 80 columns --> <var jscontent="name">paramName</var><em> - (<span jscontent="typeName">paramType</span>)</em> + (<span class="optional" jsdisplay="optional">optional </span><span jscontent="typeName">paramType</span>)</em> </dt> <dd class="todo" jsdisplay="!$this.description"> Undocumented. @@ -226,6 +142,46 @@ jsvalues=".innerHTML:$this.description"> Description of this parameter from the json schema. </dd> + + <!-- OBJECT PROPERTIES --> + <dd jsdisplay="_propertyList"> + <dl> + <div jsselect="_propertyList"> + <dt> + <!-- Note: intentionally longer 80 columns --> + <var jscontent="name">paramName</var><em> + (<span class="optional" jsdisplay="optional">optional </span><span jscontent="typeName">paramType</span>)</em> + </dt> + <dd class="todo" jsdisplay="!$this.description"> + Undocumented. + </dd> + <dd jsdisplay="$this.description" + jsvalues=".innerHTML:$this.description"> + Description of this parameter from the json schema. + </dd> + </div> + </dl> + </dd> + </div> + </dl> + + <!-- RETURNS --> + <h4 jsdisplay="returns">Returns</h4> + <dl> + <div jsselect="returns"> + <dt> + <!-- Note: intentionally longer 80 columns --> + <var jscontent="name">paramName</var> + <em>(<span jscontent="typeName">paramType</span>)</em> + </dt> + <dd class="todo" jsdisplay="!$this.description"> + Undocumented. + </dd> + <dd jsdisplay="$this.description" + jsvalues=".innerHTML:$this.description"> + Description of this parameter from the json schema. + </dd> + <!-- OBJECT PROPERTIES --> <dd jsdisplay="_propertyList"> <dl> @@ -247,75 +203,122 @@ </dd> </div> </dl> - </div> - </div> <!-- /description --> + <!-- CALLBACK --> + <div jsdisplay="callbackParameters"> + <h4>Callback function</h4> + <p> + If you specify the <em>callback</em> parameter, + it should specify a function that looks like this: + </p> + + <!-- Note: intentionally longer 80 columns --> + <pre>function(<span jscontent="callbackSignature">Type param1, Type param2</span>) <span class="subdued">{...}</span>);</pre> + <dl> + <div jsselect="callbackParameters"> + <dt> + <!-- Note: intentionally longer 80 columns --> + <var jscontent="name">paramName</var><em> + (<span jscontent="typeName">paramType</span>)</em> + </dt> + <dd class="todo" jsdisplay="!$this.description"> + Undocumented. + </dd> + <dd jsdisplay="$this.description" + jsvalues=".innerHTML:$this.description"> + Description of this parameter from the json schema. + </dd> + <!-- OBJECT PROPERTIES --> + <dd jsdisplay="_propertyList"> + <dl> + <div jsselect="_propertyList"> + <dt> + <!-- Note: intentionally longer 80 columns --> + <var jscontent="name">paramName</var><em> + (<span class="optional" jsdisplay="optional">optional </span><span jscontent="typeName">paramType</span>)</em> + </dt> + <dd class="todo" jsdisplay="!$this.description"> + Undocumented. + </dd> + <dd jsdisplay="$this.description" + jsvalues=".innerHTML:$this.description"> + Description of this parameter from the json schema. + </dd> + </div> + </dl> + </dd> + </div> + </dl> + </div> - </div> <!-- /apiItem --> + </div> <!-- /description --> - </div> <!-- /apiGroup --> + </div> <!-- /apiItem --> - <!-- EVENTS --> - <div class="apiGroup" id="events"> - <a name="#events"></a> - <h2 id="events">Events</h2> + </div> <!-- /apiGroup --> - <!-- iterates over all events --> - <div jsselect="events" class="apiItem" jsselect="functions"> - <a jsvalues=".name:'event-' + name"></a> - <h3 jscontent="name">event name</h3> + <!-- EVENTS --> + <div class="apiGroup" id="events"> + <a name="#events"></a> + <h2 id="events">Events</h2> - <div class="summary"> - <!-- Note: intentionally longer 80 columns --> - <span class="subdued">chrome.bookmarks.</span><span jscontent="name">onEvent</span><span class="subdued">.addListener</span>(function(<span jscontent="callSignature">Type param1, Type param2</span>) <span class="subdued">{...}</span>); - </div> + <!-- iterates over all events --> + <div jsselect="events" class="apiItem" jsselect="functions"> + <a jsvalues=".name:'event-' + name"></a> + <h3 jscontent="name">event name</h3> - <div class="description"> - <p class="todo" jsdisplay="!description">Undocumented.</p> - <p jsdisplay="description" jsvalues=".innerHTML:description"> - A description from the json schema def of the event goes here. - </p> + <div class="summary"> + <!-- Note: intentionally longer 80 columns --> + <span class="subdued">chrome.bookmarks.</span><span jscontent="name">onEvent</span><span class="subdued">.addListener</span>(function(<span jscontent="callSignature">Type param1, Type param2</span>) <span class="subdued">{...}</span>); + </div> - <!-- PARAMETERS --> - <h4>Parameters</h4> - <dl> - <div jsselect="parameters"> - <dt> - <!-- Note: intentionally longer 80 columns --> - <var jscontent="name">paramName</var><em> (<span jscontent="typeName">paramType</span>)</em> - </dt> - <dd class="todo" jsdisplay="!$this.description">Undocumented.</dd> - <dd jsdisplay="$this.description" jsvalues=".innerHTML:$this.description"> - Description of this parameter from the json schema. - </dd> - - <!-- OBJECT PROPERTIES --> - <dd jsdisplay="_propertyList"> - <dl> - <div jsselect="_propertyList"> - <dt> - <!-- Note: intentionally longer 80 columns --> - <var jscontent="name">paramName</var><em> - (<span class="optional" jsdisplay="optional">optional </span><span jscontent="typeName">paramType</span>)</em> - </dt> - <dd class="todo" jsdisplay="!$this.description"> - Undocumented. - </dd> - <dd jsdisplay="$this.description" - jsvalues=".innerHTML:$this.description"> - Description of this parameter from the json schema. - </dd> - </div> - </dl> - </dd> - </div> - </dl> + <div class="description"> + <p class="todo" jsdisplay="!description">Undocumented.</p> + <p jsdisplay="description" jsvalues=".innerHTML:description"> + A description from the json schema def of the event goes here. + </p> + + <!-- PARAMETERS --> + <h4>Parameters</h4> + <dl> + <div jsselect="parameters"> + <dt> + <!-- Note: intentionally longer 80 columns --> + <var jscontent="name">paramName</var><em> (<span jscontent="typeName">paramType</span>)</em> + </dt> + <dd class="todo" jsdisplay="!$this.description">Undocumented.</dd> + <dd jsdisplay="$this.description" jsvalues=".innerHTML:$this.description"> + Description of this parameter from the json schema. + </dd> + + <!-- OBJECT PROPERTIES --> + <dd jsdisplay="_propertyList"> + <dl> + <div jsselect="_propertyList"> + <dt> + <!-- Note: intentionally longer 80 columns --> + <var jscontent="name">paramName</var><em> + (<span class="optional" jsdisplay="optional">optional </span><span jscontent="typeName">paramType</span>)</em> + </dt> + <dd class="todo" jsdisplay="!$this.description"> + Undocumented. + </dd> + <dd jsdisplay="$this.description" + jsvalues=".innerHTML:$this.description"> + Description of this parameter from the json schema. + </dd> + </div> + </dl> + </dd> + </div> + </dl> - </div> <!-- /decription --> + </div> <!-- /decription --> - </div> <!-- /apiItem --> + </div> <!-- /apiItem --> - </div> <!-- /apiGroup --> + </div> <!-- /apiGroup --> + </div> <!-- /apiPage --> </div> <!-- /mainColumn --> </div> <!-- /pageContent --> <div id="pageFooter" --> diff --git a/chrome/common/extensions/docs/template/page_shell.html b/chrome/common/extensions/docs/template/page_shell.html new file mode 100755 index 0000000..faf8a37 --- /dev/null +++ b/chrome/common/extensions/docs/template/page_shell.html @@ -0,0 +1,46 @@ +<!DOCTYPE html> +<!-- This page is a placeholder for generated extensions api doc. Note: + 1) The <head> information in this page is significant, should be uniform + across api docs and should be edited only with knowledge of the + templating mechanism. + 2) The <body> tag *must* retain id="body" + 3) All <body>.innerHTML is genereated as an rendering step. If viewed in a + browser, it will be re-generated from the template, json schema and + authored overview content. + 4) The <body>.innerHTML is also generated by an offline step so that this + page may easily be indexed by search engines. + + TODO(rafaelw): Abstract this into a "pageshell" that becomes the single + version of page template shell and the "instance" pages (bookmarks.html, + etc...) can be generated with a build step. +--> +<!-- <html> must retain id="template --> +<html xmlns="http://www.w3.org/1999/xhtml"> + <!-- <head> data is significant and loads the needed libraries and styles --> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title jscontent="pageTitle">pageTitle</title> + <link href="css/ApiRefStyles.css" rel="stylesheet" type="text/css"> + <script type="text/javascript" + src="../../../third_party/jstemplate/jstemplate_compiled.js"> + </script> + <script type="text/javascript" src="js/api_page_generator.js"></script> + <script> +// Re-render the page if the user-agent is chrome and it is being served as +// a file:/// scheme. This allows both the initial render to static as well +// as dynamic re-rendering for developers/doc-writers working on local changes. +window.onload = function() { + var chrome = navigator.userAgent.indexOf("Chrome") > -1; + var fileScheme = location.protocol == "file:"; + var regenerate = chrome && fileScheme; + //if (regenerate) { + window.renderPage(); + //} +} + </script> + </head> + <!-- <body> content is completely generated. Do not edit, as it will be + and rewritten. --> + <body class="hidden"> + </body> +</html> diff --git a/chrome/common/extensions/docs/reference/windows.html b/chrome/common/extensions/docs/windows.html index c05e097..faf8a37 100755 --- a/chrome/common/extensions/docs/reference/windows.html +++ b/chrome/common/extensions/docs/windows.html @@ -19,12 +19,25 @@ <!-- <head> data is significant and loads the needed libraries and styles --> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> - <title jscontent="namespace">chrome.apiname</title> - <link href="../css/ApiRefStyles.css" rel="stylesheet" type="text/css"> + <title jscontent="pageTitle">pageTitle</title> + <link href="css/ApiRefStyles.css" rel="stylesheet" type="text/css"> <script type="text/javascript" - src="../../../../third_party/jstemplate/jstemplate_compiled.js"> + src="../../../third_party/jstemplate/jstemplate_compiled.js"> </script> - <script type="text/javascript" src="../js/api_page_generator.js"></script> + <script type="text/javascript" src="js/api_page_generator.js"></script> + <script> +// Re-render the page if the user-agent is chrome and it is being served as +// a file:/// scheme. This allows both the initial render to static as well +// as dynamic re-rendering for developers/doc-writers working on local changes. +window.onload = function() { + var chrome = navigator.userAgent.indexOf("Chrome") > -1; + var fileScheme = location.protocol == "file:"; + var regenerate = chrome && fileScheme; + //if (regenerate) { + window.renderPage(); + //} +} + </script> </head> <!-- <body> content is completely generated. Do not edit, as it will be and rewritten. --> |