Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix documentation #2407

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 37 additions & 23 deletions docs/source/_templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@
#}

{%- block footer %}

<script type="text/javascript">
var collapsedSections = []
</script>
{{ super() }}
<script type="text/javascript">
$(document).ready(function() {
Expand All @@ -69,30 +71,42 @@
$(".pytorch-call-to-action-links a[data-response='Run in Google Colab']").attr("href", colabLink);
$(".pytorch-call-to-action-links a[data-response='View on Github']").attr("href", githubLink);
}
});
</script>

{% if 'tutorial' in pagename %}
{#
# Override the right side menu bar behavior so that subsections
# are shown by default in tutorial page.
# Based off of
# https://github.com/pytorch/pytorch_sphinx_theme/blob/b4d00058a48604d8fb63771b513a50450f0ee188/pytorch_sphinx_theme/static/js/theme.js#L568-L579
#}
<script type="text/javascript">
$(window).ready(function() {
var original = window.sideMenus.bind;
window.sideMenus.bind = function() {
original();
$("#pytorch-right-menu a.reference.internal").each(function(i) {
if (this.classList.contains("not-expanded")) {
this.nextElementSibling.style.display = "block";
this.classList.remove("not-expanded");
this.classList.add("expanded");
}
});
};
var overwrite = function(_) {
if ($(this).length > 0) {
$(this)[0].href = "https://github.com/pytorch/audio"
}
}
// PC
$(".main-menu a:contains('GitHub')").each(overwrite);
// Mobile
$(".main-menu a:contains('Github')").each(overwrite);
});

{% if 'tutorial' in pagename %}
{#
# Override the right side menu bar behavior so that subsections
# are shown by default in tutorial page.
# Based off of
# https://github.com/pytorch/pytorch_sphinx_theme/blob/b4d00058a48604d8fb63771b513a50450f0ee188/pytorch_sphinx_theme/static/js/theme.js#L568-L579
#}
$(window).ready(function() {
var original = window.sideMenus.bind;
var startup = true;
window.sideMenus.bind = function() {
original();
if (startup) {
$("#pytorch-right-menu a.reference.internal").each(function(i) {
if (this.classList.contains("not-expanded")) {
this.nextElementSibling.style.display = "block";
this.classList.remove("not-expanded");
this.classList.add("expanded");
}
});
startup = false;
}
};
});
</script>
{% endif %}
{% endblock %}
2 changes: 2 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
"nbsphinx",
]

nbsphinx_requirejs_path = ""

autodoc_member_order = "bysource"

# katex options
Expand Down