From 651ef6fc62ac8117be5866934083987725e38dab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Na=C3=AFm=20Favier?= Date: Fri, 27 Jan 2023 18:50:29 +0100 Subject: [PATCH] flake-info: update manpage filter (#597) Update the nixpkgs input and use the new link-manpages filter to avoid duplicated links. Co-authored-by: Rok Garbas --- flake-info/default.nix | 3 ++- flake-info/src/data/pandoc.rs | 3 +-- flake.lock | 6 +++--- flake.nix | 2 ++ 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/flake-info/default.nix b/flake-info/default.nix index 941b0df..bd239bf 100644 --- a/flake-info/default.nix +++ b/flake-info/default.nix @@ -23,7 +23,8 @@ pkgs.rustPlatform.buildRustPackage rec { checkInputs = with pkgs; [ pandoc ]; ROOTDIR = builtins.placeholder "out"; - NIXPKGS_PANDOC_FILTERS_PATH = "${pkgs.path + "/doc/build-aux/pandoc-filters"}"; + NIXPKGS_PANDOC_FILTERS_PATH = pkgs.path + "/doc/build-aux/pandoc-filters"; + LINK_MANPAGES_PANDOC_FILTER = import (pkgs.path + "/doc/build-aux/pandoc-filters/link-manpages.nix") { inherit pkgs; }; checkFlags = [ "--skip elastic::tests" diff --git a/flake-info/src/data/pandoc.rs b/flake-info/src/data/pandoc.rs index 66df484..ea83165 100644 --- a/flake-info/src/data/pandoc.rs +++ b/flake-info/src/data/pandoc.rs @@ -10,8 +10,7 @@ lazy_static! { Path::new(FILTERS_PATH).join("docbook-reader/citerefentry-to-rst-role.lua"); static ref MARKDOWN_ROLES_FILTER: PathBuf = Path::new(FILTERS_PATH).join("myst-reader/roles.lua"); - static ref MANPAGE_LINK_FILTER: PathBuf = - Path::new(FILTERS_PATH).join("link-unix-man-references.lua"); + static ref MANPAGE_LINK_FILTER: PathBuf = PathBuf::from(env!("LINK_MANPAGES_PANDOC_FILTER")); static ref XREF_FILTER: PathBuf = crate::DATADIR.join("data/fix-xrefs.lua"); } diff --git a/flake.lock b/flake.lock index 6d801dd..d12f069 100644 --- a/flake.lock +++ b/flake.lock @@ -33,11 +33,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1667629849, - "narHash": "sha256-P+v+nDOFWicM4wziFK9S/ajF2lc0N2Rg9p6Y35uMoZI=", + "lastModified": 1673315479, + "narHash": "sha256-GNCFRtDHjTygXGJp/H+f2XQPMGxpYSmNiibIqYzihtM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3bacde6273b09a21a8ccfba15586fb165078fb62", + "rev": "c07552f6f7d4eead7806645ec03f7f1eb71ba6bd", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index f841fc4..2c86165 100644 --- a/flake.nix +++ b/flake.nix @@ -101,6 +101,7 @@ extraShellHook = '' export RUST_SRC_PATH="${pkgs.rustPlatform.rustLibSrc}"; export NIXPKGS_PANDOC_FILTERS_PATH="${packages.flake-info.NIXPKGS_PANDOC_FILTERS_PATH}"; + export LINK_MANPAGES_PANDOC_FILTER="${packages.flake-info.LINK_MANPAGES_PANDOC_FILTER}"; export PATH=$PWD/frontend/node_modules/.bin:$PATH ''; }; @@ -111,6 +112,7 @@ extraShellHook = '' export RUST_SRC_PATH="${pkgs.rustPlatform.rustLibSrc}"; export NIXPKGS_PANDOC_FILTERS_PATH="${packages.flake-info.NIXPKGS_PANDOC_FILTERS_PATH}"; + export LINK_MANPAGES_PANDOC_FILTER="${packages.flake-info.LINK_MANPAGES_PANDOC_FILTER}"; ''; };