Skip to content

Commit 8309423

Browse files
authored
Fix #518: examples in documentation need to be tested (#1714)
1 parent b6fc426 commit 8309423

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+1673
-594
lines changed

.buildkite/pipeline.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ steps:
7474
agents:
7575
system: x86_64-linux
7676

77+
- label: 'Test examples in documentation ...'
78+
command: "./test/tests.sh ghc8107 docs"
79+
agents:
80+
system: x86_64-linux
81+
7782
- label: 'Check that jobset will evaluate in Hydra at ifdLevel 0 and 1'
7883
command:
7984
- nix-build build.nix -A maintainer-scripts.check-hydra -o check-hydra.sh

.gitignore

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
# The output of "mkdocs build"
2-
/site/
3-
docs/reference/modules.md
1+
# The output of "mdbook build"
2+
/book/
3+
/docs/reference/modules.md
4+
/docs/**/index.html
45

56
# Nix build results
67
result*

book.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[book]
2+
language = "en"
3+
multilingual = false
4+
src = "docs"
5+
title = "Alternative Haskell Infrastructure for Nixpkgs"

docs/SUMMARY.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
- [Introduction](./index.md)
2+
- [Motivation](./motivation.md)
3+
- [Architecture](./architecture.md)
4+
- [Tutorials](./tutorials/index.md)
5+
- [Getting started](./tutorials/getting-started.md)
6+
- [Getting started with Flakes](./tutorials/getting-started-flakes.md)
7+
- [Getting started with Hix](./tutorials/getting-started-hix.md)
8+
- [Creating a development environment](./tutorials/development.md)
9+
- [Sourcing files only part of git repository using cleanGit](./tutorials/clean-git.md)
10+
- [Handling git repositories in projects](./tutorials/source-repository-hashes.md)
11+
- [Mapping non-Haskell dependencies to Nixpkgs](./tutorials/pkg-map.md)
12+
- [Bumping Hackage and Stackage snapshots](./tutorials/hackage-stackage.md)
13+
- [Materialization: Speeding up Nix evaluation](./tutorials/materialization.md)
14+
- [Cross-compiling your project](./tutorials/cross-compilation.md)
15+
- [Generating coverage information](./tutorials/coverage.md)
16+
- [Build a specific package from Hackage or Stackage](./tutorials/building-package-from-stackage-hackage.md)
17+
- [Content addressed derivations](./tutorials/ca-derivations.md)
18+
- [Reference](./reference/index.md)
19+
- [Supported GHC versions](./reference/supported-ghc-versions.md)
20+
- [Command-line tools](./reference/commands.md)
21+
- [Haskell.nix Library](./reference/library.md)
22+
- [Module options](./reference/modules.md)
23+
- [Troubleshooting](./troubleshooting.md)
24+
- [Templates / Abstraction](./template/index.html)
25+
- [IOHKs nix library](./template/iohk-nix.md)
26+
- [Dev Notes](./dev/index.html)
27+
- [Architecture](./dev/dev-architecture.md)
28+
- [Installing nix-tools](./dev/installing-nix-tools.md)
29+
- [How to update nix-tools](./dev/nix-tools-pin.md)
30+
- [Manually generating Nix expressions](./dev/manually-generating-nix-expressions.md)
31+
- [Maintainer Scripts](./dev/maintainer-scripts.md)
32+
- [Nixpkgs Pin](./dev/nixpkgs-pin.md)
33+
- [Removing withPackage wrapper](./dev/removing-with-package-wrapper.md)
34+
- [Test Suite](./dev/tests.md)
35+
- [Adding a new GHC version](./dev/adding-new-ghc.md)
36+
- [Coverage](./dev/coverage.md)
37+
- [Making changes to Hix](./dev/hix.md)
38+
- [ChangeLog](./changelog.md)

docs/dev/adding-new-ghc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Check the LLVM version that should be used in the
1616

1717
In the haskell.nix repo run:
1818

19-
```
19+
```shell
2020
mkdir materialized/ghc884
2121
nix-build scripts/check-compiler-materialization --argstr compiler-nix-name ghc884
2222
```

docs/dev/coverage.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ reports (as detailed in the [coverage tutorial](../tutorials/coverage.md#custom)
5252

5353
The coverage information generated will look something like this:
5454

55-
```bash
55+
```shell
5656
/nix/store/...-my-project-0.1.0.0-coverage-report/
5757
└── share
5858
└── hpc
@@ -105,7 +105,7 @@ The coverage information generated will look something like this:
105105
The coverage information for an entire project will look something
106106
like this:
107107

108-
```bash
108+
```shell
109109
/nix/store/...-coverage-report
110110
└── share
111111
└── hpc

docs/dev/hix.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,21 @@ test the changes locally before uploading them to github.
77

88
Install the hix command wrappers after making changes to a local clone of haskell.nix:
99

10-
```
10+
```shell
1111
nix-env -iA hix -f /path/to/local/haskell.nix
1212
hix-shell
1313
```
1414

1515
Or override the version of haskell.nix used by the commands with the `HIX_ROOT` environment variable:
1616

17-
```
17+
```shell
1818
HIX_ROOT=/path/to/local/haskell.nix hix-shell
1919
```
2020

2121
## Flakes
2222

2323
For flakes use `--override-input` to point to the modified haskell.nix:
2424

25-
```
25+
```shell
2626
nix develop --override-input haskellNix /path/to/local/haskell.nix
2727
```

docs/dev/index.md

Whitespace-only changes.

docs/dev/installing-nix-tools.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
To build the latest `nix-tools` and store the result at `./nt`, run:
44

5-
```bash
5+
```shell
66
nix build -f https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz pkgs.haskell-nix.nix-tools.ghc884 --out-link nt
77
```
88

99
If you would like to then install `nix-tools` into your profile, run:
1010

11-
```bash
11+
```shell
1212
nix-env -i ./nt
1313
```
1414

@@ -18,7 +18,7 @@ The [Haskell.nix][] and `nix-tools` source will be useful if you would
1818
like to contribute improvements, or read the source code to fully
1919
understand something that the documentation doesn't cover.
2020

21-
```bash
21+
```shell
2222
git clone https://github.com/input-output-hk/nix-tools
2323
git clone https://github.com/input-output-hk/haskell.nix
2424
cd haskell.nix

docs/dev/maintainer-scripts.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ scripts in this repo.
88

99
To run the updater scripts manually, use:
1010

11-
nix-build build.nix -A maintainer-scripts.update-hackage -o update-hackage.sh
12-
./update-hackage.sh
11+
```shell
12+
nix-build build.nix -A maintainer-scripts.update-hackage -o update-hackage.sh
13+
./update-hackage.sh
1314

14-
nix-build build.nix -A maintainer-scripts.update-stackage -o update-stackage.sh
15-
./update-stackage.sh
15+
nix-build build.nix -A maintainer-scripts.update-stackage -o update-stackage.sh
16+
./update-stackage.sh
17+
```
1618

1719
The scripts will clone the repo, generate the latest data, then
1820
attempt to push back to the repo and update the source JSON file.

0 commit comments

Comments
 (0)