diff options
author | DHNishi@gmail.com <DHNishi@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-17 19:28:46 +0000 |
---|---|---|
committer | DHNishi@gmail.com <DHNishi@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-17 19:28:46 +0000 |
commit | 9c7830ba58277583ca0907237b7ab50b7d671aec (patch) | |
tree | dbd7b0a1acf06a493bf9e0a4e0811ffe332c8900 | |
parent | d61d98831db9088a483689c1578f982565571ab2 (diff) | |
download | chromium_src-9c7830ba58277583ca0907237b7ab50b7d671aec.zip chromium_src-9c7830ba58277583ca0907237b7ab50b7d671aec.tar.gz chromium_src-9c7830ba58277583ca0907237b7ab50b7d671aec.tar.bz2 |
Add a deprecated annotation for api documentation.
Example Image: http://i.imgur.com/CNGWOVS.png
NOTRY=true
BUG=239196
Review URL: https://codereview.chromium.org/26231004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@229207 0039d316-1c4b-4281-b951-d872f2087c98
6 files changed, 16 insertions, 2 deletions
diff --git a/chrome/common/extensions/docs/server2/api_data_source.py b/chrome/common/extensions/docs/server2/api_data_source.py index 9c1486e..d3d095d 100644 --- a/chrome/common/extensions/docs/server2/api_data_source.py +++ b/chrome/common/extensions/docs/server2/api_data_source.py @@ -242,6 +242,9 @@ class _JSCModel(object): 'returns': None, 'id': _CreateId(function, 'method') } + if (function.deprecated is not None): + function_dict['deprecated'] = self._FormatDescription( + function.deprecated) if (function.parent is not None and not isinstance(function.parent, model.Namespace)): function_dict['parentName'] = function.parent.simple_name diff --git a/chrome/common/extensions/docs/server2/app.yaml b/chrome/common/extensions/docs/server2/app.yaml index f3944a5..80e3402 100644 --- a/chrome/common/extensions/docs/server2/app.yaml +++ b/chrome/common/extensions/docs/server2/app.yaml @@ -1,5 +1,5 @@ application: chrome-apps-doc -version: 2-32-4 +version: 2-32-5 runtime: python27 api_version: 1 threadsafe: false diff --git a/chrome/common/extensions/docs/server2/cron.yaml b/chrome/common/extensions/docs/server2/cron.yaml index 0c0cb47..9e75306 100644 --- a/chrome/common/extensions/docs/server2/cron.yaml +++ b/chrome/common/extensions/docs/server2/cron.yaml @@ -2,4 +2,4 @@ cron: - description: Repopulates all cached data. url: /_cron schedule: every 5 minutes - target: 2-32-4 + target: 2-32-5 diff --git a/chrome/common/extensions/docs/templates/private/function.html b/chrome/common/extensions/docs/templates/private/function.html index f1923a2..28b273d 100644 --- a/chrome/common/extensions/docs/templates/private/function.html +++ b/chrome/common/extensions/docs/templates/private/function.html @@ -2,5 +2,6 @@ <h4 id="{{?id}}{{id}}{{:}}{{?parentId}}{{parentId}}-{{name}}{{/}}{{/}}"> {{name}} </h4> + {{+partials.warning_deprecated function:@}} {{+partials.function_details function:@ parentName:parentName api:api}} </div> diff --git a/chrome/common/extensions/docs/templates/private/warning_deprecated.html b/chrome/common/extensions/docs/templates/private/warning_deprecated.html new file mode 100644 index 0000000..7880e1f --- /dev/null +++ b/chrome/common/extensions/docs/templates/private/warning_deprecated.html @@ -0,0 +1,8 @@ +{{- Parameters: + |function|: the schema for the function +-}} +{{?function.deprecated}} +<p class="warning"> + {{function.name}} is deprecated. {{{function.deprecated}}} +</p> +{{/function.deprecated}}
\ No newline at end of file diff --git a/tools/json_schema_compiler/model.py b/tools/json_schema_compiler/model.py index 2fcb4df..cc876df 100644 --- a/tools/json_schema_compiler/model.py +++ b/tools/json_schema_compiler/model.py @@ -208,6 +208,7 @@ class Function(object): available to - |params| a list of parameters to the function (order matters). A separate parameter is used for each choice of a 'choices' parameter + - |deprecated| a reason and possible alternative for a deprecated function - |description| a description of the function (if provided) - |callback| the callback parameter to the function. There should be exactly one @@ -228,6 +229,7 @@ class Function(object): self.platforms = _GetPlatforms(json) self.params = [] self.description = json.get('description') + self.deprecated = json.get('deprecated') self.callback = None self.optional = json.get('optional', False) self.parent = parent |