Skip to content

Commit 00d2f7c

Browse files
authored
Merge pull request #2 from jscoq/v8.17
[version] Port to Coq 8.17
2 parents aacdbdb + 37bf57a commit 00d2f7c

File tree

7 files changed

+316
-1462
lines changed

7 files changed

+316
-1462
lines changed

CHANGES.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
unreleased
2+
----------
3+
4+
- Allow `?backend=js` in the URL to set backend to JS instead of WASM
5+
(@ejgallego, #2)
6+
- Port to jsCoq 8.17 , thanks to Shachar for a lot of help! (@ejgallego, #2)
7+
- Initial version, thanks to all in Zulip for lots of feedback.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ FILES_HTML=$(addsuffix .html,$(FILES))
77

88
all: $(FILES_HTML)
99

10-
%.html: %.v %.glob
10+
%.html: %.v %.glob jscoqdoc
1111
./jscoqdoc $<
1212

1313
%.glob: %.v

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ We have customized the following files from the oficial distro:
2222
+ custom load of packages in `jscoq-agent.js`
2323
+ custom paths in `jscoqdoc` binary
2424

25-
We default to the WebAssembly jsCoq version.
25+
We default to the WebAssembly jsCoq version, to update that set the
26+
`backend:` parameter in the `jscoq-agent` file to `js` or use the
27+
query `?backend=wa` in the jsCoq URL.
2628

2729
You may want to tweak more stuff too.
2830

jscoq-agent.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This script is adapted from the Software Foundations jsCoq build.
55
* So, it may require some tweaking depending on your development and styles.
66
*/
7-
import { JsCoq, Deprettify } from './node_modules/wacoq/ui-js/index.js';
7+
import { JsCoq, Deprettify } from './node_modules/jscoq/dist/frontend/index.js';
88

99
function jsCoqInject() {
1010
var b = document.body;
@@ -22,7 +22,11 @@ var jsCoqShow = location.search === '?jscoq=on' ||
2222
location.search !== '?jscoq=off' && localStorage.jsCoqShow === 'true';
2323

2424
var jscoq_ids = ['#main > div.code, #main > div.HIDEFROMHTML > div.code'];
25+
26+
var sp = new URLSearchParams(location.search);
27+
2528
var jscoq_opts = {
29+
backend: sp.get('backend') || 'wa',
2630
layout: 'flex',
2731
show: jsCoqShow,
2832
focus: false,
@@ -47,8 +51,8 @@ async function jsCoqLoad() {
4751
page.setAttribute('tabindex', '-1');
4852
page.focus();
4953

50-
// - load and start jsCoq
51-
await JsCoq.load(jscoq_opts.base_path);
54+
// - load and start jsCoq, not needed in 8.17
55+
// await JsCoq.load(jscoq_opts.base_path);
5256

5357
Deprettify.REPLACES.push( // LF,PLF define their own versions (for Imp)
5458
[//g, '\\/'], [//g, '/\\'], [//g, '<->'], [//g, '<='], [//g, '<>'],

jscoqdoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ const fs = require('fs'),
66
chld = require('child-process-promise');
77

88
const JSCOQ_URL = process.env['JSCOQ_URL'] || '.',
9-
SCRIPTS = ["node_modules/wacoq/ui-js/jscoq-loader.js", "jscoq-agent.js"],
10-
STYLES = ["node_modules/wacoq/ui-css/jscoqdoc.css"];
9+
SCRIPTS = ["node_modules/jscoq/dist/frontend/index.js", "jscoq-agent.js"],
10+
STYLES = ["node_modules/jscoq/dist/frontend/index.css", "node_modules/jscoq/frontend/classic/css/jscoqdoc.css"];
1111

1212
const DEFAULT_TEMPLATE =`
1313
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

0 commit comments

Comments
 (0)