Commit a5efc8a6 authored by Martin Larralde's avatar Martin Larralde
Browse files

Add some JS scripts to improve the styling of the documentation

parent f4956f27
$(document).ready(function() {
(function ($) {
if (window.location.href.match("/api/*") !== null) {
$(".nav-list")
.children()
.filter("li")
.append("<ul id='apitoc' class='nav nav-list'></ul>");
$( "dt" )
.has( ".sig-name" )
.slice(1)
.each(function( index ) {
var html = (
"<li><a href='#"
+ $( this ).attr("id")
+ "'><code>"
+ $( this ).find(".sig-name").text()
+ "</code></a></li>"
);
$("#apitoc").append(html);
});
} else if (window.location.href.match("/api/errors.html") !== null) {
$(".nav-list")
.children()
.filter("li")
.append("<ul id='apitoc' class='nav nav-list scrollable-menu'></ul>");
$( "dt" )
.each(function( index ) {
var html = (
"<li><a href='#"
+ $( this ).attr("id")
+ "'><code>"
+ $( this ).find(".sig-name").text()
+ "</code></a></li>"
);
$("#apitoc").append(html);
});
}
})(window.$jqTheme || window.jQuery);
})
$(document).ready(function() {
(function ($) {
$(".admonition-example")
.removeClass("panel-info")
.addClass("panel-success").end()
})(window.$jqTheme || window.jQuery);
})
......@@ -36,8 +36,8 @@ sys.modules['peptides.tables'] = types.ModuleType('peptides.tables')
def setup(app):
# Add custom stylesheet
app.add_css_file(os.path.join("_static/css/main.css"))
# app.add_js_file("js/apitoc.js")
# app.add_js_file("js/example-admonition.js")
app.add_js_file("js/apitoc.js")
app.add_js_file("js/example-admonition.js")
# -- Project information -----------------------------------------------------
......@@ -181,8 +181,8 @@ htmlhelp_basename = peptides.__name__
# -- Options for extlinks extension ------------------------------------------
extlinks = {
'doi': ('https://doi.org/%s', 'doi:%s'),
'pmid': ('https://pubmed.ncbi.nlm.nih.gov/%s', 'PMID:%s'),
'doi': ('https://doi.org/%s', 'doi:'),
'pmid': ('https://pubmed.ncbi.nlm.nih.gov/%s', 'PMID:'),
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment