Skip to content

Commit f032fbb

Browse files
WIP:typst
1 parent 7355e7e commit f032fbb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+9381
-1339
lines changed

README.md

Lines changed: 1 addition & 1 deletion

Shakefile.hs

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,14 @@ main = shakeArgs shakeOptions{shakeFiles="_build"} $ do
1313
removeFilesAfter "_build" ["//*"]
1414

1515
"_build/hydra-spec" <.> "pdf" %> \out -> do
16-
assets <- getDirectoryFiles "src" ["//*.sty", "Hydra/Protocol/Figures/*.pdf", "//*.bib", "//*.ttf"]
17-
need ["_build/latex" </> c | c <- assets]
16+
assets <- getDirectoryFiles "src" ["//*.sty", "//*.pdf", "//*.bib", "//*.ttf", "//*.typ"]
17+
need ["_build/src" </> c | c <- assets]
18+
cmd_ $ "typst compile --root _build _build/src/Hydra/Protocol/Main.lagda.typ " <> out
1819

19-
srcs <- getDirectoryFiles "src" ["//*.lagda", "//*.tex"]
20-
need ["_build/latex" </> c -<.> "tex" | c <- srcs]
21-
22-
cmd_ (Cwd "_build/latex") "latexmk -xelatex -shell-escape -halt-on-error Hydra/Protocol/Main.tex"
23-
cmd_ "cp _build/latex/Main.pdf _build/hydra-spec.pdf"
24-
25-
-- Copy assets
26-
forM ["sty", "pdf", "bib", "ttf"] $ \ext ->
27-
("_build/latex//*." <> ext) %> \out -> do
20+
forM ["typ", "sty", "pdf", "bib", "ttf"] $ \ext ->
21+
("_build//*." <> ext) %> \out -> do
2822
let src = "src" </> dropDirectory1 (dropDirectory1 out)
2923
copyFile' src out
3024

31-
-- Copy or compile from lagda files
32-
"_build/latex//*.tex" %> \out -> do
33-
let src = "src" </> dropDirectory1 (dropDirectory1 out)
34-
b <- doesFileExist src
35-
if b then do
36-
need [src]
37-
copyFile' src out
38-
else do
39-
let src = "src" </> dropDirectory1 (dropDirectory1 (out -<.> "lagda"))
40-
need [src]
41-
cmd_ $ "agda --transliterate --latex --latex-dir _build/latex " <> src
25+
phony "check" $ do
26+
cmd_ $ "agda src/Hydra/Protocol/Main.lagda.typ"

flake.nix

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
nativeBuildInputs = with pkgs; [
4141
(agdaPackages.withPackages agdaLibraries)
4242
(haskellPackages.ghcWithPackages (p: [ p.shake ]))
43-
texlive.combined.scheme-full
43+
typst
4444
];
4545
meta = { };
4646
src = ./.;
@@ -53,8 +53,23 @@
5353
'';
5454
};
5555

56+
5657
default = packages.hydra-spec-pdf;
58+
5759
};
60+
checks.typecheck = agdaPackages.mkDerivation {
61+
pname = "hydra-spec-typecheck";
62+
version = "0.0.1";
63+
nativeBuildInputs = with pkgs; [
64+
(agdaPackages.withPackages agdaLibraries)
65+
(haskellPackages.ghcWithPackages (p: [ p.shake ]))
66+
];
67+
meta = { };
68+
src = ./.;
69+
buildPhase = ''
70+
shake check
71+
'';
72+
};
5873
};
5974
};
6075
}
-42.7 KB
Binary file not shown.

src/Hydra/Protocol/Figures/SM-abort.svg

Lines changed: 664 additions & 0 deletions
-46.3 KB
Binary file not shown.

src/Hydra/Protocol/Figures/SM-close.svg

Lines changed: 233 additions & 0 deletions
-44 KB
Binary file not shown.

src/Hydra/Protocol/Figures/SM-collect.svg

Lines changed: 615 additions & 0 deletions
-35.4 KB
Binary file not shown.

0 commit comments

Comments
 (0)