@@ -63,12 +63,12 @@ jobs:
6363 mathjax_path_to=$(SAGE_USE_CDNS=yes /sage/sage -python -c "from sage_docbuild.conf import mathjax_path; print(mathjax_path)")
6464 new_version=$(cat src/VERSION.txt)
6565 # Wipe out chronic diffs between old doc and new doc
66- (cd /sage/local/share/doc/sage/html/en && \
66+ (cd /sage/local/share/doc/sage/html && \
6767 find . -name "*.html" | xargs sed -i -e '/class="sidebar-brand-text"/ s/Sage [0-9a-z.]* /Sage '"$new_version"' /' \
6868 -e 's;'"$mathjax_path_from"';'"$mathjax_path_to"';' \
6969 -e '\;<script type="application/vnd\.jupyter\.widget-state+json">;,\;</script>; d')
7070 # Create git repo from old doc
71- (cd /sage/local/share/doc/sage/html/en && \
71+ (cd /sage/local/share/doc/sage/html && \
7272 git init && \
7373 (echo "*.svg binary"; echo "*.pdf binary") >> .gitattributes && \
7474 (echo ".buildinfo"; echo '*.inv'; echo '.git*'; echo '*.svg'; echo '*.pdf'; echo '*.png'; echo 'searchindex.js') > .gitignore; \
@@ -116,9 +116,9 @@ jobs:
116116 run : |
117117 set -ex
118118 export SAGE_USE_CDNS=yes
119- mv /sage/local/share/doc/sage/html/en/ .git /sage/.git-doc
119+ mv /sage/local/share/doc/sage/html/.git /sage/.git-doc
120120 make doc-clean doc-uninstall
121- mkdir -p /sage/local/share/doc/sage/html/en/ && mv /sage/.git-doc /sage/local/share/doc/sage/html/en /.git
121+ mkdir -p /sage/local/share/doc/sage/html/ && mv /sage/.git-doc /sage/local/share/doc/sage/html/.git
122122 ./config.status && make sagemath_doc_html-no-deps
123123 working-directory : ./worktree-image
124124 env :
@@ -131,9 +131,9 @@ jobs:
131131 run : |
132132 set -ex
133133 mkdir -p ./docs
134- (cd /sage/local/share/doc/sage/html/en && git commit -a -m 'new')
134+ (cd /sage/local/share/doc/sage/html && git commit -a -m 'new')
135135 # Wipe out chronic diffs between old doc and new doc
136- (cd /sage/local/share/doc/sage/html/en && \
136+ (cd /sage/local/share/doc/sage/html && \
137137 find . -name "*.html" | xargs sed -i -e '\;<script type="application/vnd\.jupyter\.widget-state+json">;,\;</script>; d')
138138 # Create CHANGES.html
139139 echo '<html>' > ./docs/CHANGES.html
@@ -162,7 +162,7 @@ jobs:
162162 EOF
163163 echo '</head>' >> ./docs/CHANGES.html
164164 echo '<body>' >> ./docs/CHANGES.html
165- (cd /sage/local/share/doc/sage/html/en && git diff HEAD^; rm -rf .git) > ./docs/diff.txt
165+ (cd /sage/local/share/doc/sage/html && git diff HEAD^ -- *.html ; rm -rf .git) > ./docs/diff.txt
166166 /sage/sage -python - << EOF
167167 import re, html
168168 with open('./docs/diff.txt', 'r') as f:
@@ -172,7 +172,7 @@ jobs:
172172 for block in diff_blocks:
173173 match = re.search(r'^diff --git a/(.*) b/\1', block, flags=re.MULTILINE)
174174 if match:
175- path = match.group(1)
175+ path = 'html/' + match.group(1)
176176 out_blocks.append(f'<p class="diff"><a href="{path}">{path}</a> </p>\n<pre><code class="language-diff">' + html.escape(block).strip() + '</code></pre>')
177177 output_text = '\n'.join(out_blocks)
178178 with open('./docs/diff.html', 'w') as f:
@@ -182,11 +182,12 @@ jobs:
182182 echo '</body>' >> ./docs/CHANGES.html
183183 echo '</html>' >>./docs/CHANGES.html
184184 rm ./docs/diff.txt ./docs/diff.html
185- (cd /sage/local/share/doc/sage/html/en && git reset --hard HEAD)
185+ (cd /sage/local/share/doc/sage/html && git reset --hard HEAD)
186186 # For some reason the deploy step below cannot find /sage/...
187187 # So copy everything from there to local folder
188188 # We also need to replace the symlinks because netlify is not following them
189- cp -r -L /sage/local/share/doc/sage/html/en/* ./docs
189+ cp -r -L /sage/local/share/doc/sage/html ./docs
190+ cp /sage/local/share/doc/sage/index.html ./docs
190191 # Zip everything for increased performance
191192 zip -r docs.zip docs
192193
@@ -196,3 +197,36 @@ jobs:
196197 with :
197198 name : docs
198199 path : docs.zip
200+
201+ - name : Build live doc
202+ id : buildlivedoc
203+ if : (success() || failure()) && steps.copy.outcome == 'success' && github.repository == 'sagemath/sage' && github.ref == 'refs/heads/develop'
204+ run : |
205+ set -ex
206+ export SAGE_USE_CDNS=yes
207+ export SAGE_LIVE_DOC=yes
208+ export SAGE_JUPYTER_SERVER=binder:sagemath/sage-binder-env/dev
209+ make doc-clean doc-uninstall
210+ ./config.status && make sagemath_doc_html-no-deps
211+ working-directory : ./worktree-image
212+ env :
213+ MAKE : make -j2 --output-sync=recurse
214+ SAGE_NUM_THREADS : 2
215+
216+ - name : Copy live doc
217+ id : copylivedoc
218+ if : (success() || failure()) && steps.buildlivedoc.outcome == 'success'
219+ run : |
220+ set -ex
221+ mkdir -p ./livedoc
222+ cp -r -L /sage/local/share/doc/sage/html ./livedoc
223+ cp /sage/local/share/doc/sage/index.html ./livedoc
224+ zip -r livedoc.zip livedoc
225+
226+ - name : Upload live doc
227+ if : (success() || failure()) && steps.copylivedoc.outcome == 'success'
228+ uses : actions/upload-artifact@v3
229+ with :
230+ name : livedoc
231+ path : livedoc.zip
232+
0 commit comments