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

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

Issue 25641002: Add builder option (kill_internal_links) to hide all links to in-tree documents. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: native_client_sdk/src/doc/_sphinxext/devsite_builder.py
diff --git a/native_client_sdk/src/doc/_sphinxext/devsite_builder.py b/native_client_sdk/src/doc/_sphinxext/devsite_builder.py
index 064fc816f122f4e136735740bee2ac468629a1c2..2d26733846788c07e791ddcd418bea383f13f5c7 100644
--- a/native_client_sdk/src/doc/_sphinxext/devsite_builder.py
+++ b/native_client_sdk/src/doc/_sphinxext/devsite_builder.py
@@ -145,6 +145,20 @@ class DevsiteHTMLTranslator(HTMLTranslator):
node['uri'] = '/native-client/' + node['uri']
HTMLTranslator.visit_image(self, node)
+ def visit_reference(self, node):
+ # In "kill_internal_links" mode, we don't emit the actual links for internal
+ # nodes.
+ if self.builder.kill_internal_links and node.get('internal'):
+ pass
+ else:
+ HTMLTranslator.visit_reference(self, node)
+
+ def depart_reference(self, node):
+ if self.builder.kill_internal_links and node.get('internal'):
+ pass
+ else:
+ HTMLTranslator.depart_reference(self, node)
+
def visit_title(self, node):
# Why this?
#
@@ -221,6 +235,7 @@ class DevsiteBuilder(StandaloneHTMLBuilder):
def init(self):
self.devsite_production_mode = int(self.config.devsite_production_mode) == 1
+ self.kill_internal_links = int(self.config.kill_internal_links) == 1
print "----> Devsite builder with production mode = %d" % (
self.devsite_production_mode,)
self.config_hash = ''
@@ -308,3 +323,6 @@ def setup(app):
# "Production mode" for local testing vs. on-server documentation.
app.add_config_value('devsite_production_mode', default='1', rebuild='html')
+
+ app.add_config_value('kill_internal_links', default='0', rebuild='html')
+
Sam Clegg 2013/10/01 23:45:46 Kill extra line.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698