docs: better summary + embed modules README.md

This commit is contained in:
DavHau 2023-10-22 23:00:24 +01:00 committed by mergify[bot]
parent c3c5769aba
commit 731ac1daf1
5 changed files with 27 additions and 5 deletions

View File

@ -0,0 +1 @@
A package module based on the mkDerivation builder from nixpkgs

View File

@ -222,10 +222,10 @@ in {
installation = mkOption {
type = types.str;
description = ''
Installation paragraph between installation and options.
Paragraph between import and options.
'';
default = ''
## Installation
## Import
To import this module into your dream2nix package:
@ -354,7 +354,6 @@ in {
# - [Reference Documentation]()
# - [core (built in)](./options/core.md)
generated-summary-md = pkgs.writeText "SUMMARY.md" ''
- [Reference Documentation]()
${
lib.concatStringsSep "\n"
(lib.mapAttrsToList

View File

@ -53,7 +53,24 @@
rm ./src/intro.md
cp ${self + /README.md} ./src/intro.md
cat ${self'.packages.generated-summary-md} >> ./src/SUMMARY.md
cp ./src/SUMMARY.md SUMMARY.md.orig
# insert the generated part of the summary into the origin SUMMARY.md
{
while read ln; do
case "$ln" in
"# Modules Reference")
echo "# Modules Reference"
cat ${self'.packages.generated-summary-md}
;;
*)
echo "$ln"
;;
esac
done
} < SUMMARY.md.orig > src/SUMMARY.md
mkdir -p ./theme
cp ${self + /modules/dream2nix/core/docs/theme/favicon.png} ./theme/favicon.png

View File

@ -6,6 +6,8 @@
# Concepts
- [dream2nix modules](./modules.md)
# Modules Reference
# Development Roundups
- [April - June 2022](./development-roundups/2022-april-june.md)
- [July - September 2022](./development-roundups/2022-july-september.md)

View File

@ -41,7 +41,10 @@
"dream2nix"
(lib.strings.escapeNixIdentifier name)
];
intro = "intro";
intro =
if lib.pathExists (self + /modules/dream2nix/${name}/README.md)
then lib.readFile (self + /modules/dream2nix/${name}/README.md)
else "";
baseUrl = "https://github.com/nix-community/dream2nix/blob/master";
separateEval = true;
});