Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add: Table of Contents to each chapter (2-12) using mdbook-toc #128

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,27 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download mdbook for Lean
- name: Download mdbook and dependencies for Lean
shell: bash
run: |
mkdir -p $HOME/.local/bin
echo "$HOME/.local/bin" >> $GITHUB_PATH

curl -O --location https://github.com/leanprover/mdBook/releases/download/v0.4.6/mdbook-linux.tar.gz
tar xvf mdbook-linux.tar.gz
./mdbook-linux/mdbook --help
cp ./mdbook-linux/mdbook $HOME/.local/bin/
ldd ./mdbook-linux/mdbook
mdbook --help

curl -O --location https://github.com/badboy/mdbook-toc/releases/download/0.14.2/mdbook-toc-0.14.2-x86_64-unknown-linux-gnu.tar.gz
tar xvf mdbook-toc-0.14.2-x86_64-unknown-linux-gnu.tar.gz
cp ./mdbook-toc $HOME/.local/bin/
ldd ./mdbook-toc
mdbook-toc --help
- name: Run mdbook build
shell: bash
run: |
./mdbook-linux/mdbook build
mdbook build
rm -rf ./out/.git
rm -rf ./out/.github
- name: Deploy 🚀
Expand Down
16 changes: 13 additions & 3 deletions .github/workflows/netlify-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,27 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download mdbook for Lean
- name: Download mdbook and dependencies for Lean
shell: bash
run: |
mkdir -p $HOME/.local/bin
echo "$HOME/.local/bin" >> $GITHUB_PATH

curl -O --location https://github.com/leanprover/mdBook/releases/download/v0.4.6/mdbook-linux.tar.gz
tar xvf mdbook-linux.tar.gz
./mdbook-linux/mdbook --help
cp ./mdbook-linux/mdbook $HOME/.local/bin/
ldd ./mdbook-linux/mdbook
mdbook --help

curl -O --location https://github.com/badboy/mdbook-toc/releases/download/0.14.2/mdbook-toc-0.14.2-x86_64-unknown-linux-gnu.tar.gz
tar xvf mdbook-toc-0.14.2-x86_64-unknown-linux-gnu.tar.gz
cp ./mdbook-toc $HOME/.local/bin/
ldd ./mdbook-toc
mdbook-toc --help
- name: Run mdbook build
shell: bash
run: |
./mdbook-linux/mdbook build
mdbook build
rm -rf ./out/.git
rm -rf ./out/.github
- name: Deploy to Netlify hosting
Expand Down
4 changes: 4 additions & 0 deletions axioms_and_computation.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ compatible with bytecode evaluation, whereas the third is not amenable
to computational interpretation. We will spell out the details more
precisely below.

### Contents

<!-- toc -->

Historical and Philosophical Context
------------------------------------

Expand Down
4 changes: 4 additions & 0 deletions book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ git-repository-url = "https://github.com/leanprover/theorem_proving_in_lean4"

[output.html.playground.boring-prefixes]
lean = "# "

[preprocessor.toc]
command = "mdbook-toc"
renderer = ["html"]
4 changes: 4 additions & 0 deletions conv.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ Inside a tactic block, one can use the keyword `conv` to enter
goals, even inside function abstractions and dependent arrows, to apply rewriting or
simplifying steps.

### Contents

<!-- toc -->

Basic navigation and rewriting
-------

Expand Down
4 changes: 4 additions & 0 deletions dependent_type_theory.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ theory known as the *Calculus of Constructions*, with a countable
hierarchy of non-cumulative universes and inductive types. By the end
of this chapter, you will understand much of what this means.

### Contents

<!-- toc -->

## Simple Type Theory

"Type theory" gets its name from the fact that every expression has an
Expand Down
4 changes: 4 additions & 0 deletions induction_and_recursion.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ refer to as the "equation compiler." The equation compiler is not part
of the trusted code base; its output consists of terms that are
checked independently by the kernel.

### Contents

<!-- toc -->

Pattern Matching
----------------

Expand Down
4 changes: 4 additions & 0 deletions inductive_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ to start with a low-level, hands-on understanding. We will start with
some basic examples of inductive types, and work our way up to more
elaborate and complex examples.

### Contents

<!-- toc -->

Enumerated Types
----------------

Expand Down
4 changes: 4 additions & 0 deletions interacting_with_lean.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ Not all of the information found here will be useful to you right
away. We recommend skimming this section to get a sense of Lean's
features, and then returning to it as necessary.

### Contents

<!-- toc -->

Importing Files
---------------

Expand Down
4 changes: 4 additions & 0 deletions propositions_and_proofs.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ Lean. In this chapter, we will begin to explain how to write
mathematical assertions and proofs in the language of dependent type
theory as well.

### Contents

<!-- toc -->

Propositions as Types
---------------------

Expand Down
6 changes: 5 additions & 1 deletion quantifiers_and_equality.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ statements involving the propositional connectives. In this chapter,
we extend the repertoire of logical constructions to include the
universal and existential quantifiers, and the equality relation.

### Contents

<!-- toc -->

The Universal Quantifier
------------------------

Expand Down Expand Up @@ -363,7 +367,7 @@ We can also use `_` in the first relation (right after ``<expr>_0``)
which is useful to align the sequence of relation/proof pairs:

```
calc <expr>_0
calc <expr>_0
'_' 'op_1' <expr>_1 ':=' <proof>_1
'_' 'op_2' <expr>_2 ':=' <proof>_2
...
Expand Down
4 changes: 4 additions & 0 deletions structures_and_records.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ automatically generates all the projection functions. The
previously defined ones. Moreover, Lean provides convenient notation
for defining instances of a given structure.

### Contents

<!-- toc -->

Declaring Structures
--------------------

Expand Down
4 changes: 4 additions & 0 deletions tactics.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ instruction. But they can also be shorter and easier to
write. Moreover, tactics offer a gateway to using Lean's automation,
since automated procedures are themselves tactics.

### Contents

<!-- toc -->

Entering Tactic Mode
--------------------

Expand Down
4 changes: 4 additions & 0 deletions type_classes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Type Classes

### Contents

<!-- toc -->

Type classes were introduced as a principled way of enabling
ad-hoc polymorphism in functional programming languages. We first observe that it
would be easy to implement an ad-hoc polymorphic function (such as addition) if the
Expand Down