2022-04-20 16:41:20 +02:00
|
|
|
# Copyright 2022 The TVL Contributors
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
2019-08-04 23:45:23 +02:00
|
|
|
|
|
|
|
# Builds the documentation page using the Rust project's 'mdBook'
|
|
|
|
# tool.
|
|
|
|
#
|
|
|
|
# Some of the documentation is pulled in and included from other
|
|
|
|
# sources.
|
|
|
|
|
2022-06-16 16:52:36 +02:00
|
|
|
{ fetchFromGitHub, mdbook, runCommand, rustPlatform, postamble ? "" }:
|
2019-08-04 23:45:23 +02:00
|
|
|
|
|
|
|
let
|
|
|
|
nix-1p = fetchFromGitHub {
|
2019-08-13 01:35:42 +02:00
|
|
|
owner = "tazjin";
|
|
|
|
repo = "nix-1p";
|
2021-10-29 17:29:33 +02:00
|
|
|
rev = "9f0baf5e270128d9101ba4446cf6844889e399a2";
|
|
|
|
sha256 = "1pf9i90gn98vz67h296w5lnwhssk62dc6pij983dff42dbci7lhj";
|
2019-08-04 23:45:23 +02:00
|
|
|
};
|
2022-04-20 16:41:20 +02:00
|
|
|
in
|
2022-06-16 16:52:36 +02:00
|
|
|
runCommand "nixery-book"
|
|
|
|
{
|
|
|
|
POSTAMBLE = postamble;
|
|
|
|
} ''
|
2019-08-04 23:45:23 +02:00
|
|
|
mkdir -p $out
|
|
|
|
cp -r ${./.}/* .
|
|
|
|
chmod -R a+w src
|
|
|
|
cp ${nix-1p}/README.md src/nix-1p.md
|
2022-06-16 16:52:36 +02:00
|
|
|
echo "''${POSTAMBLE}" >> src/nixery.md
|
2019-08-04 23:45:23 +02:00
|
|
|
${mdbook}/bin/mdbook build -d $out
|
|
|
|
''
|