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

Unified Diff: native_client_sdk/src/doc/_sphinxext/chromesite_builder.py

Issue 299753002: [NaCl SDK Docs] PPAPI docs use a new template without a sidenav. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: feedback Created 6 years, 7 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: native_client_sdk/src/doc/_sphinxext/chromesite_builder.py
diff --git a/native_client_sdk/src/doc/_sphinxext/chromesite_builder.py b/native_client_sdk/src/doc/_sphinxext/chromesite_builder.py
index 5a5436958d11f96f92ad51ae828b5505ffb8c009..a212e1e11db88a7007be87d1309b593e928860df 100644
--- a/native_client_sdk/src/doc/_sphinxext/chromesite_builder.py
+++ b/native_client_sdk/src/doc/_sphinxext/chromesite_builder.py
@@ -24,11 +24,11 @@ from sphinx.util.console import bold
# TODO(eliben): it may be interesting to use an actual Sphinx template here at
# some point.
PAGE_TEMPLATE = string.Template(r'''
-{{+bindTo:partials.standard_nacl_article}}
+{{+bindTo:partials.${doc_template}}}
${doc_body}
-{{/partials.standard_nacl_article}}
+{{/partials.${doc_template}}}
'''.lstrip())
@@ -245,12 +245,17 @@ class ChromesiteBuilder(StandaloneHTMLBuilder):
if not 'body' in context:
return
+ template = context.get('meta', {}).get('template', 'standard_nacl_article')
+ title = context.get('title', '')
+ body = context.get('body', '')
+
# codecs.open is the fast Python 2.x way of emulating the encoding= argument
# in Python 3's builtin open.
with codecs.open(filename, 'w', encoding='utf-8') as f:
f.write(PAGE_TEMPLATE.substitute(
- doc_title=context.get('title', ''),
- doc_body=context.get('body')))
+ doc_template=template,
+ doc_title=title,
+ doc_body=body))
def _conditional_chromesite(self, s):
# return s if self.chromesite_production_mode else ''
« no previous file with comments | « chrome/common/extensions/docs/templates/private/standard_nacl_api.html ('k') | native_client_sdk/src/doc/doxygen/footer.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698