Skip to content

Commit 736958b

Browse files
pks-tgitster
authored andcommitted
meson: generate articles
While the Meson build system already knows to generate man pages and our user manual, it does not yet generate the random assortment of articles that we have. Plug this gap. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 88b1a93 commit 736958b

File tree

3 files changed

+164
-0
lines changed

3 files changed

+164
-0
lines changed

Documentation/howto/meson.build

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
howto_sources = [
2+
'coordinate-embargoed-releases.txt',
3+
'keep-canonical-history-correct.txt',
4+
'maintain-git.txt',
5+
'new-command.txt',
6+
'rebase-from-internal-branch.txt',
7+
'rebuild-from-update-hook.txt',
8+
'recover-corrupted-blob-object.txt',
9+
'recover-corrupted-object-harder.txt',
10+
'revert-a-faulty-merge.txt',
11+
'revert-branch-rebase.txt',
12+
'separating-topic-branches.txt',
13+
'setup-git-server-over-http.txt',
14+
'update-hook-example.txt',
15+
'use-git-daemon.txt',
16+
'using-merge-subtree.txt',
17+
'using-signed-tag-in-pull-request.txt',
18+
]
19+
20+
howto_index = custom_target(
21+
command: [
22+
shell,
23+
meson.current_source_dir() / 'howto-index.sh',
24+
'@INPUT@',
25+
],
26+
env: script_environment,
27+
capture: true,
28+
input: howto_sources,
29+
output: 'howto-index.txt',
30+
)
31+
32+
custom_target(
33+
command: asciidoc_html_options,
34+
input: howto_index,
35+
output: 'howto-index.html',
36+
depends: documentation_deps,
37+
install: true,
38+
install_dir: get_option('datadir') / 'doc/git-doc',
39+
)
40+
41+
foreach howto : howto_sources
42+
howto_stripped = custom_target(
43+
command: [
44+
find_program('sed'),
45+
'-e',
46+
'1,/^$/d',
47+
'@INPUT@',
48+
],
49+
input: howto,
50+
output: fs.stem(howto) + '.stripped',
51+
capture: true,
52+
)
53+
54+
custom_target(
55+
command: asciidoc_html_options,
56+
input: howto_stripped,
57+
output: fs.stem(howto_stripped.full_path()) + '.html',
58+
depends: documentation_deps,
59+
install: true,
60+
install_dir: get_option('datadir') / 'doc/git-doc/howto',
61+
)
62+
endforeach

Documentation/meson.build

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,4 +411,40 @@ if get_option('docs').contains('html')
411411
install: true,
412412
install_dir: get_option('datadir') / 'doc/git-doc',
413413
)
414+
415+
articles = [
416+
'DecisionMaking.txt',
417+
'MyFirstContribution.txt',
418+
'MyFirstObjectWalk.txt',
419+
'ReviewingGuidelines.txt',
420+
'SubmittingPatches',
421+
'ToolsForGit.txt',
422+
'git-bisect-lk2009.txt',
423+
'git-tools.txt',
424+
]
425+
426+
foreach article : articles
427+
custom_target(
428+
command: asciidoc_common_options + [
429+
'--backend=' + asciidoc_html,
430+
'--out-file=@OUTPUT@',
431+
'@INPUT@',
432+
],
433+
input: article,
434+
output: fs.stem(article) + '.html',
435+
depends: documentation_deps,
436+
install: true,
437+
install_dir: get_option('datadir') / 'doc/git-doc',
438+
)
439+
endforeach
440+
441+
asciidoc_html_options = asciidoc_common_options + [
442+
'--backend=' + asciidoc_html,
443+
'--out-file=@OUTPUT@',
444+
'--attribute', 'git-relative-html-prefix=../',
445+
'@INPUT@',
446+
]
447+
448+
subdir('howto')
449+
subdir('technical')
414450
endif
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
api_docs = [
2+
'api-error-handling.txt',
3+
'api-merge.txt',
4+
'api-parse-options.txt',
5+
'api-simple-ipc.txt',
6+
'api-trace2.txt',
7+
]
8+
9+
articles = [
10+
'bitmap-format.txt',
11+
'build-systems.txt',
12+
'bundle-uri.txt',
13+
'commit-graph.txt',
14+
'directory-rename-detection.txt',
15+
'hash-function-transition.txt',
16+
'long-running-process-protocol.txt',
17+
'multi-pack-index.txt',
18+
'packfile-uri.txt',
19+
'pack-heuristics.txt',
20+
'parallel-checkout.txt',
21+
'partial-clone.txt',
22+
'platform-support.txt',
23+
'racy-git.txt',
24+
'reftable.txt',
25+
'remembering-renames.txt',
26+
'repository-version.txt',
27+
'rerere.txt',
28+
'scalar.txt',
29+
'send-pack-pipeline.txt',
30+
'shallow.txt',
31+
'sparse-checkout.txt',
32+
'sparse-index.txt',
33+
'trivial-merge.txt',
34+
'unit-tests.txt',
35+
]
36+
37+
api_index = custom_target(
38+
command: [
39+
shell,
40+
meson.current_source_dir() / 'api-index.sh',
41+
meson.current_source_dir(),
42+
'@OUTPUT@',
43+
],
44+
env: script_environment,
45+
input: api_docs,
46+
output: 'api-index.txt',
47+
)
48+
49+
custom_target(
50+
command: asciidoc_html_options,
51+
input: api_index,
52+
output: 'api-index.html',
53+
depends: documentation_deps,
54+
install: true,
55+
install_dir: get_option('datadir') / 'doc/git-doc/technical',
56+
)
57+
58+
foreach article : api_docs + articles
59+
custom_target(
60+
command: asciidoc_html_options,
61+
input: article,
62+
output: fs.stem(article) + '.html',
63+
install: true,
64+
install_dir: get_option('datadir') / 'doc/git-doc/technical',
65+
)
66+
endforeach

0 commit comments

Comments
 (0)