Skip to content

Commit

Permalink
Add more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kwankyu committed Jun 27, 2024
1 parent bea3a4b commit 01ee625
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
9 changes: 3 additions & 6 deletions src/doc/common/static/jupyter-sphinx-furo.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ function getQueryParam(param) {
return urlParams.get(param);
}


// Fetch the versions file and redirect based on the version parameter
// Fetch the versions.txt file and redirect based on the version parameter
async function redirectToVersion() {
let version = getQueryParam("ver");
let versionMap = {};

try {
// TODO: change to https://github.com/sagemath/sage/blob/develop/src/doc/versions.txt
let response = await fetch('/versions.txt');
if (!response.ok) {
throw new Error('Network response was not ok');
Expand Down Expand Up @@ -124,7 +124,7 @@ async function redirectToVersion() {
}
}

// Redirect if query parameter "ver" is given
// Redirect if query parameter "ver" is given in url
redirectToVersion();

// Function to change the version based on versions menu selection
Expand Down Expand Up @@ -206,6 +206,3 @@ document.querySelectorAll('input[class="tab-input"]').forEach((elem) => {
}
});
});



Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<select id="versionsMenu" onchange="changeVersion()">
<option value="">Versions</option>
<option value="">versions</option>
</select>
6 changes: 5 additions & 1 deletion src/doc/versions.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# This file is maintained by src/bin/sage-update-version script.
# This file is maintained by src/bin/sage-update-version script
# The first line is reserved for develop version
# The other lines are for the most recent stable releases (at most 5 lines)
# Each line consists of the version and the url to the doc
# The sage-update-version script adds a new line for a new stable release.
dev doc-release--sagemath.netlify.app
10.3 doc-10-3--sagemath.netlify.app
10.2 doc-10-2--sagemath.netlify.app
1 change: 1 addition & 0 deletions src/sage_docbuild/builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@ def html(self):
shutil.copy2(os.path.join(SAGE_DOC_SRC, self.lang, 'website', 'root_index.html'),
root_index_file)

# This versions.txt file is used in src/doc/common/static/jupyter-sphinx-furo.js
versions_file = os.path.join(SAGE_DOC, 'versions.txt')
shutil.copy2(os.path.join(SAGE_DOC_SRC, 'versions.txt'), versions_file)

Expand Down

0 comments on commit 01ee625

Please sign in to comment.