Skip to content

HTML documentation: Show preparsed doctests using inline tabs #37083

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

Merged
merged 15 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from 12 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
3 changes: 2 additions & 1 deletion .ci/merge-fixes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ for REPO in ${SAGE_CI_FIXES_FROM_REPOSITORIES:-sagemath/sage}; do
# Considered alternative: Use https://github.com/$REPO/pull/$a.diff,
# which squashes everything into one diff without commit metadata.
PULL_URL="https://github.com/$REPO/pull/$a"
PULL_SHORT="$REPO#$a"
PULL_FILE="$REPO_FILE-$a"
PATH=build/bin:$PATH build/bin/sage-download-file --quiet "$PULL_URL.patch" $PULL_FILE.patch
date -u +"%Y-%m-%dT%H:%M:%SZ" > $PULL_FILE.date # Record the date, for future reference
Expand All @@ -67,7 +68,7 @@ for REPO in ${SAGE_CI_FIXES_FROM_REPOSITORIES:-sagemath/sage}; do
git am --signoff --show-current-patch=diff
echo "--------------------------------------------------------------------8<-----------------------------"
echo "::endgroup::"
echo "Failure applying $PULL_URL as a patch, resetting"
echo "Failure applying $PULL_SHORT as a patch, resetting"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the full URL since it easy to open the corresponding PR. Either way, these changes are unrelated to the actual goal of the PR and thus should be moved to somewhere else.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The full URL appears just above. The improvement is that the repeated one is shortened so that there is not a second, duplicate link.

I'll not open a separate PR for this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not? This is clearly not connected to main theme of this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've just finished the review of this one line change, no?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, and there are also more changes here that seem unrelated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You commented, I responded to your comment. What's missing for the review of this one line change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rules of review, spelled out for you:

  • Provide the necessary information.
  • Do not use vagueness as a tool.
  • Do not ask for information that has already been provided.

git am --signoff --abort
fi
done
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ jobs:
uses: actions/checkout@v4
- name: Merge CI fixes from sagemath/sage
run: |
.ci/merge-fixes.sh
mkdir -p upstream
.ci/merge-fixes.sh 2>&1 | tee upstream/ci_fixes.log
env:
GH_TOKEN: ${{ github.token }}
SAGE_CI_FIXES_FROM_REPOSITORIES: ${{ vars.SAGE_CI_FIXES_FROM_REPOSITORIES }}
- name: Store CI fixes in upstream artifact
run: |
mkdir -p upstream
if git format-patch --stdout test_base > ci_fixes.patch; then
cp ci_fixes.patch upstream/
fi
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/doc-build-pdf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ jobs:
uses: actions/checkout@v4
- name: Merge CI fixes from sagemath/sage
run: |
.ci/merge-fixes.sh
mkdir -p upstream
.ci/merge-fixes.sh 2>&1 | tee upstream/ci_fixes.log
env:
GH_TOKEN: ${{ github.token }}
SAGE_CI_FIXES_FROM_REPOSITORIES: ${{ vars.SAGE_CI_FIXES_FROM_REPOSITORIES }}
- name: Store CI fixes in upstream artifact
run: |
mkdir -p upstream
if git format-patch --stdout test_base > ci_fixes.patch; then
cp ci_fixes.patch upstream/
fi
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/doc-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ jobs:
uses: actions/checkout@v4
- name: Merge CI fixes from sagemath/sage
run: |
.ci/merge-fixes.sh
mkdir -p upstream
.ci/merge-fixes.sh 2>&1 | tee upstream/ci_fixes.log
env:
GH_TOKEN: ${{ github.token }}
SAGE_CI_FIXES_FROM_REPOSITORIES: ${{ vars.SAGE_CI_FIXES_FROM_REPOSITORIES }}
- name: Store CI fixes in upstream artifact
run: |
mkdir -p upstream
if git format-patch --stdout test_base > ci_fixes.patch; then
cp ci_fixes.patch upstream/
fi
Expand Down
13 changes: 13 additions & 0 deletions src/doc/common/static/jupyter-sphinx-furo.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,16 @@ thebelab.on("status", function (evt, data) {
kernel.requestExecute({code: "%display latex"});
}
});

// Activate Thebe when "Sage (live)" tab is clicked
document.querySelectorAll('input[class="tab-input"]').forEach((elem) => {
elem.addEventListener("click", function(event) {
if (elem.nextElementSibling) {
if (elem.nextElementSibling.nextElementSibling) {
if (elem.nextElementSibling.nextElementSibling.querySelector('div[class="thebelab-code"]')) {
initThebelab();
}
}
}
});
});
Loading