Git Product home page Git Product logo

tutorial's Introduction

Build Status

Lean Tutorial

How to Build

We use cask to install emacs dependencies (org-mode, lean-mode, htmlize) and pygments and minted to syntax-highlight Lean code in LaTeX. We assume that you already have emacs-24.3 or higher installed in your system.

sudo apt-get install mercurial python2.7 texlive-latex-recommended \
                     texlive-humanities texlive-xetex texlive-science \
                     texlive-latex-extra texlive-fonts-recommended \
                     bibtex2html git make mercurial autoconf automake gcc curl
git clone https://github.com/leanprover/tutorial
cd tutorial
tar xvfz header/l3kernel.tar.gz -C ~/
make install-cask # after this, you need to add the cask binary to your $PATH
make install-pygments  
make

Automatic Build using Watchman

Using watchman, we can detect any changes on the org-files, and trigger re-builds automatically on the background.

To install watchman:

sudo apt-get install automake
make install-watchman

To enable watch:

make watch-on

To disable watch:

make watch-off

How to preview generated HTML files

It requires a webserver to preview generated HTML files. We can use Python's SimpleHTTPServer module:

tutorial $ python -m SimpleHTTPServer

The above command starts a HTTP server at tutorial directory (default port: 8000). For example, 01_Introduction.html is available at http://localhost:8000/01_Introduction.html.

Auto-reload HTML page

  • Firefox: Auto Reload add-on

    • Tools > AutoReload Preferences 1
    • Create Reload Rule 2
    • Link .html in the filesystem 3
  • Chrome: Tincr (does not work on Linux)

    • Right-click and choose "Inspect Element" 5
    • Go to "tincr" tab, choose "Http Web Server" for project type, then select Root directory. 4

Test Lean Code in .org files

First, you need to install Lean. Please follow the instructions at the download page. You can test all Lean code blocks in *.org files by executing the following command:

make test

To use a specific binary of Lean in test, please do the following:

LEAN_BIN=/path/to/your/lean make test

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.