File tree Expand file tree Collapse file tree 5 files changed +37
-9
lines changed Expand file tree Collapse file tree 5 files changed +37
-9
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ SPHINXOPTS ?=
7
7
SPHINXBUILD ?= sphinx-build
8
8
SOURCEDIR = .
9
9
BUILDDIR = _build
10
+ LATEXOPTS = "-shell-escape"
10
11
11
12
# Put it first so that "make" without argument is like "make help".
12
13
help :
Original file line number Diff line number Diff line change 48
48
## underscore
49
49
, 'sphinxcontrib.bibtex'
50
50
, 'sphinx_copybutton'
51
+ , 'sphinxcontrib.tikz'
51
52
, 'sphinx_exec_directive'
52
53
, 'conceptual_admonitions'
53
54
]
57
58
todo_link_only = False
58
59
autosectionlabel_prefix_document = True
59
60
61
+ # tikz support
62
+ tikz_proc_suite = "pdf2svg"
63
+ tikz_tikzlibraries = "arrows, arrows.meta"
64
+
60
65
## global links in the book that share a prefix that we've named.
61
66
extlinks = {'userGuide' : ('https://downloads.haskell.org/~ghc/9.2.4/docs/html/users_guide/%s' , '%s' ),
62
67
'ghcWiki' : ('https://gitlab.haskell.org/ghc/ghc/wikis/%s' , '#%s' ),
Original file line number Diff line number Diff line change 52
52
} ;
53
53
} ;
54
54
55
+ tex-overlay = final : prev : {
56
+ tex-env = prev . texlive . combine {
57
+ inherit ( prev . texlive )
58
+ scheme-basic collection-xetex fncychap titlesec tabulary varwidth
59
+ framed capt-of wrapfig needspace dejavu-otf helvetic upquote
60
+ memorygraphs ;
61
+ } ;
62
+ } ;
63
+
55
64
in
56
65
flake-utils . lib . eachDefaultSystem
57
66
( system :
60
69
overlays = [ press-theme-overlay
61
70
copy-button-overlay
62
71
sphinx-exec-directive-overlay
72
+ tex-overlay
63
73
] ;
64
74
} ;
65
-
66
- ourTexLive = pkgs . texlive . combine {
67
- inherit ( pkgs . texlive )
68
- scheme-medium collection-xetex fncychap titlesec tabulary varwidth
69
- framed capt-of wrapfig needspace dejavu-otf helvetic upquote ;
70
- } ;
71
-
72
75
## TODO use this
73
76
fonts = pkgs . makeFontsConf { fontDirectories = [ pkgs . dejavu_fonts ] ; } ;
74
77
Original file line number Diff line number Diff line change 12
12
# marked as broken in nixpkgs unfortunately
13
13
# sphinx-book-theme
14
14
## until we have a reason for tex leave this commented out for CI
15
- # ourTexLive
16
15
] ;
17
16
nonPythonInputs = with pkgs ; [ sphinx-press-theme # this comes from the overlay
18
17
sphinx-copybutton # this comes from the overlay
23
22
ghc
24
23
cabal-install
25
24
git
25
+ tex-env
26
26
] ;
27
27
in
28
28
pkgs . stdenv . mkDerivation {
29
29
pname = "hoh" ;
30
30
version = "0.0.1" ;
31
31
src = ./. ;
32
+ phases = [ "unpackPhase" "preBuild" "buildPhase" "installPhase" ] ;
32
33
buildInputs = pythonInputs ++ nonPythonInputs ;
33
34
34
35
preBuild = ''
@@ -37,6 +38,7 @@ pkgs.stdenv.mkDerivation {
37
38
38
39
buildPhase = ''
39
40
runHook preBuild
41
+ export PATH="${ pkgs . lib . makeBinPath ( pythonInputs ++ nonPythonInputs ) } :$PATH";
40
42
SOURCE_DATE_EPOCH="$(${ pkgs . coreutils } /bin/date '+%s')"
41
43
make clean
42
44
make ${ target } SPHINXOPTS="-W"
Original file line number Diff line number Diff line change @@ -61,7 +61,24 @@ Glossary
61
61
62
62
Boxed : Levity
63
63
64
- A Boxed value is a value that is represented by a pointer to the heap.
64
+ A Boxed value is a value that is represented by a pointer to the heap. For
65
+ example, a value such as ``1729 :: Int `` is represented as:
66
+
67
+ ..
68
+ .. tikz:: An Example TikZ Directive with Caption
69
+ :align: left
70
+
71
+ \b egin{tikzpicture}[memory graph]
72
+ \n ode[arity=2] (hd) {Cons};
73
+ \n ode
74
+ [arity=2,below=of hd.arg 2 center,anchor=head north]
75
+ (tl) {Cons};
76
+ \d raw[ref] (hd.arg 2 center)
77
+ -- (tl.head north);
78
+ \d raw[ref] (tl.arg 2 center)
79
+ |- ($(hd.head north)+(0,.4)$)
80
+ -- (hd.head north);
81
+ \end{tikzpicture}
65
82
66
83
Cardinality Analysis
67
84
You can’t perform that action at this time.
0 commit comments