Skip to content

Commit

Permalink
Merge pull request #41 from roidelapluie/toolsdesc
Browse files Browse the repository at this point in the history
Add tools description to the home page
  • Loading branch information
roidelapluie authored Feb 20, 2023
2 parents c7ec529 + c27d432 commit 6a29176
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cmd/oy-periodic-queries/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# oy-periodic-rules
# oy-periodic-queries

*oy-periodic-rules* is a tool that allows you to evaluate Prometheus
*oy-periodic-queries* is a tool that allows you to evaluate Prometheus
recording rules and export the results as metrics, with defined boundaries such
as monthly or weekly (*Only monthly is implemented at the moment*).

Expand Down
2 changes: 1 addition & 1 deletion docs/layouts/shortcodes/tools.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<ul>
{{ range where .Site.RegularPages "Params.Tool" "!=" nil }}
<li><a href="{{ .Permalink }}">{{ .Params.Tool }}</a></li>
<li><strong><a href="{{ .Permalink }}">{{ .Params.Tool }}</a></strong> {{ .Params.Description | markdownify }}</li>
{{ end }}
</ul>
6 changes: 5 additions & 1 deletion tool-documentation.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@
usage = pkgs.runCommand "${name} --help" {} "${tool}/bin/${name} --help &> $out";
documentation = pkgs.writeTextFile {
name = "${name}-doc.md";
text = ''
text = let
firstParagraphDescription = builtins.elemAt (builtins.split "\n\n" (builtins.readFile description)) 0;
frontmatterDescription = pkgs.lib.removePrefix "\n*${name}*" firstParagraphDescription;
in ''
---
title: ${name}
geekdocRepo: "https://github.com/o11ydev/oy-toolkit"
geekdocEditPath: "edit/main/cmd/${name}"
geekdocFilePath: "README.md"
tool: ${name}
description: ${assert frontmatterDescription != firstParagraphDescription; builtins.toJSON frontmatterDescription}
---
${builtins.readFile ./docs/tools-top.md}
Expand Down

0 comments on commit 6a29176

Please sign in to comment.