Skip to content

Commit 12ad9d4

Browse files
committed
Make a derivation for the docs
1 parent f717299 commit 12ad9d4

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

docs/_static/.gitkeep

Whitespace-only changes.

docs/_templates/.gitkeep

Whitespace-only changes.

docs/features.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
- Code evaluation codelens ([Tutorial](https://github.com/haskell/haskell-language-server/tree/master/plugins/hls-eval-plugin/README.md)):
44

5-
![Eval Demo](../plugins/hls-eval-plugin/demo.gif)
5+
![Eval Demo](https://github.com/haskell/haskell-language-server/tree/master/plugins/hls-eval-plugin/demo.gif)
66

77
- Type information and documentation on hover. Note that currently, in order for docs to be displayed for dependencies, they must have been built with GHC's `-haddock` flag:
88

99
- For cabal:
1010
- Add to your global config file (e.g. `~/.cabal/config`):
1111

12-
```cabal
12+
```
1313
program-default-options
1414
ghc-options: -haddock
1515
```
@@ -18,7 +18,7 @@
1818
1919
- For stack, add to global `$STACK_ROOT\config.yaml`, or project's `stack.yaml`:
2020
21-
```cabal
21+
```
2222
ghc-options:
2323
"$everything": -haddock
2424
```

flake.nix

+12
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,15 @@
193193
});
194194
pythonWithPackages = pkgs.python3.withPackages (ps: [ps.sphinx myst-parser sphinx_rtd_theme ps.pip]);
195195

196+
docs = pkgs.stdenv.mkDerivation {
197+
name = "hls-docs";
198+
src = pkgs.lib.sourceFilesBySuffices ./docs [ ".py" ".rst" ".md" ".png" ".gif" ".svg" ];
199+
buildInputs = [ pythonWithPackages ];
200+
# -n gives warnings on missing link targets, -W makes warnings into errors
201+
buildPhase = ''sphinx-build -n -W . $out'';
202+
dontInstall = true;
203+
};
204+
196205
# Create a development shell of hls project
197206
# See https://github.com/NixOS/nixpkgs/blob/5d4a430472cafada97888cc80672fab255231f57/pkgs/development/haskell-modules/make-package-set.nix#L319
198207
mkDevShell = hpkgs:
@@ -253,6 +262,9 @@
253262
haskell-language-server-8104 = mkExe ghc8104;
254263
haskell-language-server-8105 = builtins.throw "GHC 8.10.5 is not available in nixpkgs";
255264
haskell-language-server-901 = mkExe ghc901;
265+
266+
# docs
267+
docs = docs;
256268
};
257269

258270
defaultPackage = packages.haskell-language-server;

0 commit comments

Comments
 (0)