summaryrefslogtreecommitdiff
path: root/Documentation/howto/meson.build
blob: 81000028c08ee67ac056ec06d8c7b5129adf3d3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
howto_sources = [
  'coordinate-embargoed-releases.adoc',
  'keep-canonical-history-correct.adoc',
  'maintain-git.adoc',
  'new-command.adoc',
  'rebase-from-internal-branch.adoc',
  'rebuild-from-update-hook.adoc',
  'recover-corrupted-blob-object.adoc',
  'recover-corrupted-object-harder.adoc',
  'revert-a-faulty-merge.adoc',
  'revert-branch-rebase.adoc',
  'separating-topic-branches.adoc',
  'setup-git-server-over-http.adoc',
  'update-hook-example.adoc',
  'use-git-daemon.adoc',
  'using-merge-subtree.adoc',
  'using-signed-tag-in-pull-request.adoc',
]

howto_index = custom_target(
  command: [
    shell,
    meson.current_source_dir() / 'howto-index.sh',
    '@INPUT@',
  ],
  env: script_environment,
  capture: true,
  input: howto_sources,
  output: 'howto-index.adoc',
)

custom_target(
  command: asciidoc_html_options,
  input: howto_index,
  output: 'howto-index.html',
  depends: documentation_deps,
  install: true,
  install_dir: get_option('datadir') / 'doc/git-doc',
)

foreach howto : howto_sources
  howto_stripped = custom_target(
    command: [
      sed,
      '-e',
      '1,/^$/d',
      '@INPUT@',
    ],
    input: howto,
    output: fs.stem(howto) + '.stripped',
    capture: true,
  )

  custom_target(
    command: asciidoc_html_options,
    input: howto_stripped,
    output: fs.stem(howto_stripped.full_path()) + '.html',
    depends: documentation_deps,
    install: true,
    install_dir: get_option('datadir') / 'doc/git-doc/howto',
  )
endforeach