Skip to content

Commit

Permalink
HTML: Add sourcelink_suffix to globalcontext
Browse files Browse the repository at this point in the history
  • Loading branch information
mgeier committed Jun 25, 2016
1 parent 71e1aaf commit 71dd8bf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions sphinx/builders/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ def prepare_writing(self, docnames):
show_sphinx = self.config.html_show_sphinx,
has_source = self.config.html_copy_source,
show_source = self.config.html_show_sourcelink,
sourcelink_suffix = self.config.html_sourcelink_suffix,
file_suffix = self.out_suffix,
script_files = self.script_files,
language = self.config.language,
Expand Down
3 changes: 2 additions & 1 deletion sphinx/themes/basic/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ <h3>{{ _('Navigation') }}</h3>
VERSION: '{{ release|e }}',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '{{ '' if no_search_suffix else file_suffix }}',
HAS_SOURCE: {{ has_source|lower }}
HAS_SOURCE: {{ has_source|lower }},
SOURCELINK_SUFFIX: '{{ sourcelink_suffix }}'
};
</script>
{%- for scriptfile in script_files %}
Expand Down
3 changes: 2 additions & 1 deletion sphinx/themes/basic/static/searchtools.js_t
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@ var Search = {
displayNextItem();
});
} else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) {
$.ajax({url: DOCUMENTATION_OPTIONS.URL_ROOT + '_sources/' + item[5] + (item[5].endsWith('.txt') ? '' : '.txt'),
var suffix = DOCUMENTATION_OPTIONS.SOURCELINK_SUFFIX;
$.ajax({url: DOCUMENTATION_OPTIONS.URL_ROOT + '_sources/' + item[5] + (item[5].endsWith(suffix) ? '' : suffix),
dataType: "text",
complete: function(jqxhr, textstatus) {
var data = jqxhr.responseText;
Expand Down

0 comments on commit 71dd8bf

Please sign in to comment.