Skip to content

Commit 74c84a7

Browse files
committed
[build] Add support for building a lessons coq-pkg package
Note: this is still not working due to version mismatches with the SDK.
1 parent 00d2f7c commit 74c84a7

File tree

5 files changed

+27
-4
lines changed

5 files changed

+27
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
node_modules
88
*.html
99
coqdoc.css
10+
coq-pkgs

Makefile

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: all clean serve
1+
.PHONY: all clean serve docker-setup
22

33
COQDOC_AUTO=coqdoc.css
44

@@ -11,13 +11,23 @@ all: $(FILES_HTML)
1111
./jscoqdoc $<
1212

1313
%.glob: %.v
14-
coqc $<
14+
npx jscoq sdk coqc -R . MyCourse $<
1515

1616
clean:
1717
rm -f *.vo *.vok .*.aux *.glob *.vos $(FILES_HTML) $(COQDOC_AUTO)
1818

1919
node_modules: package.json package-lock.json
2020
npm i
2121

22-
serve: node_modules
22+
serve: node_modules coq-pkgs/my_course.coq-pkg
2323
./node_modules/.bin/http-server .
24+
25+
coq-pkgs/my_course.coq-pkg: $(FILES_HTML) docker-setup
26+
npx jscoq build . --top MyCourse --package $@
27+
cp -a coq-pkgs/* node_modules/jscoq/coq-pkgs/
28+
29+
SDK_VERSION=v8.17
30+
31+
docker-setup:
32+
docker pull jscoq/jscoq:$(SDK_VERSION)-sdk
33+
docker tag jscoq/jscoq:$(SDK_VERSION)-sdk jscoq:sdk

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ $ make serve # Open a web server with the jsCoq files
1515
Note that `make serve` doesn't need to be restarted after a regular
1616
`make`.
1717

18+
# Building multiple files with the jsCoq SDK
19+
20+
This is WIP, for now you can do:
21+
22+
- `make coq-pkgs/my_course.coq-pkg`
23+
- Auto-import is not working, you'll have to click on the package
24+
manager
25+
1826
# Tweaks from official distro
1927

2028
We have customized the following files from the oficial distro:

jscoq-agent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ var jscoq_opts = {
3535
// editor: { mode: { 'company-coq': true }, className: 'jscoq code-tight' },
3636
editor: { className: 'jscoq code-tight' },
3737
init_pkgs: ['init'],
38-
all_pkgs: { '+': ['coq', 'mathcomp'] },
38+
all_pkgs: { '+': ['coq', 'mathcomp', 'my_course'] },
3939
init_import: ['utf8'],
4040
implicit_libs: true
4141
};

lesson_2.v

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ Set Implicit Arguments.
55
Unset Strict Implicit.
66
Unset Printing Implicit Defensive.
77

8+
From MyCourse Require Import lesson_1.
9+
10+
About x_implies_x.
11+
812
Definition sorry {T} : T. Admitted.
913
(** ** Reflection and proving with computation
1014

0 commit comments

Comments
 (0)