Skip to content

Commit eb7d778

Browse files
committed
Rename doc/manual{src -> source}
This is needed to avoid this mesonbuild/meson#13774 when we go back to making our subproject directory `src`.
1 parent d5c4595 commit eb7d778

File tree

221 files changed

+75
-74
lines changed

Some content is hidden

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

221 files changed

+75
-74
lines changed

.github/ISSUE_TEMPLATE/missing_documentation.md

+1-1

.github/labeler.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
- any-glob-to-any-file: "CONTRIBUTING.md"
1010
- any-glob-to-any-file: ".github/ISSUE_TEMPLATE/*"
1111
- any-glob-to-any-file: ".github/PULL_REQUEST_TEMPLATE.md"
12-
- any-glob-to-any-file: "doc/manual/src/contributing/**"
12+
- any-glob-to-any-file: "doc/manual/source/contributing/**"
1313

1414
"documentation":
1515
- changed-files:

.gitignore

+11-11
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ perl/Makefile.config
2323
/doc/manual/conf-file.json
2424
/doc/manual/language.json
2525
/doc/manual/xp-features.json
26-
/doc/manual/src/SUMMARY.md
27-
/doc/manual/src/SUMMARY-rl-next.md
28-
/doc/manual/src/store/types/*
29-
!/doc/manual/src/store/types/index.md.in
30-
/doc/manual/src/command-ref/new-cli
31-
/doc/manual/src/command-ref/conf-file.md
32-
/doc/manual/src/command-ref/experimental-features-shortlist.md
33-
/doc/manual/src/contributing/experimental-feature-descriptions.md
34-
/doc/manual/src/language/builtins.md
35-
/doc/manual/src/language/builtin-constants.md
36-
/doc/manual/src/release-notes/rl-next.md
26+
/doc/manual/source/SUMMARY.md
27+
/doc/manual/source/SUMMARY-rl-next.md
28+
/doc/manual/source/store/types/*
29+
!/doc/manual/source/store/types/index.md.in
30+
/doc/manual/source/command-ref/new-cli
31+
/doc/manual/source/command-ref/conf-file.md
32+
/doc/manual/source/command-ref/experimental-features-shortlist.md
33+
/doc/manual/source/contributing/experimental-feature-descriptions.md
34+
/doc/manual/source/language/builtins.md
35+
/doc/manual/source/language/builtin-constants.md
36+
/doc/manual/source/release-notes/rl-next.md
3737

3838
# /scripts/
3939
/scripts/nix-profile.sh

CONTRIBUTING.md

+2-2

HACKING.md

+1-1

doc/manual/book.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
[book]
22
title = "Nix Reference Manual"
3+
src = "source"
34

45
[output.html]
56
additional-css = ["custom.css"]
67
additional-js = ["redirects.js"]
78
edit-url-template = "https://github.com/NixOS/nix/tree/master/doc/manual/{path}"
89
git-repository-url = "https://github.com/NixOS/nix"
910

10-
# Handles replacing @docroot@ with a path to ./src relative to that markdown file,
11+
# Handles replacing @docroot@ with a path to ./source relative to that markdown file,
1112
# {{#include handlebars}}, and the @generated@ syntax used within these. it mostly
1213
# but not entirely replaces the links preprocessor (which we cannot simply use due
1314
# to @generated@ files living in a different directory to make meson happy). we do

doc/manual/generate-store-types.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ let
2121

2222
"index.md" = replaceStrings
2323
[ "@store-types@" ] [ index ]
24-
(readFile ./src/store/types/index.md.in);
24+
(readFile ./source/store/types/index.md.in);
2525

2626
tableOfContents =
2727
let

doc/manual/local.mk

+28-28
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
doc_nix = $(nix_PATH)
55

66
MANUAL_SRCS := \
7-
$(call rwildcard, $(d)/src, *.md) \
8-
$(call rwildcard, $(d)/src, */*.md)
7+
$(call rwildcard, $(d)/source, *.md) \
8+
$(call rwildcard, $(d)/source, */*.md)
99

1010
man-pages := $(foreach n, \
1111
nix-env.1 nix-store.1 \
@@ -18,11 +18,11 @@ man-pages := $(foreach n, \
1818
, $(d)/$(n))
1919

2020
# man pages for subcommands
21-
# convert from `$(d)/src/command-ref/nix-{1}/{2}.md` to `$(d)/nix-{1}-{2}.1`
21+
# convert from `$(d)/source/command-ref/nix-{1}/{2}.md` to `$(d)/nix-{1}-{2}.1`
2222
# FIXME: unify with how nix3-cli man pages are generated
2323
man-pages += $(foreach subcommand, \
24-
$(filter-out %opt-common.md %env-common.md, $(wildcard $(d)/src/command-ref/nix-*/*.md)), \
25-
$(d)/$(subst /,-,$(subst $(d)/src/command-ref/,,$(subst .md,.1,$(subcommand)))))
24+
$(filter-out %opt-common.md %env-common.md, $(wildcard $(d)/source/command-ref/nix-*/*.md)), \
25+
$(d)/$(subst /,-,$(subst $(d)/source/command-ref/,,$(subst .md,.1,$(subcommand)))))
2626

2727
clean-files += $(d)/*.1 $(d)/*.5 $(d)/*.8
2828

@@ -49,11 +49,11 @@ define process-includes
4949
done < <(grep '{{#include' $(1))
5050
endef
5151

52-
$(d)/nix-env-%.1: $(d)/src/command-ref/nix-env/%.md
52+
$(d)/nix-env-%.1: $(d)/source/command-ref/nix-env/%.md
5353
@printf "Title: %s\n\n" "$(subst nix-env-,nix-env --,$$(basename "$@" .1))" > $^.tmp
5454
$(render-subcommand)
5555

56-
$(d)/nix-store-%.1: $(d)/src/command-ref/nix-store/%.md
56+
$(d)/nix-store-%.1: $(d)/source/command-ref/nix-store/%.md
5757
@printf -- 'Title: %s\n\n' "$(subst nix-store-,nix-store --,$$(basename "$@" .1))" > $^.tmp
5858
$(render-subcommand)
5959

@@ -69,50 +69,50 @@ define render-subcommand
6969
endef
7070

7171

72-
$(d)/%.1: $(d)/src/command-ref/%.md
72+
$(d)/%.1: $(d)/source/command-ref/%.md
7373
@printf "Title: %s\n\n" "$$(basename $@ .1)" > $^.tmp
7474
@cat $^ >> $^.tmp
7575
@$(call process-includes,$^,$^.tmp)
7676
$(trace-gen) lowdown -sT man --nroff-nolinks -M section=1 $^.tmp -o $@
7777
@rm $^.tmp
7878

79-
$(d)/%.8: $(d)/src/command-ref/%.md
79+
$(d)/%.8: $(d)/source/command-ref/%.md
8080
@printf "Title: %s\n\n" "$$(basename $@ .8)" > $^.tmp
8181
@cat $^ >> $^.tmp
8282
$(trace-gen) lowdown -sT man --nroff-nolinks -M section=8 $^.tmp -o $@
8383
@rm $^.tmp
8484

85-
$(d)/nix.conf.5: $(d)/src/command-ref/conf-file.md
85+
$(d)/nix.conf.5: $(d)/source/command-ref/conf-file.md
8686
@printf "Title: %s\n\n" "$$(basename $@ .5)" > $^.tmp
8787
@cat $^ >> $^.tmp
8888
@$(call process-includes,$^,$^.tmp)
8989
$(trace-gen) lowdown -sT man --nroff-nolinks -M section=5 $^.tmp -o $@
9090
@rm $^.tmp
9191

92-
$(d)/nix-profiles.5: $(d)/src/command-ref/files/profiles.md
92+
$(d)/nix-profiles.5: $(d)/source/command-ref/files/profiles.md
9393
@printf "Title: %s\n\n" "$$(basename $@ .5)" > $^.tmp
9494
@cat $^ >> $^.tmp
9595
$(trace-gen) lowdown -sT man --nroff-nolinks -M section=5 $^.tmp -o $@
9696
@rm $^.tmp
9797

98-
$(d)/src/SUMMARY.md: $(d)/src/SUMMARY.md.in $(d)/src/SUMMARY-rl-next.md $(d)/src/store/types $(d)/src/command-ref/new-cli $(d)/src/development/experimental-feature-descriptions.md
98+
$(d)/source/SUMMARY.md: $(d)/source/SUMMARY.md.in $(d)/source/SUMMARY-rl-next.md $(d)/source/store/types $(d)/source/command-ref/new-cli $(d)/source/development/experimental-feature-descriptions.md
9999
@cp $< $@
100100
@$(call process-includes,$@,$@)
101101

102-
$(d)/src/store/types: $(d)/nix.json $(d)/utils.nix $(d)/generate-store-info.nix $(d)/generate-store-types.nix $(d)/src/store/types/index.md.in $(doc_nix)
102+
$(d)/source/store/types: $(d)/nix.json $(d)/utils.nix $(d)/generate-store-info.nix $(d)/generate-store-types.nix $(d)/source/store/types/index.md.in $(doc_nix)
103103
@# FIXME: build out of tree!
104104
@rm -rf $@.tmp
105105
$(trace-gen) $(nix-eval) --write-to $@.tmp --expr 'import doc/manual/generate-store-types.nix (builtins.fromJSON (builtins.readFile $<)).stores'
106106
@# do not destroy existing contents
107107
@mv $@.tmp/* $@/
108108

109-
$(d)/src/command-ref/new-cli: $(d)/nix.json $(d)/utils.nix $(d)/generate-manpage.nix $(d)/generate-settings.nix $(d)/generate-store-info.nix $(doc_nix)
109+
$(d)/source/command-ref/new-cli: $(d)/nix.json $(d)/utils.nix $(d)/generate-manpage.nix $(d)/generate-settings.nix $(d)/generate-store-info.nix $(doc_nix)
110110
@rm -rf $@ $@.tmp
111111
$(trace-gen) $(nix-eval) --write-to $@.tmp --expr 'import doc/manual/generate-manpage.nix true (builtins.readFile $<)'
112112
@mv $@.tmp $@
113113

114-
$(d)/src/command-ref/conf-file.md: $(d)/conf-file.json $(d)/utils.nix $(d)/generate-settings.nix $(d)/src/command-ref/conf-file-prefix.md $(d)/src/command-ref/experimental-features-shortlist.md $(doc_nix)
115-
@cat doc/manual/src/command-ref/conf-file-prefix.md > $@.tmp
114+
$(d)/source/command-ref/conf-file.md: $(d)/conf-file.json $(d)/utils.nix $(d)/generate-settings.nix $(d)/source/command-ref/conf-file-prefix.md $(d)/source/command-ref/experimental-features-shortlist.md $(doc_nix)
115+
@cat doc/manual/source/command-ref/conf-file-prefix.md > $@.tmp
116116
$(trace-gen) $(nix-eval) --expr 'import doc/manual/generate-settings.nix { prefix = "conf"; } (builtins.fromJSON (builtins.readFile $<))' >> $@.tmp;
117117
@mv $@.tmp $@
118118

@@ -124,12 +124,12 @@ $(d)/conf-file.json: $(doc_nix)
124124
$(trace-gen) $(dummy-env) $(doc_nix) config show --json --experimental-features nix-command > $@.tmp
125125
@mv $@.tmp $@
126126

127-
$(d)/src/development/experimental-feature-descriptions.md: $(d)/xp-features.json $(d)/utils.nix $(d)/generate-xp-features.nix $(doc_nix)
127+
$(d)/source/development/experimental-feature-descriptions.md: $(d)/xp-features.json $(d)/utils.nix $(d)/generate-xp-features.nix $(doc_nix)
128128
@rm -rf $@ $@.tmp
129129
$(trace-gen) $(nix-eval) --write-to $@.tmp --expr 'import doc/manual/generate-xp-features.nix (builtins.fromJSON (builtins.readFile $<))'
130130
@mv $@.tmp $@
131131

132-
$(d)/src/command-ref/experimental-features-shortlist.md: $(d)/xp-features.json $(d)/utils.nix $(d)/generate-xp-features-shortlist.nix $(doc_nix)
132+
$(d)/source/command-ref/experimental-features-shortlist.md: $(d)/xp-features.json $(d)/utils.nix $(d)/generate-xp-features-shortlist.nix $(doc_nix)
133133
@rm -rf $@ $@.tmp
134134
$(trace-gen) $(nix-eval) --write-to $@.tmp --expr 'import doc/manual/generate-xp-features-shortlist.nix (builtins.fromJSON (builtins.readFile $<))'
135135
@mv $@.tmp $@
@@ -138,18 +138,18 @@ $(d)/xp-features.json: $(doc_nix)
138138
$(trace-gen) $(dummy-env) $(doc_nix) __dump-xp-features > $@.tmp
139139
@mv $@.tmp $@
140140

141-
$(d)/src/language/builtins.md: $(d)/language.json $(d)/generate-builtins.nix $(d)/src/language/builtins-prefix.md $(doc_nix)
142-
@cat doc/manual/src/language/builtins-prefix.md > $@.tmp
141+
$(d)/source/language/builtins.md: $(d)/language.json $(d)/generate-builtins.nix $(d)/source/language/builtins-prefix.md $(doc_nix)
142+
@cat doc/manual/source/language/builtins-prefix.md > $@.tmp
143143
$(trace-gen) $(nix-eval) --expr 'import doc/manual/generate-builtins.nix (builtins.fromJSON (builtins.readFile $<))' >> $@.tmp;
144-
@cat doc/manual/src/language/builtins-suffix.md >> $@.tmp
144+
@cat doc/manual/source/language/builtins-suffix.md >> $@.tmp
145145
@mv $@.tmp $@
146146

147147
$(d)/language.json: $(doc_nix)
148148
$(trace-gen) $(dummy-env) $(doc_nix) __dump-language > $@.tmp
149149
@mv $@.tmp $@
150150

151151
# Generate "Upcoming release" notes (or clear it and remove from menu)
152-
$(d)/src/release-notes/rl-next.md: $(d)/rl-next $(d)/rl-next/*
152+
$(d)/source/release-notes/rl-next.md: $(d)/rl-next $(d)/rl-next/*
153153
@if type -p changelog-d > /dev/null; then \
154154
echo " GEN " $@; \
155155
changelog-d doc/manual/rl-next > $@; \
@@ -158,7 +158,7 @@ $(d)/src/release-notes/rl-next.md: $(d)/rl-next $(d)/rl-next/*
158158
true > $@; \
159159
fi
160160

161-
$(d)/src/SUMMARY-rl-next.md: $(d)/src/release-notes/rl-next.md
161+
$(d)/source/SUMMARY-rl-next.md: $(d)/source/release-notes/rl-next.md
162162
$(trace-gen) true
163163
@if [ -s $< ]; then \
164164
echo ' - [Upcoming release](release-notes/rl-next.md)' > $@; \
@@ -194,9 +194,9 @@ $(mandir)/man1/nix3-manpages: doc/manual/generated/man1/nix3-manpages
194194
@mkdir -p $(DESTDIR)$$(dirname $@)
195195
$(trace-install) install -m 0644 $$(dirname $<)/* $(DESTDIR)$$(dirname $@)
196196

197-
doc/manual/generated/man1/nix3-manpages: $(d)/src/command-ref/new-cli
197+
doc/manual/generated/man1/nix3-manpages: $(d)/source/command-ref/new-cli
198198
@mkdir -p $(DESTDIR)$$(dirname $@)
199-
$(trace-gen) for i in doc/manual/src/command-ref/new-cli/*.md; do \
199+
$(trace-gen) for i in doc/manual/source/command-ref/new-cli/*.md; do \
200200
name=$$(basename $$i .md); \
201201
tmpFile=$$(mktemp); \
202202
if [[ $$name = SUMMARY ]]; then continue; fi; \
@@ -211,22 +211,22 @@ doc/manual/generated/man1/nix3-manpages: $(d)/src/command-ref/new-cli
211211
# `@docroot@` is to be preserved for documenting the mechanism
212212
# FIXME: maybe contributing guides should live right next to the code
213213
# instead of in the manual
214-
$(docdir)/manual/index.html: $(MANUAL_SRCS) $(d)/book.toml $(d)/anchors.jq $(d)/custom.css $(d)/src/SUMMARY.md $(d)/src/store/types $(d)/src/command-ref/new-cli $(d)/src/development/experimental-feature-descriptions.md $(d)/src/command-ref/conf-file.md $(d)/src/language/builtins.md $(d)/src/release-notes/rl-next.md $(d)/src/figures $(d)/src/favicon.png $(d)/src/favicon.svg
214+
$(docdir)/manual/index.html: $(MANUAL_SRCS) $(d)/book.toml $(d)/anchors.jq $(d)/custom.css $(d)/source/SUMMARY.md $(d)/source/store/types $(d)/source/command-ref/new-cli $(d)/source/development/experimental-feature-descriptions.md $(d)/source/command-ref/conf-file.md $(d)/source/language/builtins.md $(d)/source/release-notes/rl-next.md $(d)/source/figures $(d)/source/favicon.png $(d)/source/favicon.svg
215215
$(trace-gen) \
216216
tmp="$$(mktemp -d)"; \
217217
cp -r doc/manual "$$tmp"; \
218218
find "$$tmp" -name '*.md' | while read -r file; do \
219219
$(call process-includes,$$file,$$file); \
220220
done; \
221221
find "$$tmp" -name '*.md' ! -name 'documentation.md' | while read -r file; do \
222-
docroot="$$(realpath --relative-to="$$(dirname "$$file")" $$tmp/manual/src)"; \
222+
docroot="$$(realpath --relative-to="$$(dirname "$$file")" $$tmp/manual/source)"; \
223223
sed -i "s,@docroot@,$$docroot,g" "$$file"; \
224224
done; \
225225
set -euo pipefail; \
226226
( \
227227
cd "$$tmp/manual"; \
228228
RUST_LOG=warn \
229-
MDBOOK_SUBSTITUTE_SEARCH=$(d)/src \
229+
MDBOOK_SUBSTITUTE_SEARCH=$(d)/source \
230230
mdbook build -d $(DESTDIR)$(docdir)/manual.tmp 2>&1 \
231231
| { grep -Fv "because fragment resolution isn't implemented" || :; } \
232232
); \

doc/manual/meson.build

+8-8
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,16 @@ generate_manual_deps = files(
5555
)
5656

5757
# Generates types
58-
subdir('src/store')
58+
subdir('source/store')
5959
# Generates builtins.md and builtin-constants.md.
60-
subdir('src/language')
60+
subdir('source/language')
6161
# Generates new-cli pages, experimental-features-shortlist.md, and conf-file.md.
62-
subdir('src/command-ref')
62+
subdir('source/command-ref')
6363
# Generates experimental-feature-descriptions.md.
64-
subdir('src/development')
64+
subdir('source/development')
6565
# Generates rl-next-generated.md.
66-
subdir('src/release-notes')
67-
subdir('src')
66+
subdir('source/release-notes')
67+
subdir('source')
6868

6969
# Hacky way to figure out if `nix` is an `ExternalProgram` or
7070
# `Exectuable`. Only the latter can occur in custom target input lists.
@@ -82,7 +82,7 @@ manual = custom_target(
8282
'-c',
8383
'''
8484
@0@ @INPUT0@ @CURRENT_SOURCE_DIR@ > @DEPFILE@
85-
@0@ @INPUT1@ summary @2@ < @CURRENT_SOURCE_DIR@/src/SUMMARY.md.in > @2@/src/SUMMARY.md
85+
@0@ @INPUT1@ summary @2@ < @CURRENT_SOURCE_DIR@/source/SUMMARY.md.in > @2@/source/SUMMARY.md
8686
rsync -r --include='*.md' @CURRENT_SOURCE_DIR@/ @2@/
8787
(cd @2@; RUST_LOG=warn @1@ build -d @2@ 3>&2 2>&1 1>&3) | { grep -Fv "because fragment resolution isn't implemented" || :; } 3>&2 2>&1 1>&3
8888
rm -rf @2@/manual
@@ -117,7 +117,7 @@ manual = custom_target(
117117
depfile : 'manual.d',
118118
env : {
119119
'RUST_LOG': 'info',
120-
'MDBOOK_SUBSTITUTE_SEARCH': meson.current_build_dir() / 'src',
120+
'MDBOOK_SUBSTITUTE_SEARCH': meson.current_build_dir() / 'source',
121121
},
122122
)
123123
manual_html = manual[0]

doc/manual/redirects.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// redirect rules for URL fragments (client-side) to prevent link rot.
22
// this must be done on the client side, as web servers do not see the fragment part of the URL.
33
// it will only work with JavaScript enabled in the browser, but this is the best we can do here.
4-
// see src/_redirects for path redirects (server-side)
4+
// see source/_redirects for path redirects (server-side)
55

66
// redirects are declared as follows:
77
// each entry has as its key a path matching the requested URL path, relative to the mdBook document root.
File renamed without changes.
File renamed without changes.

doc/manual/src/development/documentation.md doc/manual/source/development/documentation.md

+2-2
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

doc/manual/substitute.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def main() -> None:
8080
if len(sys.argv) > 1 and sys.argv[1] == 'summary':
8181
print(do_include(
8282
sys.stdin.read(),
83-
Path('src/SUMMARY.md'),
83+
Path('source/SUMMARY.md'),
8484
Path(sys.argv[2]).resolve(),
8585
search_path))
8686
return
@@ -92,7 +92,7 @@ def main() -> None:
9292

9393
context, book = json.load(sys.stdin)
9494

95-
# book_root is the directory where book contents leave (ie, src/)
95+
# book_root is the directory where book contents leave (ie, source/)
9696
book_root = Path(context['root']) / context['config']['book']['src']
9797

9898
# Find @var@ in all parts of our recursive book structure.

0 commit comments

Comments
 (0)