doc: Check in the man page index instead of generating it

The generated page’s benefit-to-complexity ratio was too low.

BUG=crashpad:138

Change-Id: I5324c33b6b7f83e973c40b256b06e25c763b23c4
Reviewed-on: https://chromium-review.googlesource.com/408268
Reviewed-by: Robert Sesek <rsesek@chromium.org>
This commit is contained in:
Mark Mentovai 2016-11-07 13:44:36 -05:00
parent 1f2a2c82c6
commit f5e869c51f
5 changed files with 39 additions and 46 deletions

View File

@ -24,7 +24,7 @@ limitations under the License.
* [Developing Crashpad](doc/developing.md): instructions for getting the source * [Developing Crashpad](doc/developing.md): instructions for getting the source
code, building, testing, and contributing to the project. code, building, testing, and contributing to the project.
* [Crashpad interface documentation](https://crashpad.chromium.org/doxygen/) * [Crashpad interface documentation](https://crashpad.chromium.org/doxygen/)
* [Crashpad tool man pages](https://crashpad.chromium.org/man/) * [Crashpad tool man pages](doc/man.md)
## Source Code ## Source Code

View File

@ -50,11 +50,15 @@ func handler(w http.ResponseWriter, r *http.Request) {
"/bug/new": bugBaseURL + "issues/entry", "/bug/new": bugBaseURL + "issues/entry",
"/doc/developing.html": masterBaseURL + "/doc/developing.md", "/doc/developing.html": masterBaseURL + "/doc/developing.md",
"/doc/status.html": masterBaseURL + "/doc/status.md", "/doc/status.html": masterBaseURL + "/doc/status.md",
"/index.html": masterBaseURL + "README.md",
"/man": masterBaseURL + "doc/man.md",
"/man/": masterBaseURL + "doc/man.md",
"/man/catch_exception_tool.html": masterBaseURL + "tools/mac/catch_exception_tool.md", "/man/catch_exception_tool.html": masterBaseURL + "tools/mac/catch_exception_tool.md",
"/man/crashpad_database_util.html": masterBaseURL + "tools/crashpad_database_util.md", "/man/crashpad_database_util.html": masterBaseURL + "tools/crashpad_database_util.md",
"/man/crashpad_handler.html": masterBaseURL + "handler/crashpad_handler.md", "/man/crashpad_handler.html": masterBaseURL + "handler/crashpad_handler.md",
"/man/exception_port_tool.html": masterBaseURL + "tools/mac/exception_port_tool.md", "/man/exception_port_tool.html": masterBaseURL + "tools/mac/exception_port_tool.md",
"/man/generate_dump.html": masterBaseURL + "tools/generate_dump.md", "/man/generate_dump.html": masterBaseURL + "tools/generate_dump.md",
"/man/index.html": masterBaseURL + "doc/man.md",
"/man/on_demand_service_tool.html": masterBaseURL + "tools/mac/on_demand_service_tool.md", "/man/on_demand_service_tool.html": masterBaseURL + "tools/mac/on_demand_service_tool.md",
"/man/run_with_crashpad.html": masterBaseURL + "tools/mac/run_with_crashpad.md", "/man/run_with_crashpad.html": masterBaseURL + "tools/mac/run_with_crashpad.md",
} }

33
doc/man.md Normal file
View File

@ -0,0 +1,33 @@
<!--
Copyright 2016 The Crashpad Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
# Man Pages
## Section 1: User Commands
* [crashpad_database_util](../tools/crashpad_database_util.md)
* [generate_dump](../tools/generate_dump.md)
### macOS-Specific
* [catch_exception_tool](../tools/mac/catch_exception_tool.md)
* [exception_port_tool](../tools/mac/exception_port_tool.md)
* [on_demand_service_tool](../tools/mac/on_demand_service_tool.md)
* [run_with_crashpad](../tools/mac/run_with_crashpad.md)
## Section 8: Dӕmons
* [crashpad_handler](../handler/crashpad_handler.md)

View File

@ -44,48 +44,3 @@ rm -f "${output_dir}/index.html"
# Ensure a favicon exists at the root since the browser will always request it. # Ensure a favicon exists at the root since the browser will always request it.
cp doc/favicon.ico "${output_dir}/" cp doc/favicon.ico "${output_dir}/"
# Create man/index.html. Do this in two steps so that the built-up list of man
# pages can be sorted according to the basename, not the entire path.
list_file=$(mktemp)
for man_path in $(find . -name '*.md' |
${sed_ext} -e 's%^\./%%' |
grep -Ev '^(README.md$|(third_party|doc)/)'); do
# These should show up in all man pages, but probably not all together in any
# other Markdown documents.
if ! (grep -q '^## Name$' "${man_path}" &&
grep -q '^## Synopsis$' "${man_path}" &&
grep -q '^## Description$' "${man_path}"); then
continue
fi
man_basename=$(${sed_ext} -e 's/\.md$//' <<< $(basename "${man_path}"))
cat >> "${list_file}" << __EOF__
<!-- ${man_basename} --><a href="https://chromium.googlesource.com/crashpad/crashpad/+/master/${man_path}">${man_basename}</a>
__EOF__
done
maybe_mkdir "${output_dir}/man"
cd "${output_dir}/man"
cat > index.html << __EOF__
<!DOCTYPE html>
<meta charset="utf-8">
<title>Crashpad Man Pages</title>
<ul>
__EOF__
sort "${list_file}" | while read line; do
line=$(${sed_ext} -e 's/^<!-- .* -->//' <<< "${line}")
cat >> index.html << __EOF__
<li>
${line}
</li>
__EOF__
done
rm -f "${list_file}"
cat >> index.html << __EOF__
</ul>
__EOF__

View File

@ -20,6 +20,7 @@ limitations under the License.
* [Developing](/doc/developing.md) * [Developing](/doc/developing.md)
* [Interface Docs](https://crashpad.chromium.org/doxygen/) * [Interface Docs](https://crashpad.chromium.org/doxygen/)
* [Man Pages](https://crashpad.chromium.org/man/) * [Man Pages](https://crashpad.chromium.org/man/)
* [Man Pages](/doc/man.md)
* [Source Code](https://chromium.googlesource.com/crashpad/crashpad/) * [Source Code](https://chromium.googlesource.com/crashpad/crashpad/)
[home]: /README.md [home]: /README.md