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:59:48 +02:00
|
|
|
{ fetchFromGitHub, mdbook, runCommand, rustPlatform, nix-1p, postamble ? "" }:
|
2019-08-04 23:45:23 +02:00
|
|
|
|
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
|
|
|
|
''
|