Skip to content

Commit

Permalink
ci: use nix-run to generate docs + create doc directory
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb committed Jan 15, 2023
1 parent 348c3b7 commit a380cfd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docgen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'

- name: Generating docs
run: nix-shell --command ht-generate-docs
run: nix run ".#docgen"

- name: Update documentation
env:
Expand Down
10 changes: 6 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@
shellFor = system: let
pkgs = pkgsFor system;
pre-commit-check = pre-commit-check-for system;
docgen = pkgs.callPackage ./nix/docgen.nix {};
in
pkgs.mkShell {
name = "haskell-tools.nvim-shell";
Expand All @@ -106,7 +105,6 @@
zlib
alejandra
stylua
docgen
];
};
in {
Expand All @@ -120,9 +118,13 @@
haskell-tools = shellFor system;
});

packages = perSystem (system: rec {
default = haskell-tools-nvim;
packages = perSystem (system: let
pkgs = pkgsFor system;
haskell-tools-nvim = haskell-tools-nvim-for system;
docgen = pkgs.callPackage ./nix/docgen.nix {};
in {
default = haskell-tools-nvim;
inherit docgen haskell-tools-nvim;
});

checks = perSystem (system: let
Expand Down
5 changes: 3 additions & 2 deletions nix/docgen.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{pkgs, ...}:
pkgs.writeShellApplication {
name = "ht-generate-docs";
name = "docgen";
runtimeInputs = with pkgs; [
lemmy-help
];
text = ''
lemmy-help lua/haskell-tools/{init,config,log,lsp,hoogle,repl,project,tags}.lua lua/telescope/_extensions/ht.lua > doc/haskell-tools.txt
mkdir -p doc
lemmy-help lua/haskell-tools/{init,config,lsp,hoogle,repl,project,tags,log}.lua lua/telescope/_extensions/ht.lua > doc/haskell-tools.txt
'';
}

0 comments on commit a380cfd

Please sign in to comment.