Skip to content

Commit

Permalink
doc: initialize a user-facing mdbook
Browse files Browse the repository at this point in the history
Design:

- A flake similar to leanprover/lean4?subdir=docs/...
- Alectryon + Lean-mdBook
- CI + build

Signed-off-by: Ryan Lahfa <ryan.lahfa@inria.fr>
  • Loading branch information
Ryan Lahfa committed Jul 9, 2024
1 parent 769e55c commit 4ac0b8b
Show file tree
Hide file tree
Showing 10 changed files with 449 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/build-userdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Build Aeneas user docs and test them
on: [push, pull_request]

jobs:
test:
name: Test Aeneas user docs
runs-on: [self-hosted, linux, nix]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build the book
run: nix build '.?dir=docs/user'#book
# TODO: test the Lean examples code via nix build '.?dir=docs/user'#test or something similar.
32 changes: 32 additions & 0 deletions .github/workflows/deploy-userdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Deploy Aeneas user docs to GitHub pages
on:
push:
branches:
- main

jobs:
deploy:
runs-on: [self-hosted, linux, nix]
permissions:
contents: write # To push a branch
pull-requests: write # To create a PR from that branch
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Deploy GitHub Pages
run: |
# This assumes your book is in the root of your repository.
# Just add a `cd` here if you need to change to another directory.
nix build '.?dir=docs/user'#book -o html
git worktree add gh-pages
git config user.name "Deploy from CI"
git config user.email ""
cd gh-pages
# Delete the ref to avoid keeping history.
git update-ref -d refs/heads/gh-pages
rm -rf *
cp --dereference -vr ../html/* .
git add .
git commit -m "Deploy $GITHUB_SHA to gh-pages"
git push --force --set-upstream origin gh-pages
1 change: 1 addition & 0 deletions docs/user/.envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
1 change: 1 addition & 0 deletions docs/user/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
book
6 changes: 6 additions & 0 deletions docs/user/book.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[book]
authors = ["The Aeneas contributors"]
language = "en"
multilingual = false
src = "src"
title = "Aeneas user documentation"
256 changes: 256 additions & 0 deletions docs/user/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4ac0b8b

Please sign in to comment.