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 ?=
77SPHINXBUILD ?= sphinx-build
88SOURCEDIR = .
99BUILDDIR = _build
10+ LATEXOPTS = "-shell-escape"
1011
1112# Put it first so that "make" without argument is like "make help".
1213help :
Original file line number Diff line number Diff line change 4848 ## underscore
4949 , 'sphinxcontrib.bibtex'
5050 , 'sphinx_copybutton'
51+ , 'sphinxcontrib.tikz'
5152 , 'sphinx_exec_directive'
5253 , 'conceptual_admonitions'
5354 ]
5758todo_link_only = False
5859autosectionlabel_prefix_document = True
5960
61+ # tikz support
62+ tikz_proc_suite = "pdf2svg"
63+ tikz_tikzlibraries = "arrows, arrows.meta"
64+
6065## global links in the book that share a prefix that we've named.
6166extlinks = {'userGuide' : ('https://downloads.haskell.org/~ghc/9.2.4/docs/html/users_guide/%s' , '%s' ),
6267 'ghcWiki' : ('https://gitlab.haskell.org/ghc/ghc/wikis/%s' , '#%s' ),
Original file line number Diff line number Diff line change 5252 } ;
5353 } ;
5454
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+
5564 in
5665 flake-utils . lib . eachDefaultSystem
5766 ( system :
6069 overlays = [ press-theme-overlay
6170 copy-button-overlay
6271 sphinx-exec-directive-overlay
72+ tex-overlay
6373 ] ;
6474 } ;
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-
7275 ## TODO use this
7376 fonts = pkgs . makeFontsConf { fontDirectories = [ pkgs . dejavu_fonts ] ; } ;
7477
Original file line number Diff line number Diff line change 1212 # marked as broken in nixpkgs unfortunately
1313 # sphinx-book-theme
1414 ## until we have a reason for tex leave this commented out for CI
15- # ourTexLive
1615 ] ;
1716 nonPythonInputs = with pkgs ; [ sphinx-press-theme # this comes from the overlay
1817 sphinx-copybutton # this comes from the overlay
2322 ghc
2423 cabal-install
2524 git
25+ tex-env
2626 ] ;
2727in
2828pkgs . stdenv . mkDerivation {
2929 pname = "hoh" ;
3030 version = "0.0.1" ;
3131 src = ./. ;
32+ phases = [ "unpackPhase" "preBuild" "buildPhase" "installPhase" ] ;
3233 buildInputs = pythonInputs ++ nonPythonInputs ;
3334
3435 preBuild = ''
@@ -37,6 +38,7 @@ pkgs.stdenv.mkDerivation {
3738
3839 buildPhase = ''
3940 runHook preBuild
41+ export PATH="${ pkgs . lib . makeBinPath ( pythonInputs ++ nonPythonInputs ) } :$PATH";
4042 SOURCE_DATE_EPOCH="$(${ pkgs . coreutils } /bin/date '+%s')"
4143 make clean
4244 make ${ target } SPHINXOPTS="-W"
Original file line number Diff line number Diff line change @@ -61,7 +61,24 @@ Glossary
6161
6262 Boxed : Levity
6363
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}
6582
6683 Cardinality Analysis
6784
You can’t perform that action at this time.
0 commit comments