Skip to content

Commit 5acb536

Browse files
Merge remote-tracking branch 'upstream/main' into mvcgen-tutorial
2 parents e382bac + 0285ced commit 5acb536

File tree

90 files changed

+4049
-764
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+4049
-764
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ jobs:
131131
rm parse_times.py
132132
else
133133
echo "No build log found" >> $GITHUB_STEP_SUMMARY
134-
fi
134+
fi
135135
136136
- name: Save cache for .lake
137137
uses: actions/cache/save@v4
@@ -149,6 +149,10 @@ jobs:
149149
run: |
150150
lake --quiet exe generate-manual --depth 2 --with-word-count "words.txt" --verbose --without-html-single
151151
152+
- name: Check Manual Examples are Isolated
153+
run: |
154+
scripts/check-examples-isolated.sh
155+
152156
- name: Generate proofreading HTML
153157
if: github.event_name == 'pull_request'
154158
id: generate
@@ -380,4 +384,3 @@ jobs:
380384
run: |
381385
cd _out/html-multi/-verso-search
382386
tsc --noEmit -p jsconfig.json
383-

.github/workflows/overlay.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Apply Overlays
2+
3+
on:
4+
workflow_run:
5+
workflows: ["Deploy Tagged Version"]
6+
types:
7+
- completed
8+
9+
push:
10+
branches:
11+
- 'deploy'
12+
13+
workflow_dispatch:
14+
15+
jobs:
16+
apply-overlays:
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: write # This allows pushing to the repository
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
24+
- name: Set up Python
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: '3.10'
28+
29+
- name: Configure Git
30+
# These values are recommended at:
31+
# https://github.com/actions/checkout?tab=readme-ov-file#push-a-commit-using-the-built-in-token
32+
run: |
33+
git config --global user.name "github-actions[bot]"
34+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
35+
git fetch origin deploy:deploy
36+
git fetch origin postdeploy:postdeploy
37+
38+
- name: Run overlay script
39+
run: |
40+
echo "Adding overlays to predeploy"
41+
# -B to prevent creation of __pycache__ directory
42+
# which would get committed due to lack of .gitignore
43+
python -B deploy/overlay.py . deploy postdeploy
44+
45+
- name: Push deploy branch
46+
run: |
47+
git push origin postdeploy

.github/workflows/release-tag.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ jobs:
1515
uses: actions/checkout@v4
1616
with:
1717
fetch-depth: 0 # Fetch all history for all tags and branches
18-
18+
1919
- name: Set up Python
2020
uses: actions/setup-python@v5
2121
with:
2222
python-version: '3.10'
23-
23+
2424
- name: Extract version from tag
2525
id: get_version
2626
run: |
@@ -107,13 +107,11 @@ jobs:
107107
run: |
108108
# The tag name is simply GITHUB_REF_NAME
109109
TAG_NAME=$GITHUB_REF_NAME
110-
echo "Deploying from tag: '$TAG_NAME'"
111-
110+
echo "Making deployment from tag: '$TAG_NAME'"
111+
112112
113113
python deploy/release.py html/html-multi "$VERSION" deploy
114114
115115
- name: Push deploy branch
116116
run: |
117117
git push origin deploy
118-
119-

.github/workflows/upload-snapshots.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
name: "Deploy the 'deploy' branch"
1+
name: "Deploy the 'postdeploy' branch"
22
on:
33
workflow_run:
4-
workflows: ["Deploy Tagged Version"]
4+
workflows: ["Apply Overlays"]
55
types:
66
- completed
77

88
push:
99
branches:
10-
- 'deploy'
10+
- 'postdeploy'
1111

1212
workflow_dispatch:
1313

@@ -18,17 +18,17 @@ jobs:
1818
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
1919
steps:
2020

21-
- name: Checkout deploy branch
21+
- name: Checkout postdeploy branch
2222
uses: actions/checkout@v4
2323
with:
24-
ref: 'deploy'
24+
ref: 'postdeploy'
2525

26-
- name: Upload the current state of the deploy branch
26+
- name: Upload the current state of the postdeploy branch
2727
id: deploy-release
2828
uses: nwtgck/[email protected]
2929
with:
3030
publish-dir: '.'
31-
production-branch: deploy
31+
production-branch: postdeploy
3232
production-deploy: true
3333
github-token: ${{ secrets.GITHUB_TOKEN }}
3434
deploy-message: |

.vale/scripts/rewrite_html.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,18 @@
77

88
def process_html_file(filepath, output_filepath):
99
"""Reads an HTML file, removes 'QA' from headers, and writes the result to the output path."""
10+
11+
# We exclude release notes. Before
12+
# https://github.com/leanprover/reference-manual/pull/599 we generated one
13+
# block for each release notes document which had class="no-vale" on it.
14+
# However, it's currently not easy to add any attributes to verso parts,
15+
# which https://github.com/leanprover/reference-manual/pull/599 adds, hence
16+
# the current workaround here.
17+
#
18+
# Reconsider this if https://github.com/leanprover/verso/issues/561 is resolved.
19+
if "/releases/" in filepath:
20+
return
21+
1022
with open(filepath, 'r', encoding='utf-8') as file:
1123
soup = BeautifulSoup(file, 'html.parser')
1224

.vale/styles/config/ignore/terms.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,4 +217,5 @@ upvote
217217
VC
218218
VCs
219219
walkthrough
220+
workspace's
220221
zulip

ExtractExplanationExamples.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ where
8181
IO Highlighted :=
8282
let termElab : TermElabM Highlighted := do
8383
let mut hls := Highlighted.empty
84-
let mut lastPos : String.Pos := 0
84+
let mut lastPos : String.Pos.Raw := 0
8585
for cmd in cmds do
8686
let hl ← highlightIncludingUnparsed cmd nonSilentMsgs cmdState.infoState.trees [] lastPos
8787
hls := hls ++ hl

