├── combined_lib ├── .gitignore ├── leanpkg.bak2 └── leanpkg.toml ├── .gitignore ├── src ├── typings.d.ts ├── syntax.ts ├── langservice.ts ├── index.tsx └── translations.json ├── detect_errors.py ├── tsconfig.json ├── elan_setup.sh ├── fetch_lean_js.sh ├── public ├── display-goal-light.svg ├── display-list-light.svg ├── index.html ├── index.css └── lean_logo.svg ├── deploy.sh ├── tslint.json ├── package.json ├── webpack.config.js ├── .github └── workflows │ └── build.yml ├── mk_library.py └── README.md /combined_lib/.gitignore: -------------------------------------------------------------------------------- 1 | *.olean 2 | /_target 3 | /leanpkg.path 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | lib 3 | .*.sw? 4 | *-debug.log 5 | *.tgz 6 | /dist 7 | /.vscode 8 | -------------------------------------------------------------------------------- /src/typings.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.json' { 2 | const value: any; 3 | export default value; 4 | } -------------------------------------------------------------------------------- /combined_lib/leanpkg.bak2: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "combined_lib" 3 | version = "3.4.2" 4 | lean_version = "leanprover-community-lean-nightly" 5 | 6 | [dependencies] 7 | mathlib = {git = "https://github.com/leanprover/mathlib", rev = "99ebbdbfe85eb37050748fc0c25c085801f3eef2"} 8 | -------------------------------------------------------------------------------- /detect_errors.py: -------------------------------------------------------------------------------- 1 | import itertools 2 | import sys 3 | 4 | for line in sys.stdin: 5 | sys.stdout.write(line) 6 | if 'error:' in line: 7 | for line in itertools.islice(sys.stdin, 20): 8 | sys.stdout.write(line) 9 | sys.exit(1) 10 | -------------------------------------------------------------------------------- /combined_lib/leanpkg.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "combined_lib" 3 | version = "3.46.0" 4 | lean_version = "leanprover-community/lean:3.46.0" 5 | 6 | [dependencies] 7 | mathlib = {git = "https://github.com/leanprover-community/mathlib", rev = "1e6b748c175e64dd033d7a1a1bfe3e9fe72011d3"} 8 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es6", 5 | "outDir": "lib", 6 | "noImplicitAny": false, 7 | "alwaysStrict": true, 8 | "allowJs": true, 9 | "lib": [ "es6", "dom" ], 10 | "jsx": "react", 11 | "sourceMap": false 12 | }, 13 | "include": [ "src/*" ] 14 | } 15 | -------------------------------------------------------------------------------- /elan_setup.sh: -------------------------------------------------------------------------------- 1 | set -e # fail on error 2 | set -x 3 | # Get lean_version from mathlib master: 4 | export LATEST_BROWSER_LEAN=$(curl -s -N https://raw.githubusercontent.com/leanprover-community/mathlib/master/leanpkg.toml | grep -m1 lean_version | cut -d'"' -f2 | cut -d':' -f2) 5 | 6 | elan self update 7 | elan toolchain install leanprover-community/lean:$LATEST_BROWSER_LEAN 8 | 9 | set +x 10 | -------------------------------------------------------------------------------- /fetch_lean_js.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -ex 3 | 4 | out_dir=dist 5 | mkdir -p $out_dir 6 | 7 | base_url=https://bryangingechen.github.io/lean/lean-web-editor 8 | lib_name=library # change to 'libcore' to download a bundle of the core libraries 9 | 10 | for i in lean_js_js.js lean_js_wasm.js lean_js_wasm.wasm \ 11 | $lib_name.zip $lib_name.info.json $lib_name.olean_map.json 12 | do 13 | curl $base_url/$i -o $out_dir/$i 14 | done 15 | -------------------------------------------------------------------------------- /public/display-goal-light.svg: -------------------------------------------------------------------------------- 1 | 2 | 11 | -------------------------------------------------------------------------------- /public/display-list-light.svg: -------------------------------------------------------------------------------- 1 | 2 | 11 | -------------------------------------------------------------------------------- /deploy.sh: -------------------------------------------------------------------------------- 1 | set -e # fail on error 2 | set -x # echo commands 3 | 4 | LATEST_BROWSER_LEAN_URL=https://github.com/leanprover-community/lean/releases/download/v$LATEST_BROWSER_LEAN/lean-$LATEST_BROWSER_LEAN--browser.zip 5 | 6 | rm -f dist/*.worker.js 7 | npm install 8 | NODE_ENV=production ./node_modules/.bin/webpack 9 | cd dist 10 | curl -sL $LATEST_BROWSER_LEAN_URL --output leanbrowser.zip 11 | unzip -q leanbrowser.zip 12 | rm leanbrowser.zip 13 | mv build/shell/* . 14 | rm -rf build/ 15 | cd .. 16 | -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 |