See lean4web for a solution for Lean 4.
This repository contains the javascript code for the a Lean 3 live editor.
npm install
./fetch_lean_js.sh
./node_modules/.bin/webpack-dev-server
The fetch_lean_js.sh
script fetches a precompiled javascript version as well as a library.zip
file containing the olean files.
npm install
./fetch_lean_js.sh
./node_modules/.bin/webpack
Then copy the ./dist
directory wherever you want.
If you want to include custom libraries, then you need to build a suitable library.zip
file yourself.
- Change
combined_lib/leanpkg.toml
to include the libraries you want. - Run
./mk_library.py
to createdist/library.zip
. Make sure you run the same Lean version locally as the javascript version you target.