Skip to content

Commit d38dad9

Browse files
authored
Merge pull request #121 from Seasawher/mdbook
mdbook setup
2 parents f7e71a9 + 71dd66d commit d38dad9

25 files changed

+1305
-5877
lines changed

.github/workflows/book.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@ jobs:
88
steps:
99
- uses: actions/checkout@v3
1010

11+
- name: install elan
12+
run: |
13+
curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh -s -- -y --default-toolchain $(cat lean-toolchain)
14+
echo "$HOME/.elan/bin" >> $GITHUB_PATH
15+
16+
# note: `lake run build` raise an error in GitHub Action
17+
- name: build markdown files by mdgen
18+
run: lake exe mdgen lean md
19+
1120
- name: Install Dependencies
1221
run: sudo apt update && sudo apt install -y pandoc texlive-latex-base texlive-latex-extra texlive-latex-recommended texlive-luatex fonts-dejavu python3-pygments
1322

.github/workflows/deploy.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Deploy to github pages
2+
3+
on: [push, pull_request]
4+
5+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
6+
permissions:
7+
contents: read
8+
pages: write
9+
id-token: write
10+
11+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
12+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: false
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: checkout
22+
uses: actions/checkout@v4
23+
24+
- name: install elan
25+
run: |
26+
curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh -s -- -y --default-toolchain $(cat lean-toolchain)
27+
echo "$HOME/.elan/bin" >> $GITHUB_PATH
28+
29+
# note: `lake run build` raise an error in GitHub Action
30+
- name: build markdown files by mdgen
31+
run: lake exe mdgen lean md
32+
33+
- name: setup mdBook
34+
uses: peaceiris/actions-mdbook@v1
35+
with:
36+
mdbook-version: '0.4.32'
37+
38+
- name: build html from markdown
39+
run: mdbook build
40+
41+
- name: upload artifact
42+
uses: actions/upload-pages-artifact@v2
43+
with:
44+
path: ./book
45+
46+
deploy:
47+
if: github.ref == 'refs/heads/master'
48+
environment:
49+
name: github-pages
50+
url: ${{ steps.deployment.outputs.page_url }}
51+
runs-on: ubuntu-latest
52+
needs: build
53+
steps:
54+
- name: Deploy to GitHub Pages
55+
id: deployment
56+
uses: actions/deploy-pages@v3

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
/build
2-
.lake/
2+
.lake/
3+
book
4+
md/
5+
!md/SUMMARY.md

book.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[book]
2+
authors = ["Arthur Paulino, Damiano Testa, Edward Ayers, Evgenia Karunus, Henrik Böving, Jannis Limperg, Siddhartha Gadgil, Siddharth Bhat"]
3+
language = "en"
4+
multilingual = false
5+
src = "md"
6+
title = "Metaprogramming in Lean 4"
7+
8+
[output.html]
9+
git-repository-url = "https://github.com/leanprover-community/lean4-metaprogramming-book"

md/SUMMARY.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Summary
2+
3+
- [Introduction](./main/01_intro.md)
4+
- [Overview](./main/02_overview.md)
5+
- [Expressions](./main/03_expressions.md)
6+
- [MetaM](./main/04_metam.md)
7+
- [Syntax](./main/05_syntax.md)
8+
- [Macros](./main/06_macros.md)
9+
- [Elaboration](./main/07_elaboration.md)
10+
- [Embedding DSLs By Elaboration](./main/08_dsls.md)
11+
- [Tactics](./main/09_tactics.md)
12+
- [Lean4 Cheat-sheet](./main/10_cheat-sheet.md)
13+
14+
# Extra
15+
16+
- [Options](./extra/01_options.md)
17+
- [Attributes]()
18+
- [Pretty Printing](./extra/03_pretty-printing.md)

md/cover.md

Lines changed: 0 additions & 16 deletions
This file was deleted.

md/extra/01_options.md

Lines changed: 0 additions & 88 deletions
This file was deleted.

md/extra/02_attributes.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)