-
-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc: link to the homepage of each target #883
Comments
This should be fairly easy as a continuation of #873 as it could just be added to each module's README |
AFAIK, Home Manager and NixOS are not doing this either. Only Nixpkgs declares this information:
|
We could potentially reuse this by associating a package with each target, then substituting values from the package metadata into the documentation. However not all targets match up with a single package, and not all packages have all the metadata we would need. It's most likely easier to just do this manually using the module README functionality (which is now merged 🎉) Mockup of a generated page: VSCode
Home Manager optionsstylix.targets.vscode.enableWhether to enable theming for VSCode. Type: boolean Default: same as Example: Declared by: NixOS optionsNone provided. |
What about generating the documentation from a new { config, lib, ... }: {
options.stylix.targets."<TARGET>".enable =
config.lib.stylix.mkEnableTarget "<TARGET>" true;
config =
lib.mkIf (config.stylix.enable && config.stylix.targets."<TARGET>".enable) {
services."<TARGET>".settings = { /* ... */ };
meta = {
description = pkgs.git.meta.description;
homepage = pkgs.git.meta.homepage;
license = pkgs.git.meta.license;
longDescription = pkgs.git.meta.longDescription;
};
};
};
} If some a field is unavailable or we want to override it, we simply provide our own value: meta = {
description = "This is a package.";
homepage = pkgs.git.meta.homepage;
license = pkgs.git.meta.license;
longDescription = "This is a very useful additional description.";
}; However, it might be better to unconditionally declare { config, lib, ... }: {
options.stylix.targets."<TARGET>".enable =
config.lib.stylix.mkEnableTarget "<TARGET>" true;
config = lib.mkMerge [
(
lib.mkIf
(config.stylix.enable && config.stylix.targets."<TARGET>".enable)
{ services."<TARGET>".settings = { /* ... */ }; }
)
(
{
meta = {
description = pkgs.git.meta.description;
homepage = pkgs.git.meta.homepage;
license = pkgs.git.meta.license;
longDescription = pkgs.git.meta.longDescription;
};
}
)
];
} Since this is somewhat cumbersome, we might want to consider guarding |
How about having
pkgs: {
inherit (pkgs.git.meta) homepage description longDescription;
} IMO the license isn't relevant to Stylix documentation as we aren't a package manager. We just need enough details to distinguish between multiple programs with the same name. Note that even if we add structured metadata, supporting |
Sounds great. However, renaming the file to
The I do not know how beneficial a |
README is copied directly from the source by a bash script, so there's no https://github.com/danth/stylix/blob/master/docs/default.nix#L140 |
having something like |
In my opinion, the docs should have a hyperlink to the relevant website or repo next to every target.
This is because some of the targeted applications have really generic names.
For example, under the heading "stylix.targets.forge.enable", there should be a hyperlink to the home page or git repo of Forge. Without this link, I am unsure which of the many programs and applications out there named Forge this is actually meant to target.
The text was updated successfully, but these errors were encountered: