OLD | NEW |
---|---|
1 # Copyright (c) 2013 The Native Client Authors. All rights reserved. | 1 # Copyright (c) 2013 The Native Client Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 # | 5 # |
6 # This is a Sphinx extension. | 6 # This is a Sphinx extension. |
7 # | 7 # |
8 | 8 |
9 import codecs | 9 import codecs |
10 import os | 10 import os |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
240 self.devsite_production_mode,) | 240 self.devsite_production_mode,) |
241 self.config_hash = '' | 241 self.config_hash = '' |
242 self.tags_hash = '' | 242 self.tags_hash = '' |
243 self.theme = None # no theme necessary | 243 self.theme = None # no theme necessary |
244 self.templates = None # no template bridge necessary | 244 self.templates = None # no template bridge necessary |
245 self.init_translator_class() | 245 self.init_translator_class() |
246 self.init_highlighter() | 246 self.init_highlighter() |
247 | 247 |
248 def get_target_uri(self, docname, typ=None): | 248 def get_target_uri(self, docname, typ=None): |
249 if self.devsite_production_mode: | 249 if self.devsite_production_mode: |
250 # TODO(eliben): testrst here will have to be replaced with | 250 return '/native-client/%s/%s' % (self.config.devsite_foldername, docname) |
eliben
2013/10/02 15:57:32
visit_image too
Other paths relative to native-cl
Sam Clegg
2013/10/02 19:08:08
Done.
| |
251 # {{pepperversion}} | |
252 return '/native-client/testrst/%s' % docname | |
253 else: | 251 else: |
254 return docname + self.link_suffix | 252 return docname + self.link_suffix |
255 | 253 |
256 def handle_page(self, pagename, ctx, templatename='page.html', | 254 def handle_page(self, pagename, ctx, templatename='page.html', |
257 outfilename=None, event_arg=None): | 255 outfilename=None, event_arg=None): |
258 ctx['current_page_name'] = pagename | 256 ctx['current_page_name'] = pagename |
259 | 257 |
260 if not outfilename: | 258 if not outfilename: |
261 outfilename = os.path.join(self.outdir, | 259 outfilename = os.path.join(self.outdir, |
262 pagename + self.out_suffix) | 260 pagename + self.out_suffix) |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
316 | 314 |
317 | 315 |
318 def setup(app): | 316 def setup(app): |
319 """ Extension registration hook. | 317 """ Extension registration hook. |
320 """ | 318 """ |
321 app.add_directive('naclcode', NaclCodeDirective) | 319 app.add_directive('naclcode', NaclCodeDirective) |
322 app.add_builder(DevsiteBuilder) | 320 app.add_builder(DevsiteBuilder) |
323 | 321 |
324 # "Production mode" for local testing vs. on-server documentation. | 322 # "Production mode" for local testing vs. on-server documentation. |
325 app.add_config_value('devsite_production_mode', default='1', rebuild='html') | 323 app.add_config_value('devsite_production_mode', default='1', rebuild='html') |
326 | |
327 app.add_config_value('kill_internal_links', default='0', rebuild='html') | 324 app.add_config_value('kill_internal_links', default='0', rebuild='html') |
325 app.add_config_value('devsite_foldername', default='dev', rebuild='html') | |
OLD | NEW |