Main.lean

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Author: David Thrane Christiansen
66
import Manual
77
import Manual.Meta
88
import VersoManual
9+
import Manual.ExtractExamples
910

1011
open Verso.Genre.Manual
1112
open Verso.Genre.Manual.InlineLean
@@ -32,7 +33,7 @@ def staticCss := {{
3233
}}
3334

3435
def main :=
35-
manualMain (%doc Manual) (config := config)
36+
manualMain (%doc Manual) (config := config) (extraSteps := [extractExamples])
3637
where
3738
config := Config.addSearch <| Config.addKaTeX {
3839
extraFiles := [("static", "static")],

Manual.lean

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import Manual.Releases
3030
import Manual.Namespaces
3131
import Manual.Runtime
3232
import Manual.ModuleSystem
33+
import Manual.SupportedPlatforms
3334

3435
open Verso.Genre Manual
3536
open Verso.Genre.Manual.InlineLean
@@ -144,6 +145,8 @@ Overview of the standard library, including types from the prelude and those tha
144145

145146
{include 0 Manual.Releases}
146147

148+
{include 0 Manual.SupportedPlatforms}
149+
147150
# Index
148151
%%%
149152
number := false
@@ -164,6 +167,9 @@ file := some "the-index"
164167

165168
:::progress
166169
```namespace
170+
ByteArray
171+
ByteArray.Iterator
172+
ByteSlice
167173
List
168174
Int
169175
IntCast
@@ -206,6 +212,7 @@ LawfulFunctor
206212
LawfulApplicative
207213
LawfulMonad
208214
LawfulBEq
215+
ReflBEq
209216
EquivBEq
210217
LawfulHashable
211218
Id
@@ -219,7 +226,13 @@ EStateM.Result
219226
EStateM.Backtrackable
220227
String
221228
Substring
229+
String.Slice
230+
String.Slice.Pos
231+
String.Pattern
232+
String.Pos.Raw
222233
String.Pos
234+
String.ValidPos
235+
String.Iterator
223236
Char
224237
Nat
225238
Lean.Elab.Tactic
@@ -405,6 +418,43 @@ Substring.takeRightWhileAux
405418
Substring.takeWhileAux
406419
```
407420

421+
```exceptions
422+
String.Pos.Raw.ctorIdx
423+
String.Pos.Raw.extract.go₁
424+
String.Pos.Raw.extract.go₂
425+
String.Pos.Raw.mk.noConfusion
426+
String.Pos.Raw.utf8GetAux
427+
String.Pos.Raw.utf8GetAux?
428+
String.Pos.Raw.utf8PrevAux
429+
String.Pos.Raw.utf8SetAux
430+
```
431+
432+
```exceptions
433+
String.Slice.ctorIdx
434+
String.Slice.hash
435+
String.Slice.instDecidableEqPos.decEq
436+
String.Slice.instInhabitedByteIterator.default
437+
String.Slice.instInhabitedPosIterator.default
438+
String.Slice.instInhabitedRevPosIterator.default
439+
String.Slice.instInhabitedRevSplitIterator.default
440+
String.Slice.instInhabitedSplitInclusiveIterator.default
441+
String.Slice.instInhabitedSplitIterator.default
442+
String.Slice.lines.lineMap
443+
String.Slice.mk.noConfusion
444+
```
445+
446+
```exceptions
447+
String.Slice.Pos.ctorIdx
448+
String.Slice.Pos.mk.noConfusion
449+
String.Slice.Pos.prevAux
450+
String.Slice.Pos.prevAux.go
451+
```
452+
453+
```exceptions
454+
String.ValidPos.ctorIdx
455+
String.ValidPos.mk.noConfusion
456+
```
457+
408458
```exceptions
409459
Char.ofNatAux
410460
Char.quoteCore
@@ -436,6 +486,34 @@ BitVec.reduceShiftWithBitVecLit
436486
BitVec.reduceUnary
437487
```
438488

489+
```exceptions
490+
ByteArray.ctorIdx
491+
ByteArray.findFinIdx?.loop
492+
ByteArray.findIdx?.loop
493+
ByteArray.foldlM.loop
494+
ByteArray.foldlMUnsafe
495+
ByteArray.foldlMUnsafe.fold
496+
ByteArray.forIn.loop
497+
ByteArray.forInUnsafe
498+
ByteArray.forInUnsafe.loop
499+
ByteArray.hash
500+
ByteArray.instBEq.beq
501+
ByteArray.instInhabitedIterator.default
502+
ByteArray.mk.noConfusion
503+
ByteArray.mkIterator
504+
ByteArray.toList.loop
505+
ByteArray.utf8Decode?.go
506+
ByteArray.utf8DecodeChar?.assemble₁
507+
ByteArray.utf8DecodeChar?.assemble₂
508+
ByteArray.utf8DecodeChar?.assemble₂Unchecked
509+
ByteArray.utf8DecodeChar?.assemble₃
510+
ByteArray.utf8DecodeChar?.assemble₃Unchecked
511+
ByteArray.utf8DecodeChar?.assemble₄
512+
ByteArray.utf8DecodeChar?.assemble₄Unchecked
513+
ByteArray.utf8DecodeChar?.isInvalidContinuationByte
514+
ByteArray.utf8DecodeChar?.parseFirstByte
515+
```
516+
439517
```exceptions
440518
Quot.indep
441519
Quot.lcInv

0 commit comments

Comments
 (0)