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

Unified Diff: chrome/common/extensions/docs/server2/manifest_data_source.py

Issue 92143003: Docserver: Reorganise the site templates into a single site.html file which (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years 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/server2/manifest_data_source.py
diff --git a/chrome/common/extensions/docs/server2/manifest_data_source.py b/chrome/common/extensions/docs/server2/manifest_data_source.py
index 255509bd2076a5e50f07ab7b215dd7fe501a732f..8115fdaebc141d29fc04d051c6e0d73ea0a63eee 100644
--- a/chrome/common/extensions/docs/server2/manifest_data_source.py
+++ b/chrome/common/extensions/docs/server2/manifest_data_source.py
@@ -56,10 +56,12 @@ def _ListifyAndSortDocs(features, app_name):
features[key]['children'] = convert_and_sort(value['children'])
return sorted(features.values(), key=sort_key)
- # Replace {{title}} in the 'name' manifest property example with |app_name|
+ # Replace {{platform}} in the 'name' manifest property example with
+ # |app_name|, the convention that the normal template rendering uses.
+ # TODO(kalman): Make the example a template and pass this through there.
if 'name' in features:
name = features['name']
- name['example'] = name['example'].replace('{{title}}', app_name)
+ name['example'] = name['example'].replace('{{platform}}', app_name)
features = convert_and_sort(features)
@@ -114,11 +116,11 @@ class ManifestDataSource(DataSource):
def for_templates(manifest_features, platform):
return _AddLevelAnnotations(_ListifyAndSortDocs(
ConvertDottedKeysToNested(
- features_utility.Filtered(manifest_features, platform)),
+ features_utility.Filtered(manifest_features, platform + 's')),
app_name=platform.capitalize()))
return {
- 'apps': for_templates(manifest_features, 'apps'),
- 'extensions': for_templates(manifest_features, 'extensions')
+ 'apps': for_templates(manifest_features, 'app'),
+ 'extensions': for_templates(manifest_features, 'extension')
}
return Future(delegate=Gettable(resolve))

Powered by Google App Engine
This is Rietveld 408576698