From 145200480d7eb4563b0b9768b9f6e84b5ba04854 Mon Sep 17 00:00:00 2001 From: Mohammad Rafiq Date: Sat, 5 Jul 2025 04:53:59 +0800 Subject: [PATCH] feat(readme): add headings and descriptions to text.readme --- README.md | 14 +++++++++----- modules/docs/readme.nix | 20 +++++++++++++++----- modules/flake-parts/files.nix | 2 +- modules/helpers/text.nix | 6 ++++-- 4 files changed, 29 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index d0fdc4c..3b89d3b 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,13 @@ -# readme -## generated-files +# Pantheon +This flake serves as a monorepo for my systems (using IaC), dotfiles, and scripts. + +## Generated Files This flake uses the [files flake-parts module](https://flake.parts/options/files.html) to generate documentation. The list of generated files are: - [docs/cheatsheet.md](docs/cheatsheet.md) - [README.md](README.md) -## helpers -### text-helper -The option `text. supports either a string or a submodule with attributes order and parts. The parts attribute can either be a string, which will get concatenated in the order laid out in `text..order`, or can itself have the attributes order and parts, in which case it will be evaluated recursively. \ No newline at end of file +## Helpers +The following are some helpers for the repo as a whole. +### Generating Text +The option `text.` supports either a string or a submodule with attributes order and parts. +The parts attribute can either be a string, which will get concatenated in the order laid out in `text..order`, or can itself have the attributes order and parts, in which case it will be evaluated recursively. \ No newline at end of file diff --git a/modules/docs/readme.nix b/modules/docs/readme.nix index bc2f6f2..d11ac1d 100644 --- a/modules/docs/readme.nix +++ b/modules/docs/readme.nix @@ -3,11 +3,21 @@ let inherit (lib) singleton; in { - text.readme.order = [ - "generated-files" - "helpers" - ]; - text.readme.parts.helpers.order = [ "text-helper" ]; + text.readme = { + heading = "Pantheon"; + description = '' + This flake serves as a monorepo for my systems (using IaC), dotfiles, and scripts. + ''; + order = [ + "Generated Files" + "helpers" + ]; + parts.helpers = { + heading = "Helpers"; + description = "The following are some helpers for the repo as a whole."; + order = [ "Generating Text" ]; + }; + }; perSystem = { pkgs, ... }: diff --git a/modules/flake-parts/files.nix b/modules/flake-parts/files.nix index 3fcdd64..fe4a9cd 100644 --- a/modules/flake-parts/files.nix +++ b/modules/flake-parts/files.nix @@ -17,7 +17,7 @@ in perSystem = psArgs: { make-shells.default.packages = [ psArgs.config.files.writer.drv ]; }; - text.readme.parts.generated-files = concatStringsSep "\n" ( + text.readme.parts."Generated Files" = concatStringsSep "\n" ( [ "This flake uses the [files flake-parts module](https://flake.parts/options/files.html) to generate documentation." diff --git a/modules/helpers/text.nix b/modules/helpers/text.nix index cafb06a..bdb17ad 100644 --- a/modules/helpers/text.nix +++ b/modules/helpers/text.nix @@ -70,6 +70,8 @@ in name: value: concatStringsSep "\n" (flatten (mkListFromAttrs 1 { inherit name value; })) ); }; - config.text.readme.parts.helpers.parts.text-helper = - "The option `text. supports either a string or a submodule with attributes order and parts. The parts attribute can either be a string, which will get concatenated in the order laid out in `text..order`, or can itself have the attributes order and parts, in which case it will be evaluated recursively."; + config.text.readme.parts.helpers.parts."Generating Text" = + '' + The option `text.` supports either a string or a submodule with attributes order and parts. + The parts attribute can either be a string, which will get concatenated in the order laid out in `text..order`, or can itself have the attributes order and parts, in which case it will be evaluated recursively.''; }