From af9e78940e8c0e21d645fd1f1026c1d9755d75ea Mon Sep 17 00:00:00 2001 From: Mark Mentovai Date: Wed, 18 Mar 2015 17:13:22 -0400 Subject: [PATCH] Allow man pages to link to each other R=rsesek@chromium.org Review URL: https://codereview.chromium.org/1018023002 --- doc/asciidoc.conf | 22 ++++++++++++++++++++++ doc/generate_asciidoc.sh | 1 + handler/mac/crashpad_handler.ad | 11 ++++++----- tools/generate_dump.ad | 2 +- tools/mac/catch_exception_tool.ad | 4 ++-- tools/mac/exception_port_tool.ad | 4 ++-- tools/mac/on_demand_service_tool.ad | 8 ++++---- tools/mac/run_with_crashpad.ad | 6 +++--- 8 files changed, 41 insertions(+), 17 deletions(-) diff --git a/doc/asciidoc.conf b/doc/asciidoc.conf index 85df624f..ab330b34 100644 --- a/doc/asciidoc.conf +++ b/doc/asciidoc.conf @@ -29,3 +29,25 @@ ifdef::basebackend-html[] {mansource=Version} {manversion={revnumber}}{basebackend-xhtml11?
}{basebackend-xhtml11=
} Last updated {revdate} endif::basebackend-html[] + +# The man_link macro was inspired by git’s linkgit macro. See +# https://github.com/git/git/blob/master/Documentation/asciidoc.conf. +ifdef::doctype-manpage[] + +[macros] +(?su)[\\]?(?Pman_link):(?P\S*?)\[(?P.*?)\]= + +ifdef::backend-docbook[] +[man_link-inlinemacro] +{0%{target}} +{0#} +{0#{target}{0}} +{0#} +endif::backend-docbook[] + +ifdef::basebackend-html[] +[man_link-inlinemacro] +{target}{0?({0})} +endif::basebackend-html[] + +endif::doctype-manpage[] diff --git a/doc/generate_asciidoc.sh b/doc/generate_asciidoc.sh index 55113b65..f19bbb47 100755 --- a/doc/generate_asciidoc.sh +++ b/doc/generate_asciidoc.sh @@ -88,6 +88,7 @@ for input in \ --attribute manversion="${version}" \ --attribute manmanual="Crashpad Manual" \ --attribute revdate="${git_date}" \ + --asciidoc-opts=--conf-file=doc/asciidoc.conf \ --doctype manpage \ --format manpage \ --destination-dir "${output_dir}/man" \ diff --git a/handler/mac/crashpad_handler.ad b/handler/mac/crashpad_handler.ad index 56c65119..e337b3c7 100644 --- a/handler/mac/crashpad_handler.ad +++ b/handler/mac/crashpad_handler.ad @@ -43,8 +43,9 @@ senders, the server exits after allowing any upload in progress to complete. It is not normally appropriate to invoke this program directly. Usually, it will be invoked by a Crashpad client using the Crashpad client library. Arbitrary -programs may be run with a Crashpad handler by using run_with_crashpad(1) to -establish the Crashpad client environment before running a program. +programs may be run with a Crashpad handler by using +man_link:run_with_crashpad[1] to establish the Crashpad client environment +before running a program. == Options *--annotation*='KEY=VALUE':: @@ -99,8 +100,8 @@ Failure, with a message printed to the standard error stream. == See Also -catch_exception_tool(1), -generate_dump(1), -run_with_crashpad(1) +man_link:catch_exception_tool[1], +man_link:generate_dump[1], +man_link:run_with_crashpad[1] include::../../doc/man_footer.ad[] diff --git a/tools/generate_dump.ad b/tools/generate_dump.ad index 8c6d23b3..342c72d0 100644 --- a/tools/generate_dump.ad +++ b/tools/generate_dump.ad @@ -91,6 +91,6 @@ Failure, with a message printed to the standard error stream. == See Also -catch_exception_tool(1) +man_link:catch_exception_tool[1] include::../doc/man_footer.ad[] diff --git a/tools/mac/catch_exception_tool.ad b/tools/mac/catch_exception_tool.ad index 0d9520ce..2d559029 100644 --- a/tools/mac/catch_exception_tool.ad +++ b/tools/mac/catch_exception_tool.ad @@ -111,7 +111,7 @@ Failure, with a message printed to the standard error stream. == See Also -exception_port_tool(1), -on_demand_service_tool(1) +man_link:exception_port_tool[1], +man_link:on_demand_service_tool[1] include::../../doc/man_footer.ad[] diff --git a/tools/mac/exception_port_tool.ad b/tools/mac/exception_port_tool.ad index 3cd8e9c9..e32d7197 100644 --- a/tools/mac/exception_port_tool.ad +++ b/tools/mac/exception_port_tool.ad @@ -182,7 +182,7 @@ The program specified by 'COMMAND' could not be found. == See Also -catch_exception_tool(1), -on_demand_service_tool(1) +man_link:catch_exception_tool[1], +man_link:on_demand_service_tool[1] include::../../doc/man_footer.ad[] diff --git a/tools/mac/on_demand_service_tool.ad b/tools/mac/on_demand_service_tool.ad index 54eb3693..5a04482a 100644 --- a/tools/mac/on_demand_service_tool.ad +++ b/tools/mac/on_demand_service_tool.ad @@ -68,8 +68,8 @@ Output version information and exit. == Examples -Registers an on-demand server that will execute catch_exception_tool(1) when a -Mach message is sent to a Mach port obtained from the bootstrap server by +Registers an on-demand server that will execute man_link:catch_exception_tool[1] +when a Mach message is sent to a Mach port obtained from the bootstrap server by looking up the name +svc+: [subs="quotes"] ---- @@ -95,8 +95,8 @@ Failure, with a message printed to the standard error stream. == See Also -exception_port_tool(1), +man_link:catch_exception_tool[1], +man_link:exception_port_tool[1], launchctl(1) -on_demand_service_tool(1) include::../../doc/man_footer.ad[] diff --git a/tools/mac/run_with_crashpad.ad b/tools/mac/run_with_crashpad.ad index 51461938..7d395455 100644 --- a/tools/mac/run_with_crashpad.ad +++ b/tools/mac/run_with_crashpad.ad @@ -80,7 +80,7 @@ Illegal instruction: 4 ---- Starts a Crashpad exception handler server at a nonstandard path, and runs -exception_port_tool(1) to show the task-level exception ports. +man_link:exception_port_tool[1] to show the task-level exception ports. [subs="quotes"] ---- $ *run_with_crashpad --handler=/tmp/crashpad_handler \ @@ -106,7 +106,7 @@ The program specified by 'COMMAND' could not be found. == See Also -crashpad_handler(8), -exception_port_tool(1) +man_link:crashpad_handler[8], +man_link:exception_port_tool[1] include::../../doc/man_footer.ad[]