Skip to content

Commit

Permalink
doc/local.mk: Add manual-html-open phony target for opening browser
Browse files Browse the repository at this point in the history
  • Loading branch information
roberth committed Mar 24, 2024
1 parent 38ba96d commit 12a2145
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
10 changes: 10 additions & 0 deletions doc/manual/local.mk
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,16 @@ $(d)/src/SUMMARY-rl-next.md: $(d)/src/release-notes/rl-next.md
# Generate the HTML manual.
.PHONY: manual-html
manual-html: $(docdir)/manual/index.html

# Open the built HTML manual in the default browser.
manual-html-open: $(docdir)/manual/index.html
@echo " OPEN " $<; \
xdg-open $< \
|| open $< \
|| { \
echo "Could not open the manual in a browser. Please open '$<'" >&2; \
false; \
}
install: $(docdir)/manual/index.html

# Generate 'nix' manpages.
Expand Down
4 changes: 1 addition & 3 deletions doc/manual/src/contributing/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@ and open `./result-doc/share/doc/nix/manual/index.html`.
To build the manual incrementally, [enter the development shell](./hacking.md) and run:

```console
make manual-html -j $NIX_BUILD_CORES
make manual-html-open -j $NIX_BUILD_CORES
```

and open `./outputs/doc/share/doc/nix/manual/language/index.html`.

In order to reflect changes to the [Makefile for the manual], clear all generated files before re-building:

[Makefile for the manual]: https://github.com/NixOS/nix/blob/master/doc/manual/local.mk
Expand Down

0 comments on commit 12a2145

Please sign in to comment.