Skip to content

Commit 21f89fb

Browse files
authored
Merge pull request #15 from Nadrieril/nix
2 parents b9311e8 + 5c5fbdd commit 21f89fb

File tree

5 files changed

+235
-0
lines changed

5 files changed

+235
-0
lines changed

.github/workflows/mdbook.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ jobs:
4646
crate: mdbook-linkcheck
4747
git: https://github.com/schilkp/mdbook-linkcheck
4848
rev: ed981be6ded11562e604fff290ae4c08f1c419c5
49+
- name: Install mdbook-backlinks
50+
uses: baptiste0928/cargo-install@v3
51+
with:
52+
crate: mdbook-backlinks
53+
git: https://github.com/Nadrieril/mdbook-backlinks
54+
rev: 526e94fd747d712c75baea840d23f513233e0927
4955
- name: Setup Pages
5056
id: pages
5157
uses: actions/configure-pages@v5

Justfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
serve:
2+
mdbook serve

book.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ level = 0
1919
[output.linkcheck]
2020
# This might be too annoying.
2121
warning-policy = "error"
22+
23+
[preprocessor.backlinks] # https://github.com/Nadrieril/mdbook-backlinks
24+
optional = true

flake.lock

Lines changed: 179 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
description = "Beyond Refs";
3+
4+
inputs = {
5+
nixpkgs.url = "nixpkgs/nixos-unstable";
6+
flake-utils.url = "github:numtide/flake-utils";
7+
mdbook-backlinks.url = "github:nadrieril/mdbook-backlinks";
8+
};
9+
10+
outputs = inputs @ { self, ... }:
11+
inputs.flake-utils.lib.eachDefaultSystem (system:
12+
let
13+
pkgs = import inputs.nixpkgs { inherit system; };
14+
15+
# Temporarily pull the fix for https://github.com/Michael-F-Bryan/mdbook-linkcheck/pull/98
16+
mdbook-linkcheck = with pkgs; rustPlatform.buildRustPackage {
17+
pname = "mdbook-linkcheck";
18+
version = "PR-98";
19+
20+
src = fetchFromGitHub {
21+
owner = "schilkp";
22+
repo = "mdbook-linkcheck";
23+
rev = "ed981be6ded11562e604fff290ae4c08f1c419c5";
24+
sha256 = "sha256-GTVWc/vkqY9Hml2fmm3iCHOzd/HPP1i/8NIIjFqGGbQ=";
25+
};
26+
27+
cargoHash = "sha256-+73aI/jt5mu6dR6PR9Q08hPdOsWukb/z9crIdMMeF7U=";
28+
29+
buildInputs = if stdenv.hostPlatform.isDarwin then [ Security ] else [ openssl ];
30+
nativeBuildInputs = lib.optionals (!stdenv.hostPlatform.isDarwin) [ pkg-config ];
31+
32+
OPENSSL_NO_VENDOR = 1;
33+
doCheck = false;
34+
};
35+
in
36+
{
37+
devShells.default = pkgs.mkShell {
38+
packages = [
39+
pkgs.mdbook
40+
mdbook-linkcheck
41+
inputs.mdbook-backlinks.packages.${system}.default
42+
];
43+
};
44+
});
45+
}

0 commit comments

Comments
 (0)