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

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

Issue 441053004: Docserver: Modify DocumentRenderer to generate absolute links (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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/document_renderer.py
diff --git a/chrome/common/extensions/docs/server2/document_renderer.py b/chrome/common/extensions/docs/server2/document_renderer.py
index 6a033752a925fea7dac64505ead54444f7776001..2e3556f850423115501bd23fa1b5e18fab1d5ee8 100644
--- a/chrome/common/extensions/docs/server2/document_renderer.py
+++ b/chrome/common/extensions/docs/server2/document_renderer.py
@@ -79,8 +79,10 @@ class DocumentRenderer(object):
path=path)
new_document.append(document[cursor_index:start_ref_index])
- new_document.append('<a href=%s>%s</a>' % (ref_dict['href'],
- ref_dict['text']))
+ new_document.append('<a href=%s/%s>%s</a>' % (
+ self._platform_bundle._base_path + platform,
not at google - send to devlin 2014/08/07 23:59:31 nit - but perhaps use %s%s and split up base_path/
+ ref_dict['href'],
+ ref_dict['text']))
cursor_index = end_ref_index + 1
start_ref_index = document.find(START_REF, cursor_index)
@@ -90,6 +92,10 @@ class DocumentRenderer(object):
return ''.join(new_document)
def Render(self, document, path, render_title=False):
+ ''' |document|: document to be rendered.
+ |path|: request path to the document.
+ |render_title|: boolean representing whether or not to render a title.
+ '''
# Render links first so that parsing and later replacements aren't
# affected by $(ref...) substitutions
document = self._RenderLinks(document, path)
« no previous file with comments | « chrome/common/extensions/docs/server2/cron.yaml ('k') | chrome/common/extensions/docs/server2/document_renderer_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698