Skip to content

Commit

Permalink
implement a homepage (#183)
Browse files Browse the repository at this point in the history
* implement coqdoc

* make coqdoc to work

* update readme
  • Loading branch information
HuStmpHrrr authored Sep 10, 2024
1 parent e1a03fd commit 02c9f19
Show file tree
Hide file tree
Showing 15 changed files with 819 additions and 31 deletions.
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every weekday
interval: "daily"
labels:
- "dependencies"
25 changes: 18 additions & 7 deletions .github/workflows/ci_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,16 @@ jobs:

- name: repo checkout
uses: actions/checkout@v3


- name: Initialise variables
run: |
# Only deploy if the build follows from pushing to master
if [[ '${{ github.ref }}' == 'refs/heads/main' ]]; then
echo "DOC_DEPLOY=true" >> $GITHUB_ENV
else
echo "DOC_DEPLOY=false" >> $GITHUB_ENV
fi
- name: container registry log in
uses: docker/login-action@v3
with:
Expand All @@ -56,19 +65,21 @@ jobs:
sudo chown -R coq:coq .
endGroup
script: |
startGroup "Build Coq lib"
cd theories/
make -j ${{ steps.cpu-cores.outputs.count }} pretty-timed
startGroup "Build binary"
if [[ "$DOC" ]]; then
make coqdoc
else
make
fi
endGroup
after_script: |
startGroup "Build binary"
cd ..
make
startGroup "after"
endGroup
export: "OPAMJOBS OPAMYES"
env:
OPAMJOBS: ${{ steps.cpu-cores.outputs.count }}
OPAMYES: "true"
DOC: ${{ env.DOC_DEPLOY }}

- name: permissions revert
# to avoid a warning at cleanup time
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ CoqMakefile.mk*
!CoqMakefile.mk.local
!CoqMakefile.mk.local-late
*.log
theories/html/

# Editor related
## Emacs
Expand Down
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
.PHONY: all clean

all:
@make -C theories
@$(MAKE) -C theories
@dune build

coqdoc: all
@${MAKE} coqdoc -C theories

clean:
@make clean -C theories
@$(MAKE) clean -C theories
@dune clean
@echo "Cleaning finished."
25 changes: 15 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ sound and complete: a program passes typechecking if and only if it is a well-ty
program in MLTT. This will be the first verified proof assistant (despite being
elementary) and serves as a basis for future extensions.

## Online Documentation

We have generated a [Coqdoc](toc.html) for browsing our Coq proof.

## Architecture

Expand Down Expand Up @@ -67,19 +70,21 @@ opam install ppx_inline_test

## Development

Before anything, the Coq parser must be extracted to OCaml code. Then, you can run `dune build` like normal for all other changes.
Use the toplevel `make` to build the whole project:
```
make
```
Makefile will try to find out the number of your CPU cores and parallel as much as
possible.

You can build changes to the Coq parser with the following commands:
Once `make` finishes, you can run the binary:
```
cd theories
make -j16 # or the number of your cpus
cd ..
dune build
_build/default/driver/mcltt.exe examples/nary.mcl # or your own example
```

Then you can interact with the parser at the toplevel with `dune utop`:
To build Coq proof only, you can go into and only build the Coq folder:
```
# open Mcltt;;
# open Parser.Cst;;
# Main.parse "<expression to parse>"
cd theories
make
```

8 changes: 8 additions & 0 deletions assets/extra/footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
</div>
<div id="footer">
Generated by <a href="http://coq.inria.fr/">coqdoc</a> and improved with <a href="https://github.com/coq-community/coqdocjs">CoqdocJS</a>
</div>
</div>
</body>

</html>
27 changes: 27 additions & 0 deletions assets/extra/header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<link href="resources/coqdoc.css" rel="stylesheet" type="text/css" />
<link href="resources/coqdocjs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resources/config.js"></script>
<script type="text/javascript" src="resources/coqdocjs.js"></script>
</head>

<body onload="document.getElementById('content').focus()">
<div id="header">
<span class="left">
<span class="modulename"> <script> document.write(document.title) </script> </span>
</span>

<span class="button" id="toggle-proofs"></span>

<span class="right">
<a href="../">Project Page</a>
<a href="./indexpage.html"> Index </a>
<a href="./toc.html"> Table of Contents </a>
</span>
</div>
<div id="content" tabindex="-1" onblur="document.getElementById('content').focus()">
<div id="main">
72 changes: 72 additions & 0 deletions assets/extra/resources/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
var coqdocjs = coqdocjs || {};

coqdocjs.repl = {
"forall": "∀",
"exists": "∃",
"~": "¬",
"/\\": "∧",
"\\/": "∨",
"->": "→",
"<-": "←",
"<->": "↔",
"=>": "⇒",
"<>": "≠",
"<=": "≤",
">=": "≥",
"el": "∈",
"nel": "∉",
"<<=": "⊆",
"|-": "⊢",
">>": "»",
"<<": "⊆",
"++": "⧺",
"===": "≡",
"=/=": "≢",
"=~=": "≅",
"==>": "⟹",
"lhd": "⊲",
"rhd": "⊳",
"nat": "ℕ",
"alpha": "α",
"beta": "β",
"gamma": "γ",
"delta": "δ",
"epsilon": "ε",
"eta": "η",
"iota": "ι",
"kappa": "κ",
"lambda": "λ",
"mu": "μ",
"nu": "ν",
"omega": "ω",
"phi": "ϕ",
"pi": "π",
"psi": "ψ",
"rho": "ρ",
"sigma": "σ",
"tau": "τ",
"theta": "θ",
"xi": "ξ",
"zeta": "ζ",
"Delta": "Δ",
"Gamma": "Γ",
"Pi": "Π",
"Sigma": "Σ",
"Omega": "Ω",
"Xi": "Ξ"
};

coqdocjs.subscr = {
"0" : "₀",
"1" : "₁",
"2" : "₂",
"3" : "₃",
"4" : "₄",
"5" : "₅",
"6" : "₆",
"7" : "₇",
"8" : "₈",
"9" : "₉",
};

coqdocjs.replInText = ["==>","<=>", "=>", "->", "<-", ":="];
Loading

0 comments on commit 02c9f19

Please sign in to comment.