From 5a510bed0e0c26438e76c8ac7439170decbad0ce Mon Sep 17 00:00:00 2001 From: Kilian Holzinger Date: Tue, 6 May 2025 21:09:36 +0200 Subject: [PATCH] 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](https://github.com/executablebooks/sphinx-design/issues/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. --- default.nix | 27 +++++++++++++++----------- npins/sources.json | 7 +++---- source/_static/_img/nix.pdf | Bin 0 -> 5452 bytes source/_templates/download-links.html | 1 + source/conf.py | 16 +++++++++------ 5 files changed, 30 insertions(+), 21 deletions(-) create mode 100644 source/_static/_img/nix.pdf create mode 100644 source/_templates/download-links.html diff --git a/default.nix b/default.nix index 63b37a48d..e6253ffca 100644 --- a/default.nix +++ b/default.nix @@ -16,21 +16,24 @@ let overlays = [ ]; inherit system; }; - + nix-dev-python-pkgs = with pkgs.python310.pkgs; [ + linkify-it-py + myst-parser + sphinx + sphinx-book-theme + sphinx-copybutton + sphinx-design + sphinx-notfound-page + sphinx-sitemap + pkgs.perl + ]; nix-dev = pkgs.stdenv.mkDerivation { name = "nix-dev"; src = ./.; - nativeBuildInputs = with pkgs.python310.pkgs; [ - linkify-it-py - myst-parser - sphinx - sphinx-book-theme - sphinx-copybutton - sphinx-design - sphinx-notfound-page - sphinx-sitemap - pkgs.perl + nativeBuildInputs = [ + nix-dev-python-pkgs + pkgs.texlive.combined.scheme-full ]; buildPhase = let @@ -42,6 +45,7 @@ let '' ${lib.optionalString withManuals "cp -f ${substitutedNixManualReference} source/reference/nix-manual.md"} make html + make latexpdf ''; installPhase = let @@ -68,6 +72,7 @@ let '' mkdir -p $out/manual/nix cp -R build/html/* $out/ + cp build/latex/nix-dev.pdf $out/ '' + lib.optionalString withManuals '' ${lib.concatStringsSep "\n" (lib.mapAttrsToList release releases.nixReleases)} ${lib.concatStringsSep "\n" (lib.mapAttrsToList mutableRedirect releases.mutableNixManualRedirects)} diff --git a/npins/sources.json b/npins/sources.json index 15cda801f..f3c3e0315 100644 --- a/npins/sources.json +++ b/npins/sources.json @@ -8,9 +8,9 @@ "repo": "nixpkgs" }, "branch": "nixpkgs-unstable", - "revision": "3a05eebede89661660945da1f151959900903b6a", - "url": "https://github.com/nixos/nixpkgs/archive/3a05eebede89661660945da1f151959900903b6a.tar.gz", - "hash": "0n56l6v5k3lmrr4vjnp6xk1s46shkwdkvai05dzcbcabpl29yb9g" + "revision": "ed30f8aba41605e3ab46421e3dcb4510ec560ff8", + "url": "https://github.com/nixos/nixpkgs/archive/ed30f8aba41605e3ab46421e3dcb4510ec560ff8.tar.gz", + "hash": "0mg2wzzzakbb33z1a1qrlslr8q84j1ci9j53p9dj8nggmm2xv0p6" }, "poetry2nix": { "type": "Git", @@ -27,4 +27,3 @@ }, "version": 3 } - diff --git a/source/_static/_img/nix.pdf b/source/_static/_img/nix.pdf new file mode 100644 index 0000000000000000000000000000000000000000..4c344d851dc62c8a619eba4a9cdfb4ec60694a88 GIT binary patch literal 5452 zcmds53tUXw9+oJLM-P#xY?R|rGy5@5CVH0|Mek%}YDP_}scA+fQFHy2^dw5kvl2&? zS0168SBg9m$K;WB5z3>7qOGOzd;-k&x+?K;PMDF zXA;6iLLMiW5SdfwUL9gc8&=lt(O6a|jJF$AXIjHex^ru_ zscG{@SL@MhP4XYKPwwzHaI>n*>uz1z&74o!Fw>o1r@CS?@oCF#o6fH2&JWSk?%!8u z`keGm*R4Cgv2=%YPvW8zUKiHAQEp#W*Z557e8T>z56)%ZoN%z4PM{@@I%XU?+90r~ zEz0JDg<)}3NviMG^RbPEF;UkzVtd=i4SOcfcbyy?wzcagpr?D_vQrBTEA7Mbk0$6V znKm7C92z?$N5k{F2ir2S#!H9s>t0{?8}4o^R0pXVdAUzom*?8FjLZFCmZucwkr`8) zrq{GEzO|{5^0caawolr)`$H;U+D#@Ems_d4S-b6c-QX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kMDtL1q>N%?1lLMWg1tCzD#4P@g3x} z0>+QPG%mz_n1(S){tlSNtpUUF15k}~if#vK_$Wr8VJ(?20|m!AcR3@$Uw?o0n&eMV>qq-q+HJB)3 zEjD~%xCkK2%fElzgSdbViBA)s3>=_BS7P_waN&P1R}rXpzlF(mui$(+9fr^()Cv5!u`1xM|6^fnz7AZTlMdir$35qS1Ouw ze_3(BF+Hv5B{e5qN0(?z#};R}{cO9u^;Ec%7xn7-#8*4=9g>6BJ#I^Ks~DH~QmX#b z;KMxrn%a!o2)&8BPU{9slUoRow`){Qfci9D)emmv%E`LIXpUPJ!*f`Jb?#x$O#^qS!OO>Yjs~XvuK!nix.dev as PDF

diff --git a/source/conf.py b/source/conf.py index bdeb11f42..16dd719f0 100644 --- a/source/conf.py +++ b/source/conf.py @@ -201,6 +201,7 @@ "about.html", "search-field.html", "sbt-sidebar-nav.html", + "download-links.html", ], } @@ -260,9 +261,11 @@ # The font size ('10pt', '11pt' or '12pt'). #'pointsize': '10pt', # Additional stuff for the LaTeX preamble. - 'preamble': '\setcounter{tocdepth}{3}', + 'preamble': r'\setcounter{tocdepth}{2}', + 'sphinxsetup': r'TitleColor={RGB}{87, 154, 202}', # Latex figure (float) alignment #'figure_align': 'htbp', + } # Grouping the document tree into LaTeX files. List of tuples @@ -271,17 +274,18 @@ latex_documents = [ ( master_doc, - "nixpkgs-cookbook.tex", - "nixpkgs-cookbook Documentation", + "nix-dev.tex", + "nix.dev", "nix.dev contributors", "manual", + True, # toctree only ), ] latex_engine = "xelatex" # The name of an image file (relative to this directory) to place at the top of # the title page. -# latex_logo = None +latex_logo = "_static/_img/nix.pdf" # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. @@ -290,10 +294,10 @@ latex_use_xindy = False # If true, show page references after internal links. -# latex_show_pagerefs = False +latex_show_pagerefs = True # If true, show URL addresses after external links. -# latex_show_urls = False +latex_show_urls = 'footnote' # Documents to append as an appendix to all manuals. # latex_appendices = []