@@ -63,12 +63,12 @@ jobs:
63
63
mathjax_path_to=$(SAGE_USE_CDNS=yes /sage/sage -python -c "from sage_docbuild.conf import mathjax_path; print(mathjax_path)")
64
64
new_version=$(cat src/VERSION.txt)
65
65
# 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 && \
67
67
find . -name "*.html" | xargs sed -i -e '/class="sidebar-brand-text"/ s/Sage [0-9a-z.]* /Sage '"$new_version"' /' \
68
68
-e 's;'"$mathjax_path_from"';'"$mathjax_path_to"';' \
69
69
-e '\;<script type="application/vnd\.jupyter\.widget-state+json">;,\;</script>; d')
70
70
# Create git repo from old doc
71
- (cd /sage/local/share/doc/sage/html/en && \
71
+ (cd /sage/local/share/doc/sage/html && \
72
72
git init && \
73
73
(echo "*.svg binary"; echo "*.pdf binary") >> .gitattributes && \
74
74
(echo ".buildinfo"; echo '*.inv'; echo '.git*'; echo '*.svg'; echo '*.pdf'; echo '*.png'; echo 'searchindex.js') > .gitignore; \
@@ -116,9 +116,9 @@ jobs:
116
116
run : |
117
117
set -ex
118
118
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
120
120
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
122
122
./config.status && make sagemath_doc_html-no-deps
123
123
working-directory : ./worktree-image
124
124
env :
@@ -131,9 +131,9 @@ jobs:
131
131
run : |
132
132
set -ex
133
133
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')
135
135
# 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 && \
137
137
find . -name "*.html" | xargs sed -i -e '\;<script type="application/vnd\.jupyter\.widget-state+json">;,\;</script>; d')
138
138
# Create CHANGES.html
139
139
echo '<html>' > ./docs/CHANGES.html
@@ -162,7 +162,7 @@ jobs:
162
162
EOF
163
163
echo '</head>' >> ./docs/CHANGES.html
164
164
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
166
166
/sage/sage -python - << EOF
167
167
import re, html
168
168
with open('./docs/diff.txt', 'r') as f:
@@ -172,7 +172,7 @@ jobs:
172
172
for block in diff_blocks:
173
173
match = re.search(r'^diff --git a/(.*) b/\1', block, flags=re.MULTILINE)
174
174
if match:
175
- path = match.group(1)
175
+ path = 'html/' + match.group(1)
176
176
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>')
177
177
output_text = '\n'.join(out_blocks)
178
178
with open('./docs/diff.html', 'w') as f:
@@ -182,11 +182,12 @@ jobs:
182
182
echo '</body>' >> ./docs/CHANGES.html
183
183
echo '</html>' >>./docs/CHANGES.html
184
184
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)
186
186
# For some reason the deploy step below cannot find /sage/...
187
187
# So copy everything from there to local folder
188
188
# 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
190
191
# Zip everything for increased performance
191
192
zip -r docs.zip docs
192
193
@@ -196,3 +197,36 @@ jobs:
196
197
with :
197
198
name : docs
198
199
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