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

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

Issue 354073004: Docserver: Add template support for object level availability (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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/server2/schema_util.py
diff --git a/chrome/common/extensions/docs/server2/schema_util.py b/chrome/common/extensions/docs/server2/schema_util.py
index dba7c7c7e8f01cf7abcc1c7a7953c935bedcdc61..866591d60002739087a5b2d2d2b16928ec90ca79 100644
--- a/chrome/common/extensions/docs/server2/schema_util.py
+++ b/chrome/common/extensions/docs/server2/schema_util.py
@@ -89,10 +89,10 @@ def InlineDocs(schema):
apply_inline(schema)
-def ProcessSchema(path, file_data):
- '''Parses |file_data| using a method determined by checking the
- extension of the file at the given |path|. Then, trims 'nodoc' and handles
- inlineable types from the parsed schema data.
+def ProcessSchema(path, file_data, inline=False):
+ '''Parses |file_data| using a method determined by checking the extension of
+ the file at the given |path|. Then, trims 'nodoc' and if |inline| is given
+ and True, handles inlineable types from the parsed schema data.
'''
def trim_and_inline(schema, is_idl=False):
'''Modifies an API schema in place by removing nodes that shouldn't be
@@ -102,9 +102,10 @@ def ProcessSchema(path, file_data):
# A return of True signifies that the entire schema should not be
# documented. Otherwise, only nodes that request 'nodoc' are removed.
return None
- if is_idl:
- DetectInlineableTypes(schema)
- InlineDocs(schema)
+ if inline:
+ if is_idl:
+ DetectInlineableTypes(schema)
+ InlineDocs(schema)
return schema
if path.endswith('.idl'):

Powered by Google App Engine
This is Rietveld 408576698