Skip to content

Commit

Permalink
sagemathgh-38213: Fix regex to remove spurious diffs in doc preview
Browse files Browse the repository at this point in the history
    
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

There was an error in the regex, seen in

https://preview-38210--sagemath.netlify.app/changes

Also removed most spurious diffs: see [changes](https://preview-38213--
sagemath.netlify.app/changes) of this PR.

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [ ] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#38213
Reported by: Kwankyu Lee
Reviewer(s): Matthias Köppe
  • Loading branch information
Release Manager committed Jun 15, 2024
2 parents 4dce323 + d1220c9 commit c7598cf
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/doc-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ jobs:
new_version=$(docker exec BUILD cat src/VERSION.txt)
mkdir -p docs/
docker cp BUILD:/sage/local/share/doc/sage/html docs/
# Wipe out chronic diffs between old doc and new doc
# Wipe out chronic diffs of old doc against new doc
(cd docs && \
find . -name "*.html" | xargs sed -i -e '/class="sidebar-brand-text"/ s/Sage [0-9a-z.]* /Sage '"$new_version"' /' \
-e '/This is documentation for/ s/ built with GitHub PR [^.]*././' \
-e '/<link rel="stylesheet"/ s/?v=[0-9a-f]*"/"/' \
-e 's;'"$mathjax_path_from"';'"$mathjax_path_to"';' \
-e '\;<script type="application/vnd\.jupyter\.widget-state+json">;,\;</script>; d')
# Create git repo from old doc
Expand Down Expand Up @@ -166,7 +166,13 @@ jobs:
docker cp BUILD:/sage/local/share/doc/sage/html docs
docker cp BUILD:/sage/local/share/doc/sage/index.html docs
(cd docs && git commit -a -m 'new')
# Wipe out chronic diffs of new doc against old doc
(cd docs && \
find . -name "*.html" | xargs sed -i -e '/This is documentation for/ s/ built with GitHub PR .*. Doc/. Doc/' \
-e '/<link rel="stylesheet"/ s/?v=[0-9a-f]*"/"/')
.ci/create-changes-html.sh $(cd docs && git rev-parse HEAD^) docs
# Restore the new doc from changes by "wipe out"
(cd docs && git checkout -f)
(cd docs && rm -rf .git)
mv CHANGES.html docs
# We also need to replace the symlinks because netlify is not following them
Expand Down

0 comments on commit c7598cf

Please sign in to comment.