Skip to content

Commit

Permalink
Make a derivation for the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelpj committed Aug 8, 2021
1 parent f717299 commit 12ad9d4
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
Empty file added docs/_static/.gitkeep
Empty file.
Empty file added docs/_templates/.gitkeep
Empty file.
6 changes: 3 additions & 3 deletions docs/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

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

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

- 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:

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

```cabal
```
program-default-options
ghc-options: -haddock
```
Expand All @@ -18,7 +18,7 @@
- For stack, add to global `$STACK_ROOT\config.yaml`, or project's `stack.yaml`:
```cabal
```
ghc-options:
"$everything": -haddock
```
Expand Down
12 changes: 12 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,15 @@
});
pythonWithPackages = pkgs.python3.withPackages (ps: [ps.sphinx myst-parser sphinx_rtd_theme ps.pip]);

docs = pkgs.stdenv.mkDerivation {
name = "hls-docs";
src = pkgs.lib.sourceFilesBySuffices ./docs [ ".py" ".rst" ".md" ".png" ".gif" ".svg" ];
buildInputs = [ pythonWithPackages ];
# -n gives warnings on missing link targets, -W makes warnings into errors
buildPhase = ''sphinx-build -n -W . $out'';
dontInstall = true;
};

# Create a development shell of hls project
# See https://github.com/NixOS/nixpkgs/blob/5d4a430472cafada97888cc80672fab255231f57/pkgs/development/haskell-modules/make-package-set.nix#L319
mkDevShell = hpkgs:
Expand Down Expand Up @@ -253,6 +262,9 @@
haskell-language-server-8104 = mkExe ghc8104;
haskell-language-server-8105 = builtins.throw "GHC 8.10.5 is not available in nixpkgs";
haskell-language-server-901 = mkExe ghc901;

# docs
docs = docs;
};

defaultPackage = packages.haskell-language-server;
Expand Down

0 comments on commit 12ad9d4

Please sign in to comment.