mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
HTML: Add sourcelink_suffix to globalcontext
This commit is contained in:
@@ -339,6 +339,7 @@ class StandaloneHTMLBuilder(Builder):
|
|||||||
show_sphinx = self.config.html_show_sphinx,
|
show_sphinx = self.config.html_show_sphinx,
|
||||||
has_source = self.config.html_copy_source,
|
has_source = self.config.html_copy_source,
|
||||||
show_source = self.config.html_show_sourcelink,
|
show_source = self.config.html_show_sourcelink,
|
||||||
|
sourcelink_suffix = self.config.html_sourcelink_suffix,
|
||||||
file_suffix = self.out_suffix,
|
file_suffix = self.out_suffix,
|
||||||
script_files = self.script_files,
|
script_files = self.script_files,
|
||||||
language = self.config.language,
|
language = self.config.language,
|
||||||
|
|||||||
@@ -91,7 +91,8 @@
|
|||||||
VERSION: '{{ release|e }}',
|
VERSION: '{{ release|e }}',
|
||||||
COLLAPSE_INDEX: false,
|
COLLAPSE_INDEX: false,
|
||||||
FILE_SUFFIX: '{{ '' if no_search_suffix else file_suffix }}',
|
FILE_SUFFIX: '{{ '' if no_search_suffix else file_suffix }}',
|
||||||
HAS_SOURCE: {{ has_source|lower }}
|
HAS_SOURCE: {{ has_source|lower }},
|
||||||
|
SOURCELINK_SUFFIX: '{{ sourcelink_suffix }}'
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
{%- for scriptfile in script_files %}
|
{%- for scriptfile in script_files %}
|
||||||
|
|||||||
@@ -256,7 +256,8 @@ var Search = {
|
|||||||
displayNextItem();
|
displayNextItem();
|
||||||
});
|
});
|
||||||
} else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) {
|
} 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",
|
dataType: "text",
|
||||||
complete: function(jqxhr, textstatus) {
|
complete: function(jqxhr, textstatus) {
|
||||||
var data = jqxhr.responseText;
|
var data = jqxhr.responseText;
|
||||||
|
|||||||
Reference in New Issue
Block a user