-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from Vtec234/blueprint
Setup blueprint
- Loading branch information
Showing
21 changed files
with
804 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
name: Compile blueprint | ||
|
||
on: | ||
push: | ||
branches: | ||
- master # Trigger on pushes to the default branch | ||
workflow_dispatch: # Allow manual triggering of the workflow from the GitHub Actions interface | ||
|
||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
permissions: | ||
contents: read # Read access to repository contents | ||
pages: write # Write access to GitHub Pages | ||
id-token: write # Write access to ID tokens | ||
|
||
jobs: | ||
build_project: | ||
runs-on: ubuntu-latest | ||
name: Build project | ||
steps: | ||
- name: Checkout project | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # Fetch all history for all branches and tags | ||
|
||
- name: Install elan | ||
run: curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh -s -- -y | ||
|
||
- name: Get Mathlib cache | ||
run: ~/.elan/bin/lake exe cache get || true | ||
|
||
- name: Build project | ||
run: ~/.elan/bin/lake build GroupoidModel | ||
|
||
- name: Cache mathlib API docs | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
.lake/build/doc/Init | ||
.lake/build/doc/Lake | ||
.lake/build/doc/Lean | ||
.lake/build/doc/Std | ||
.lake/build/doc/Mathlib | ||
.lake/build/doc/declarations | ||
.lake/build/doc/find | ||
.lake/build/doc/*.* | ||
!.lake/build/doc/declarations/declaration-data-GroupoidModel* | ||
key: MathlibDoc-${{ hashFiles('lake-manifest.json') }} | ||
restore-keys: MathlibDoc- | ||
|
||
- name: Build project API documentation | ||
run: ~/.elan/bin/lake -R -Kenv=dev build GroupoidModel:docs | ||
|
||
- name: Check for `home_page` folder # this is meant to detect a Jekyll-based website | ||
id: check_home_page | ||
run: | | ||
if [ -d home_page ]; then | ||
echo "The 'home_page' folder exists in the repository." | ||
echo "HOME_PAGE_EXISTS=true" >> $GITHUB_ENV | ||
else | ||
echo "The 'home_page' folder does not exist in the repository." | ||
echo "HOME_PAGE_EXISTS=false" >> $GITHUB_ENV | ||
fi | ||
- name: Build blueprint and copy to `home_page/blueprint` | ||
uses: xu-cheng/texlive-action@v2 | ||
with: | ||
docker_image: ghcr.io/xu-cheng/texlive-full:20231201 | ||
run: | | ||
# Install necessary dependencies and build the blueprint | ||
apk update | ||
apk add --update make py3-pip git pkgconfig graphviz graphviz-dev gcc musl-dev | ||
git config --global --add safe.directory $GITHUB_WORKSPACE | ||
git config --global --add safe.directory `pwd` | ||
python3 -m venv env | ||
source env/bin/activate | ||
pip install --upgrade pip requests wheel | ||
pip install pygraphviz --global-option=build_ext --global-option="-L/usr/lib/graphviz/" --global-option="-R/usr/lib/graphviz/" | ||
pip install leanblueprint | ||
leanblueprint pdf | ||
mkdir -p home_page | ||
cp blueprint/print/print.pdf home_page/blueprint.pdf | ||
leanblueprint web | ||
cp -r blueprint/web home_page/blueprint | ||
- name: Check declarations mentioned in the blueprint exist in Lean code | ||
run: | | ||
~/.elan/bin/lake exe checkdecls blueprint/lean_decls | ||
- name: Copy API documentation to `home_page/docs` | ||
run: cp -r .lake/build/doc home_page/docs | ||
|
||
- name: Remove unnecessary lake files from documentation in `home_page/docs` | ||
run: | | ||
find home_page/docs -name "*.trace" -delete | ||
find home_page/docs -name "*.hash" -delete | ||
- name: Bundle dependencies | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
working-directory: home_page | ||
ruby-version: "3.0" # Specify Ruby version | ||
bundler-cache: true # Enable caching for bundler | ||
|
||
- name: Build website using Jekyll | ||
if: env.HOME_PAGE_EXISTS == 'true' | ||
working-directory: home_page | ||
run: JEKYLL_ENV=production bundle exec jekyll build # Note this will also copy the blueprint and API doc into home_page/_site | ||
|
||
- name: "Upload website (API documentation, blueprint and any home page)" | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: ${{ env.HOME_PAGE_EXISTS == 'true' && 'home_page/_site' || 'home_page/' }} | ||
|
||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 | ||
|
||
- name: Make sure the API documentation cache works | ||
run: mv home_page/docs .lake/build/doc | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
\DeclareOption*{} | ||
\ProcessOptions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
% In this file you should put the actual content of the blueprint. | ||
% It will be used both by the web and the print version. | ||
% It should *not* include the \begin{document} | ||
% | ||
% If you want to split the blueprint content into several files then | ||
% the current file can be a simple sequence of \input. Otherwise It | ||
% can start with a \section or \chapter for instance. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* This file contains CSS tweaks for this blueprint. | ||
* As an example, we included CSS rules that put | ||
* a vertical line on the left of theorem statements | ||
* and proofs. | ||
* */ | ||
|
||
div.theorem_thmcontent { | ||
border-left: .15rem solid black; | ||
} | ||
|
||
div.proposition_thmcontent { | ||
border-left: .15rem solid black; | ||
} | ||
|
||
div.lemma_thmcontent { | ||
border-left: .1rem solid black; | ||
} | ||
|
||
div.corollary_thmcontent { | ||
border-left: .1rem solid black; | ||
} | ||
|
||
div.proof_content { | ||
border-left: .08rem solid grey; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# This file configures the latexmk command you can use to compile | ||
# the pdf version of the blueprint | ||
$pdf_mode = 1; | ||
$pdflatex = 'xelatex -synctex=1'; | ||
@default_files = ('print.tex'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
% In this file you should put all LaTeX macros and settings to be used both by | ||
% the pdf version and the web version. | ||
% This should be most of your macros. | ||
|
||
% The theorem-like environments defined below are those that appear by default | ||
% in the dependency graph. See the README of leanblueprint if you need help to | ||
% customize this. | ||
% The configuration below use the theorem counter for all those environments | ||
% (this is what the [theorem] arguments mean) and never resets it. | ||
% If you want for instance to number them within chapters then you can add | ||
% [chapter] at the end of the next line. | ||
\newtheorem{theorem}{Theorem} | ||
\newtheorem{proposition}[theorem]{Proposition} | ||
\newtheorem{lemma}[theorem]{Lemma} | ||
\newtheorem{corollary}[theorem]{Corollary} | ||
|
||
\theoremstyle{definition} | ||
\newtheorem{definition}[theorem]{Definition} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
% In this file you should put macros to be used only by | ||
% the printed version. Of course they should have a corresponding | ||
% version in macros/web.tex. | ||
% Typically the printed version could have more fancy decorations. | ||
% This should be a very short file. | ||
% | ||
% This file starts with dummy macros that ensure the pdf | ||
% compiler will ignore macros provided by plasTeX that make | ||
% sense only for the web version, such as dependency graph | ||
% macros. | ||
|
||
|
||
% Dummy macros that make sense only for web version. | ||
\newcommand{\lean}[1]{} | ||
\newcommand{\discussion}[1]{} | ||
\newcommand{\leanok}{} | ||
\newcommand{\mathlibok}{} | ||
\newcommand{\notready}{} | ||
% Make sure that arguments of \uses and \proves are real labels, by using invisible refs: | ||
% latex prints a warning if the label is not defined, but nothing is shown in the pdf file. | ||
% It uses LaTeX3 programming, this is why we use the expl3 package. | ||
\ExplSyntaxOn | ||
\NewDocumentCommand{\uses}{m} | ||
{\clist_map_inline:nn{#1}{\vphantom{\ref{##1}}}% | ||
\ignorespaces} | ||
\NewDocumentCommand{\proves}{m} | ||
{\clist_map_inline:nn{#1}{\vphantom{\ref{##1}}}% | ||
\ignorespaces} | ||
\ExplSyntaxOff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
% In this file you should put macros to be used only by | ||
% the web version. Of course they should have a corresponding | ||
% version in macros/print.tex. | ||
% Typically the printed version could have more fancy decorations. | ||
% This will probably be a very short file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[general] | ||
renderer=HTML5 | ||
copy-theme-extras=yes | ||
plugins=plastexdepgraph plastexshowmore leanblueprint | ||
|
||
[document] | ||
toc-depth=3 | ||
toc-non-files=True | ||
|
||
[files] | ||
directory=../web/ | ||
split-level= 0 | ||
|
||
[html5] | ||
localtoc-level=0 | ||
extra-css=extra_styles.css | ||
mathjax-dollars=False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
% This file makes a printable version of the blueprint | ||
% It should include all the \usepackage needed for the pdf version. | ||
% The template version assume you want to use a modern TeX compiler | ||
% such as xeLaTeX or luaLaTeX including support for unicode | ||
% and Latin Modern Math font with standard bugfixes applied. | ||
% It also uses expl3 in order to support macros related to the dependency graph. | ||
% It also includes standard AMS packages (and their improved version | ||
% mathtools) as well as support for links with a sober decoration | ||
% (no ugly rectangles around links). | ||
% It is otherwise a very minimal preamble (you should probably at least | ||
% add cleveref and tikz-cd). | ||
|
||
\documentclass[a4paper]{report} | ||
|
||
\usepackage{geometry} | ||
|
||
\usepackage{expl3} | ||
|
||
\usepackage{amssymb, amsthm, mathtools} | ||
\usepackage[unicode,colorlinks=true,linkcolor=blue,urlcolor=magenta, citecolor=blue]{hyperref} | ||
|
||
\usepackage[warnings-off={mathtools-colon,mathtools-overbracket}]{unicode-math} | ||
|
||
\input{macros/common} | ||
\input{macros/print} | ||
|
||
\title{Groupoid Model of HoTT in Lean 4} | ||
\author{Authors} | ||
|
||
\begin{document} | ||
\maketitle | ||
\input{content} | ||
\end{document} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
% This file makes a web version of the blueprint | ||
% It should include all the \usepackage needed for this version. | ||
% The template includes standard AMS packages. | ||
% It is otherwise a very minimal preamble (you should probably at least | ||
% add cleveref and tikz-cd). | ||
|
||
\documentclass{report} | ||
|
||
\usepackage{amssymb, amsthm, amsmath} | ||
\usepackage{hyperref} | ||
\usepackage[showmore, dep_graph]{blueprint} | ||
|
||
|
||
\input{macros/common} | ||
\input{macros/web} | ||
|
||
\home{https://sinhp.github.io/groupoid_model_in_lean4} | ||
\github{https://github.com/sinhp/groupoid_model_in_lean4} | ||
\dochome{https://sinhp.github.io/groupoid_model_in_lean4/docs} | ||
|
||
\title{Groupoid Model of HoTT in Lean 4} | ||
\author{Authors} | ||
|
||
\begin{document} | ||
\maketitle | ||
\input{content} | ||
\end{document} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
permalink: /404.html | ||
layout: default | ||
--- | ||
|
||
<style type="text/css" media="screen"> | ||
.container { | ||
margin: 10px auto; | ||
max-width: 600px; | ||
text-align: center; | ||
} | ||
h1 { | ||
margin: 30px 0; | ||
font-size: 4em; | ||
line-height: 1; | ||
letter-spacing: -1px; | ||
} | ||
</style> | ||
|
||
<div class="container"> | ||
<h1>404</h1> | ||
|
||
<p><strong>Page not found :(</strong></p> | ||
<p>The requested page could not be found.</p> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
source "https://rubygems.org" | ||
|
||
# To upgrade, run `bundle update github-pages`. | ||
gem "github-pages", group: :jekyll_plugins | ||
# If you have any plugins, put them here! | ||
group :jekyll_plugins do | ||
#gem "jekyll-feed", "~> 0.12" | ||
end | ||
|
||
# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem | ||
# and associated library. | ||
platforms :mingw, :x64_mingw, :mswin, :jruby do | ||
gem "tzinfo", "~> 1.2" | ||
gem "tzinfo-data" | ||
end | ||
|
||
# Performance-booster for watching directories on Windows. | ||
gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin] | ||
|
||
# Lock `http_parser.rb` gem to `v0.6.x` on JRuby builds since newer versions of the gem | ||
# do not have a Java counterpart. | ||
gem "http_parser.rb", "~> 0.6.0", :platforms => [:jruby] | ||
|
||
# Used for locally serving the website. | ||
gem "webrick", "~> 1.7" |
Oops, something went wrong.