enable github like alerts
This commit is contained in:
parent
0a59eac9a0
commit
de9509047e
5 changed files with 36 additions and 9 deletions
|
@ -4,3 +4,5 @@ language = "en"
|
|||
multilingual = false
|
||||
src = "src"
|
||||
title = "/usr/share/doc"
|
||||
|
||||
[preprocessor.alerts]
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
{ stdenvNoCC
|
||||
, mdbook
|
||||
, mdbook-alerts
|
||||
,
|
||||
}:
|
||||
stdenvNoCC.mkDerivation {
|
||||
pname = "wiki";
|
||||
version = "2023-12-04";
|
||||
src = ./.;
|
||||
buildInputs = [ mdbook ];
|
||||
buildInputs = [ mdbook mdbook-alerts ];
|
||||
buildPhase = ''
|
||||
mdbook build
|
||||
'';
|
||||
|
|
|
@ -21,11 +21,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1705242415,
|
||||
"narHash": "sha256-a8DRYrNrzTudvO7XHUPNJD89Wbf1ZZT0VbwCsPnHWaE=",
|
||||
"lastModified": 1719826879,
|
||||
"narHash": "sha256-xs7PlULe8O1SAcs/9e/HOjeUjBrU5FNtkAF/bSEcFto=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "ea780f3de2d169f982564128804841500e85e373",
|
||||
"rev": "b9014df496d5b68bf7c0145d0e9b0f529ce4f2a8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
11
flake.nix
11
flake.nix
|
@ -18,7 +18,8 @@
|
|||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
};
|
||||
package = pkgs.callPackage ./default.nix { };
|
||||
mdbook-alerts = pkgs.callPackage ./mdbook-alerts.nix { };
|
||||
package = pkgs.callPackage ./default.nix { inherit mdbook-alerts; };
|
||||
app = pkgs.writeShellScriptBin "app" ''
|
||||
trap 'kill "''${child_pid}"; wait "''${child_pid}";' SIGINT SIGTERM
|
||||
${pkgs.merecat}/bin/merecat -n -p 8080 ${package}/share/web &
|
||||
|
@ -29,13 +30,13 @@
|
|||
{
|
||||
formatter = pkgs.nixpkgs-fmt;
|
||||
devShells.default = pkgs.mkShell {
|
||||
packages = with pkgs; [
|
||||
mdbook
|
||||
tailwindcss-language-server
|
||||
packages = [
|
||||
pkgs.mdbook
|
||||
mdbook-alerts
|
||||
];
|
||||
};
|
||||
packages = {
|
||||
inherit app;
|
||||
inherit app mdbook-alerts;
|
||||
default = package;
|
||||
};
|
||||
}
|
||||
|
|
23
mdbook-alerts.nix
Normal file
23
mdbook-alerts.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{ lib, fetchFromGitHub, rustPlatform }:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "mdbook-alerts";
|
||||
version = "0.5.2";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "lambdalisue";
|
||||
repo = "rs-mdbook-alerts";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-YlCvsDdWuoajuXt2hOGx7jW+lmLeMOSQ809bG9ZBaBY=";
|
||||
};
|
||||
|
||||
cargoHash = "sha256-OuZo8QTE5Z1991S5CEkfxlXghQbnalt1UGNs4KozmEk=";
|
||||
|
||||
meta = with lib; {
|
||||
description = "mdBook preprocessor to add GitHub Flavored Markdown's Alerts to your book";
|
||||
mainProgram = "mdbook-alerts";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ adtya ];
|
||||
homepage = "https://github.com/lambdalisue/rs-mdbook-alerts";
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue