GithubHelp home page GithubHelp logo

taneb / 1lab Goto Github PK

View Code? Open in Web Editor NEW

This project forked from plt-amy/1lab

0.0 1.0 0.0 5.26 MB

A formalised, cross-linked reference resource for mathematics done in Homotopy Type Theory

Home Page: https://1lab.dev

License: GNU Affero General Public License v3.0

Shell 0.01% Haskell 2.85% TypeScript 0.84% TeX 0.28% Agda 93.35% Nix 1.87% HTML 0.17% SCSS 0.63%

1lab's Introduction

Discord Build 1Lab

A formalised, cross-linked reference resource for mathematics done in Homotopy Type Theory. Unlike the HoTT book, the 1lab is not a “linear” resource: Concepts are presented as a directed graph, with links indicating dependencies.

Building

Building the 1Lab is a rather complicated task, which has led to a lot of homebrew infrastructure being developed for it. We build against a specific build of Agda (see the rev field in support/nix/dep/Agda/github.json), and there are also quite a few external dependencies (e.g. pdftocairo, katex). The recommended way of building the 1Lab is using Nix.

As a quick point of reference, nix-build will type-check and compile the entire thing, and copy the necessary assets (TeX Gyre Pagella and KaTeX's CSS and fonts) to the right locations. The result will be linked as ./result, which can then be used to serve a website:

$ nix-build
$ python -m http.server --directory result

Note that using Nix to build the website takes around ~20-30 minutes, since it will type-check the entire codebase from scratch every time. For interactive development, nix-shell will give you a shell with everything you need to hack on the 1Lab, including Agda and the pre-built Shakefile as 1lab-shake:

$ 1lab-shake all -j

Since nix-shell will load the derivation steps as environment variables, you can use something like this to copy the static assets into place:

$ eval "${installPhase}"
$ python -m http.server --directory _build/site

To hack on a file continuously, you can use "watch mode", which will attempt to only check and build the changed file.

$ 1lab-shake all -w

Additionally, since the validity of the Agda code is generally upheld by agda-mode, you can use --skip-agda to only build the prose. Note that this will disable checking the integrity of link targets, the translation of `ref`{.Agda} spans, and the code blocks will be right ugly.

Our build tools are routinely built for x86_64-linux and uploaded to Cachix. If you have the Cachix CLI installed, simply run cachix use 1lab. Otherwise, add the following to your Nix configuration:

substituters = https://1lab.cachix.org
trusted-public-keys = 1lab.cachix.org-1:eYjd9F9RfibulS4OSFBYeaTMxWojPYLyMqgJHDvG1fs=

Directly

If you're feeling brave, you can try to replicate one of the build environments above. You will need:

  • The cabal-install package manager. Using stack is no longer supported.

  • A working LaTeX installation (TeXLive, etc) with the packages tikz-cd (depends on pgf), mathpazo, xcolor, preview, and standalone (depends on varwidth and xkeyval);

  • Poppler (for pdftocairo);

  • libsass (for sassc);

  • Node + required Node modules. Run npm ci to install those.

You can then use cabal-install to build and run our specific version of Agda and our Shakefile:

$ cabal install Agda
# This will take quite a while!

$ cabal v2-run shake -- -j --skip-agda
# the double dash separates cabal-install's arguments from our
# shakefile's.

1lab's People

Contributors

anka-213 avatar daniel-soe avatar felixwellen avatar frozenwinters avatar guilhermehas avatar isovector avatar jake-gillberg avatar jakobbruenker avatar jappeace avatar jd95 avatar jul1u5 avatar kisonecat avatar kzvi avatar marshall-lee avatar matthiashu avatar mazetone avatar moritayasuaki avatar ncfavier avatar plt-amy avatar rattlehead15 avatar seiryn21 avatar squiddev avatar szumixie avatar tomdjong avatar totbwf avatar uniwuni avatar vezwork avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.