Skip to content

Commit 5a510be

Browse files
committed
Publish PDF
I had to update pinned nixpkgs, as it did not build with TexLive 2022. Some content annotations are not transformed very well in LaTex output. For example, there is a [bug](executablebooks/sphinx-design#107) in sphinx-design which prints dropdowns just as subsections without any visual highlighting. In general it is readable and better typeset compared to the PDF obtained by printing to PDF. Also, there is now full texlive which is quite a huge dependency.
1 parent 0ce7d94 commit 5a510be

File tree

5 files changed

+30
-21
lines changed

5 files changed

+30
-21
lines changed

default.nix

+16-11
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,24 @@ let
1616
overlays = [ ];
1717
inherit system;
1818
};
19-
19+
nix-dev-python-pkgs = with pkgs.python310.pkgs; [
20+
linkify-it-py
21+
myst-parser
22+
sphinx
23+
sphinx-book-theme
24+
sphinx-copybutton
25+
sphinx-design
26+
sphinx-notfound-page
27+
sphinx-sitemap
28+
pkgs.perl
29+
];
2030
nix-dev =
2131
pkgs.stdenv.mkDerivation {
2232
name = "nix-dev";
2333
src = ./.;
24-
nativeBuildInputs = with pkgs.python310.pkgs; [
25-
linkify-it-py
26-
myst-parser
27-
sphinx
28-
sphinx-book-theme
29-
sphinx-copybutton
30-
sphinx-design
31-
sphinx-notfound-page
32-
sphinx-sitemap
33-
pkgs.perl
34+
nativeBuildInputs = [
35+
nix-dev-python-pkgs
36+
pkgs.texlive.combined.scheme-full
3437
];
3538
buildPhase =
3639
let
@@ -42,6 +45,7 @@ let
4245
''
4346
${lib.optionalString withManuals "cp -f ${substitutedNixManualReference} source/reference/nix-manual.md"}
4447
make html
48+
make latexpdf
4549
'';
4650
installPhase =
4751
let
@@ -68,6 +72,7 @@ let
6872
''
6973
mkdir -p $out/manual/nix
7074
cp -R build/html/* $out/
75+
cp build/latex/nix-dev.pdf $out/
7176
'' + lib.optionalString withManuals ''
7277
${lib.concatStringsSep "\n" (lib.mapAttrsToList release releases.nixReleases)}
7378
${lib.concatStringsSep "\n" (lib.mapAttrsToList mutableRedirect releases.mutableNixManualRedirects)}

npins/sources.json

+3-4
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
"repo": "nixpkgs"
99
},
1010
"branch": "nixpkgs-unstable",
11-
"revision": "3a05eebede89661660945da1f151959900903b6a",
12-
"url": "https://github.com/nixos/nixpkgs/archive/3a05eebede89661660945da1f151959900903b6a.tar.gz",
13-
"hash": "0n56l6v5k3lmrr4vjnp6xk1s46shkwdkvai05dzcbcabpl29yb9g"
11+
"revision": "ed30f8aba41605e3ab46421e3dcb4510ec560ff8",
12+
"url": "https://github.com/nixos/nixpkgs/archive/ed30f8aba41605e3ab46421e3dcb4510ec560ff8.tar.gz",
13+
"hash": "0mg2wzzzakbb33z1a1qrlslr8q84j1ci9j53p9dj8nggmm2xv0p6"
1414
},
1515
"poetry2nix": {
1616
"type": "Git",
@@ -27,4 +27,3 @@
2727
},
2828
"version": 3
2929
}
30-

source/_static/_img/nix.pdf

5.32 KB
Binary file not shown.

source/_templates/download-links.html

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<p>nix.dev as <a href="nix-dev.pdf">PDF</p>

source/conf.py

+10-6
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@
201201
"about.html",
202202
"search-field.html",
203203
"sbt-sidebar-nav.html",
204+
"download-links.html",
204205
],
205206
}
206207

@@ -260,9 +261,11 @@
260261
# The font size ('10pt', '11pt' or '12pt').
261262
#'pointsize': '10pt',
262263
# Additional stuff for the LaTeX preamble.
263-
'preamble': '\setcounter{tocdepth}{3}',
264+
'preamble': r'\setcounter{tocdepth}{2}',
265+
'sphinxsetup': r'TitleColor={RGB}{87, 154, 202}',
264266
# Latex figure (float) alignment
265267
#'figure_align': 'htbp',
268+
266269
}
267270

268271
# Grouping the document tree into LaTeX files. List of tuples
@@ -271,17 +274,18 @@
271274
latex_documents = [
272275
(
273276
master_doc,
274-
"nixpkgs-cookbook.tex",
275-
"nixpkgs-cookbook Documentation",
277+
"nix-dev.tex",
278+
"nix.dev",
276279
"nix.dev contributors",
277280
"manual",
281+
True, # toctree only
278282
),
279283
]
280284

281285
latex_engine = "xelatex"
282286
# The name of an image file (relative to this directory) to place at the top of
283287
# the title page.
284-
# latex_logo = None
288+
latex_logo = "_static/_img/nix.pdf"
285289

286290
# For "manual" documents, if this is true, then toplevel headings are parts,
287291
# not chapters.
@@ -290,10 +294,10 @@
290294
latex_use_xindy = False
291295

292296
# If true, show page references after internal links.
293-
# latex_show_pagerefs = False
297+
latex_show_pagerefs = True
294298

295299
# If true, show URL addresses after external links.
296-
# latex_show_urls = False
300+
latex_show_urls = 'footnote'
297301

298302
# Documents to append as an appendix to all manuals.
299303
# latex_appendices = []

0 commit comments

Comments
 (0)