git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 09/10] meson: generate articles

From
Patrick Steinhardt <ps@pks.im>
Date
Dec 13, 2024, 08:48 UTC
Message-ID
<20241213-b4-pks-meson-docs-v1-9-0c7895952cd3@pks.im>
In-Reply-To
<20241213-b4-pks-meson-docs-v1-0-0c7895952cd3@pks.im>

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 <ps@pks.im>
---
 Documentation/howto/meson.build     | 62 ++++++++++++++++++++++++++++++++++
 Documentation/meson.build           | 36 ++++++++++++++++++++
 Documentation/technical/meson.build | 66 +++++++++++++++++++++++++++++++++++++
 3 files changed, 164 insertions(+)
diff --git a/Documentation/howto/meson.build b/Documentation/howto/meson.build
new file mode 100644
index 0000000000000000000000000000000000000000..c023c104161e61ca0399b5390d59e20343746621
--- /dev/null
+++ b/Documentation/howto/meson.build
@@ -0,0 +1,62 @@
+howto_sources = [
+  'coordinate-embargoed-releases.txt',
+  'keep-canonical-history-correct.txt',
+  'maintain-git.txt',
+  'new-command.txt',
+  'rebase-from-internal-branch.txt',
+  'rebuild-from-update-hook.txt',
+  'recover-corrupted-blob-object.txt',
+  'recover-corrupted-object-harder.txt',
+  'revert-a-faulty-merge.txt',
+  'revert-branch-rebase.txt',
+  'separating-topic-branches.txt',
+  'setup-git-server-over-http.txt',
+  'update-hook-example.txt',
+  'use-git-daemon.txt',
+  'using-merge-subtree.txt',
+  'using-signed-tag-in-pull-request.txt',
+]
+
+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.txt',
+)
+
+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: [
+      find_program('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
diff --git a/Documentation/meson.build b/Documentation/meson.build
index 1fdc6a61eb04707d7c4b7aabb412b32ddc517dc7..1dd84af2d6bcf3214cfa1ec78c00359f64040fca 100644
--- a/Documentation/meson.build
+++ b/Documentation/meson.build
@@ -411,4 +411,40 @@ if get_option('docs').contains('html')
     install: true,
     install_dir: get_option('datadir') / 'doc/git-doc',
   )
+
+  articles = [
+    'DecisionMaking.txt',
+    'MyFirstContribution.txt',
+    'MyFirstObjectWalk.txt',
+    'ReviewingGuidelines.txt',
+    'SubmittingPatches',
+    'ToolsForGit.txt',
+    'git-bisect-lk2009.txt',
+    'git-tools.txt',
+  ]
+
+  foreach article : articles
+    custom_target(
+      command: asciidoc_common_options + [
+        '--backend=' + asciidoc_html,
+        '--out-file=@OUTPUT@',
+        '@INPUT@',
+      ],
+      input: article,
+      output: fs.stem(article) + '.html',
+      depends: documentation_deps,
+      install: true,
+      install_dir: get_option('datadir') / 'doc/git-doc',
+    )
+  endforeach
+
+  asciidoc_html_options = asciidoc_common_options + [
+    '--backend=' + asciidoc_html,
+    '--out-file=@OUTPUT@',
+    '--attribute', 'git-relative-html-prefix=../',
+    '@INPUT@',
+  ]
+
+  subdir('howto')
+  subdir('technical')
 endif
diff --git a/Documentation/technical/meson.build b/Documentation/technical/meson.build
new file mode 100644
index 0000000000000000000000000000000000000000..21dfb8b5c9d93490f16c24bab1d49631e0395571
--- /dev/null
+++ b/Documentation/technical/meson.build
@@ -0,0 +1,66 @@
+api_docs = [
+  'api-error-handling.txt',
+  'api-merge.txt',
+  'api-parse-options.txt',
+  'api-simple-ipc.txt',
+  'api-trace2.txt',
+]
+
+articles = [
+  'bitmap-format.txt',
+  'build-systems.txt',
+  'bundle-uri.txt',
+  'commit-graph.txt',
+  'directory-rename-detection.txt',
+  'hash-function-transition.txt',
+  'long-running-process-protocol.txt',
+  'multi-pack-index.txt',
+  'packfile-uri.txt',
+  'pack-heuristics.txt',
+  'parallel-checkout.txt',
+  'partial-clone.txt',
+  'platform-support.txt',
+  'racy-git.txt',
+  'reftable.txt',
+  'remembering-renames.txt',
+  'repository-version.txt',
+  'rerere.txt',
+  'scalar.txt',
+  'send-pack-pipeline.txt',
+  'shallow.txt',
+  'sparse-checkout.txt',
+  'sparse-index.txt',
+  'trivial-merge.txt',
+  'unit-tests.txt',
+]
+
+api_index = custom_target(
+  command: [
+    shell,
+    meson.current_source_dir() / 'api-index.sh',
+    meson.current_source_dir(),
+    '@OUTPUT@',
+  ],
+  env: script_environment,
+  input: api_docs,
+  output: 'api-index.txt',
+)
+
+custom_target(
+  command: asciidoc_html_options,
+  input: api_index,
+  output: 'api-index.html',
+  depends: documentation_deps,
+  install: true,
+  install_dir: get_option('datadir') / 'doc/git-doc/technical',
+)
+
+foreach article : api_docs + articles
+  custom_target(
+    command: asciidoc_html_options,
+    input: article,
+    output: fs.stem(article) + '.html',
+    install: true,
+    install_dir: get_option('datadir') / 'doc/git-doc/technical',
+  )
+endforeach
-- 
2.47.1.668.gf74b3f243a.dirty
Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 11 of 33 in “meson: wire up missing HTML documentation”
  1. 00/10 meson: wire up missing HTML documentationPatrick Steinhardt, Dec 13, 2024
  2. 01/10 meson: wire up support for AsciiDoctorPatrick Steinhardt, Dec 13, 2024
  3. 02/10 meson: properly wire up dependencies for our docsPatrick Steinhardt, Dec 13, 2024
  4. 03/10 meson: fix generation of merge toolsPatrick Steinhardt, Dec 13, 2024
  5. 04/10 meson: generate HTML pages for all man page categoriesPatrick Steinhardt, Dec 13, 2024
  6. Toon ClaesDec 23, 2024
  7. Patrick SteinhardtDec 27, 2024
  8. 06/10 meson: generate user manualPatrick Steinhardt, Dec 13, 2024
  9. 05/10 Documentation: inline user-manual.confPatrick Steinhardt, Dec 13, 2024
  10. 07/10 Documentation: refactor "api-index.sh" for out-of-tree buildsPatrick Steinhardt, Dec 13, 2024
  11. 09/10 meson: generate articlesPatrick Steinhardt, Dec 13, 2024
  12. 08/10 Documentation: refactor "howto-index.sh" for out-of-tree buildsPatrick Steinhardt, Dec 13, 2024
  13. 10/10 meson: install static files for HTML documentationPatrick Steinhardt, Dec 13, 2024
  14. Toon ClaesDec 23, 2024
  15. Patrick SteinhardtDec 27, 2024
  16. Toon ClaesJan 3, 2025
  17. Patrick SteinhardtJan 3, 2025
  18. 00/12 meson: wire up missing HTML documentationPatrick Steinhardt, Dec 27, 2024
  19. 01/12 meson: wire up support for AsciiDoctorPatrick Steinhardt, Dec 27, 2024
  20. 02/12 meson: properly wire up dependencies for our docsPatrick Steinhardt, Dec 27, 2024
  21. 03/12 meson: fix generation of merge toolsPatrick Steinhardt, Dec 27, 2024
  22. 04/12 meson: generate HTML pages for all man page categoriesPatrick Steinhardt, Dec 27, 2024
  23. 05/12 Documentation: inline user-manual.confPatrick Steinhardt, Dec 27, 2024
  24. 06/12 meson: generate user manualPatrick Steinhardt, Dec 27, 2024
  25. 07/12 Documentation: refactor "api-index.sh" for out-of-tree buildsPatrick Steinhardt, Dec 27, 2024
  26. 08/12 Documentation: refactor "howto-index.sh" for out-of-tree buildsPatrick Steinhardt, Dec 27, 2024
  27. 09/12 meson: generate articlesPatrick Steinhardt, Dec 27, 2024
  28. 10/12 meson: install static files for HTML documentationPatrick Steinhardt, Dec 27, 2024
  29. 11/12 t/Makefile: make "check-meson" work with DashPatrick Steinhardt, Dec 27, 2024
  30. Jonathan NiederJan 2, 2025
  31. Junio C HamanoJan 2, 2025
  32. Junio C HamanoJan 3, 2025
  33. 12/12 Documentation: wire up sanity checks for MesonPatrick Steinhardt, Dec 27, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.