mirror of
https://gitlab.com/TECHNOFAB/coder-templates.git
synced 2025-12-12 02:00:11 +01:00
docs: add docs and improve README
This commit is contained in:
parent
8cf73a70ef
commit
c16bc97264
10 changed files with 159 additions and 4 deletions
|
|
@ -39,6 +39,30 @@ in
|
|||
];
|
||||
artifacts.paths = ["dist/"];
|
||||
};
|
||||
"docs" = {
|
||||
stage = "build";
|
||||
script = [
|
||||
# sh
|
||||
''
|
||||
nix build .#docs:default
|
||||
mkdir -p public
|
||||
cp -r result/. public/
|
||||
''
|
||||
];
|
||||
artifacts.paths = ["public"];
|
||||
};
|
||||
"pages" = {
|
||||
nix.enable = false;
|
||||
image = "alpine:latest";
|
||||
stage = "upload";
|
||||
script = ["true"];
|
||||
artifacts.paths = ["public"];
|
||||
rules = [
|
||||
{
|
||||
"if" = "$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH";
|
||||
}
|
||||
];
|
||||
};
|
||||
"upload" = {
|
||||
stage = "upload";
|
||||
nix.deps = [pkgs.buildah];
|
||||
|
|
|
|||
80
nix/repo/docs.nix
Normal file
80
nix/repo/docs.nix
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
{inputs, ...}: let
|
||||
inherit (inputs) cells doclib pkgs;
|
||||
inherit (pkgs.lib) concatMapStringsSep;
|
||||
in
|
||||
(doclib.mkDocs {
|
||||
docs."default" = {
|
||||
base = "${inputs.self}";
|
||||
path = "${inputs.self}/docs";
|
||||
material = {
|
||||
enable = true;
|
||||
colors = {
|
||||
primary = "green";
|
||||
accent = "light blue";
|
||||
};
|
||||
umami = {
|
||||
enable = true;
|
||||
src = "https://analytics.tf/umami";
|
||||
siteId = "dc8d1f6c-50f6-4019-9b0d-9b924dedb111";
|
||||
domains = ["coder-templates.projects.tf"];
|
||||
};
|
||||
};
|
||||
dynamic-nav = {
|
||||
enable = true;
|
||||
files."Parameters" = map (template: {
|
||||
${template} =
|
||||
builtins.toFile "${template}.md"
|
||||
# md
|
||||
''
|
||||
# ${template} Parameters
|
||||
|
||||
${
|
||||
concatMapStringsSep "\n" (param: ''
|
||||
## ${param.name}
|
||||
|
||||
${param.description}
|
||||
|
||||
Type: `${param.type}` <br>
|
||||
Mutable: `${
|
||||
if param.mutable
|
||||
then "true"
|
||||
else "false"
|
||||
}` <br>
|
||||
${
|
||||
if param.default != ""
|
||||
then "Default: `${param.default}` <br>"
|
||||
else ""
|
||||
}
|
||||
'')
|
||||
(builtins.attrValues cells.packages.packages."${template}-cli".module.config.data.coder_parameter)
|
||||
}
|
||||
'';
|
||||
}) ["nix-kubernetes"];
|
||||
};
|
||||
config = {
|
||||
site_name = "Coder Templates";
|
||||
site_url = "https://coder-templates.projects.tf";
|
||||
repo_name = "TECHNOFAB/coder-templates";
|
||||
repo_url = "https://gitlab.com/TECHNOFAB/coder-templates";
|
||||
extra_css = ["style.css"];
|
||||
theme = {
|
||||
logo = "images/logo.svg";
|
||||
icon.repo = "simple/gitlab";
|
||||
favicon = "images/logo.svg";
|
||||
};
|
||||
nav = [
|
||||
{"Introduction" = "index.md";}
|
||||
];
|
||||
markdown_extensions = [
|
||||
{
|
||||
"pymdownx.highlight".pygments_lang_class = true;
|
||||
}
|
||||
"pymdownx.inlinehilite"
|
||||
"pymdownx.snippets"
|
||||
"pymdownx.superfences"
|
||||
"pymdownx.escapeall"
|
||||
"fenced_code"
|
||||
];
|
||||
};
|
||||
};
|
||||
}).packages
|
||||
18
nix/repo/flake.lock
generated
18
nix/repo/flake.lock
generated
|
|
@ -35,10 +35,28 @@
|
|||
"type": "gitlab"
|
||||
}
|
||||
},
|
||||
"nixmkdocs-lib": {
|
||||
"locked": {
|
||||
"dir": "lib",
|
||||
"lastModified": 1763481845,
|
||||
"narHash": "sha256-Bp0+9rDmlPWMcnKqGx+BG4+o5KO8FuDAOvXRnXrm3Fo=",
|
||||
"owner": "TECHNOFAB",
|
||||
"repo": "nixmkdocs",
|
||||
"rev": "73d59093df94a894d25bc4bf71880b6f00faa62f",
|
||||
"type": "gitlab"
|
||||
},
|
||||
"original": {
|
||||
"dir": "lib",
|
||||
"owner": "TECHNOFAB",
|
||||
"repo": "nixmkdocs",
|
||||
"type": "gitlab"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"devshell-lib": "devshell-lib",
|
||||
"nix-gitlab-ci-lib": "nix-gitlab-ci-lib",
|
||||
"nixmkdocs-lib": "nixmkdocs-lib",
|
||||
"soonix-lib": "soonix-lib",
|
||||
"treefmt-nix": "treefmt-nix"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
inputs = {
|
||||
devshell-lib.url = "gitlab:rensa-nix/devshell?dir=lib";
|
||||
soonix-lib.url = "gitlab:TECHNOFAB/soonix?dir=lib";
|
||||
nixmkdocs-lib.url = "gitlab:TECHNOFAB/nixmkdocs?dir=lib";
|
||||
nix-gitlab-ci-lib.url = "gitlab:TECHNOFAB/nix-gitlab-ci/3.0.1?dir=lib";
|
||||
treefmt-nix = {
|
||||
url = "github:numtide/treefmt-nix";
|
||||
|
|
@ -13,6 +14,7 @@
|
|||
// {
|
||||
devshell = i.devshell-lib.lib {inherit (i.parent) pkgs;};
|
||||
soonix = i.soonix-lib.lib {inherit (i.parent) pkgs;};
|
||||
doclib = i.nixmkdocs-lib.lib {inherit (i.parent) pkgs;};
|
||||
cilib = i.nix-gitlab-ci-lib.lib {inherit (i.parent) pkgs;};
|
||||
treefmt = import i.treefmt-nix;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue