Skip to content

Publish PDF #1139

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 16 additions & 11 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -42,6 +45,7 @@ let
''
${lib.optionalString withManuals "cp -f ${substitutedNixManualReference} source/reference/nix-manual.md"}
make html
make latexpdf
'';
installPhase =
let
Expand All @@ -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)}
Expand Down
7 changes: 3 additions & 4 deletions npins/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -27,4 +27,3 @@
},
"version": 3
}

Binary file added source/_static/_img/nix.pdf
Binary file not shown.
1 change: 1 addition & 0 deletions source/_templates/download-links.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p>nix.dev as <a href="nix-dev.pdf">PDF</p>
16 changes: 10 additions & 6 deletions source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@
"about.html",
"search-field.html",
"sbt-sidebar-nav.html",
"download-links.html",
],
}

Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand All @@ -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 = []
Expand Down
Loading