Skip to content

Commit 3cf4486

Browse files
make building the PDF optional
Iterating on contents takes way too much time otherwise. Also use the whole phrase as the link text in main navigation, since it's more self-explanatory that way.
1 parent b8f4bd7 commit 3cf4486

4 files changed

Lines changed: 21 additions & 5 deletions

File tree

.github/workflows/build-and-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323

2424
- name: Build
2525
run: |
26-
nix-build --arg withManuals true
26+
nix-build --arg withManuals true --arg withPDF true
2727
2828
# The netlify action doesn't follow symlinks properly.
2929
mkdir ./dist

CONTRIBUTING.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,21 @@ Or for interactive development:
4242
$ nix-shell --arg withManuals true --run devmode
4343
```
4444

45+
## Building the PDF
46+
47+
By default, nix.dev is built without the PDF rendering, as that is takes too long for quick iteration on the contents.
48+
To enable building the PDF:
49+
50+
```shell-session
51+
$ nix-build -A build --arg withPDF true
52+
```
53+
54+
Or for interactive development:
55+
56+
```shell-session
57+
$ nix-shell --arg withPDF true --run devmode
58+
```
59+
4560
## Updating reference manuals
4661

4762
With the current setup, the [Nix manual hosted on nix.dev](https://nix.dev/reference/nix-manual) does not get updated automatically with new releases.

default.nix

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
inherit system;
88
},
99
withManuals ? false, # building the manuals is expensive
10+
withPDF ? false, # building the PDF is expensive
1011
}:
1112
let
1213
lib = pkgs.lib;
@@ -53,7 +54,7 @@ let
5354
''
5455
cp -f ${substitutedNixManualReference} source/reference/nix-manual.md
5556
make html
56-
make latexpdf
57+
${lib.optionalString withPDF "make latexpdf"}
5758
'';
5859
installPhase =
5960
let
@@ -80,7 +81,7 @@ let
8081
''
8182
mkdir -p $out/manual/nix
8283
cp -R build/html/* $out/
83-
cp build/latex/nix-dev.pdf $out/
84+
${lib.optionalString withPDF "cp build/latex/nix-dev.pdf $out/"}
8485
cp netlify.toml $out/
8586
''
8687
+ lib.optionalString withManuals ''
@@ -95,7 +96,7 @@ let
9596
in
9697

9798
pkgs.devmode.override {
98-
buildArgs = "-A build --show-trace --arg withManuals ${boolean withManuals}";
99+
buildArgs = "-A build --show-trace --arg withManuals ${boolean withManuals} --arg withPDF ${boolean withPDF}";
99100
open = "/index.html";
100101
};
101102
update-nix-releases = pkgs.callPackage ./nix/update-nix-releases.nix { };
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<p>nix.dev as <a href="/nix-dev.pdf">PDF</a></p>
1+
<p><a href="/nix-dev.pdf">nix.dev as PDF</a></p>

0 commit comments

Comments
 (0)