Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 #!/bin/bash | |
| 2 | |
| 3 # Copyright 2015 The Crashpad Authors. All rights reserved. | |
| 4 # | |
| 5 # Licensed under the Apache License, Version 2.0 (the "License"); | |
| 6 # you may not use this file except in compliance with the License. | |
| 7 # You may obtain a copy of the License at | |
| 8 # | |
| 9 # http://www.apache.org/licenses/LICENSE-2.0 | |
| 10 # | |
| 11 # Unless required by applicable law or agreed to in writing, software | |
| 12 # distributed under the License is distributed on an "AS IS" BASIS, | |
| 13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 14 # See the License for the specific language governing permissions and | |
| 15 # limitations under the License. | |
| 16 | |
| 17 set -e | |
| 18 | |
| 19 function maybe_mkdir() { | |
| 20 local dir="${1}" | |
| 21 if [[ ! -d "${dir}" ]]; then | |
| 22 mkdir "${dir}" | |
| 23 fi | |
| 24 } | |
| 25 | |
| 26 # Run from the Crashpad project root directory. | |
| 27 cd "$(dirname "${0}")/../.." | |
| 28 | |
| 29 source doc/support/compat.sh | |
| 30 | |
| 31 doc/support/generate_doxygen.sh | |
| 32 doc/support/generate_asciidoc.sh | |
| 33 | |
| 34 output_dir=doc/generated | |
| 35 maybe_mkdir "${output_dir}" | |
| 36 | |
| 37 for subdir in doc doxygen man ; do | |
| 38 output_subdir="${output_dir}/${subdir}" | |
| 39 maybe_mkdir "${output_subdir}" | |
| 40 rsync -Ilr --delete --exclude .git "out/doc/${subdir}/html/" \ | |
| 41 "${output_subdir}/" | |
| 42 done | |
| 43 | |
| 44 # Move doc/index.html to index.html, adjusting relative paths to other files in | |
| 45 # doc. | |
| 46 ${sed_ext} -e 's%<a href="([^/]+)\.html">%<a href="doc/\1.html">%g' \ | |
| 47 < "${output_dir}/doc/index.html" > "${output_dir}/index.html" | |
| 48 | |
| 49 # Create man/index.html | |
| 50 cd "${output_dir}/man" | |
| 51 cat > index.html << __EOF__ | |
| 52 <!DOCTYPE html> | |
| 53 <html> | |
|
Bons
2015/10/08 18:27:06
fun fact:
html, head, and body tags are optional t
Mark Mentovai
2015/10/08 18:31:57
That’s hot. Updated.
| |
| 54 <head> | |
| 55 <title>Crashpad Manual Pages</title> | |
| 56 </head> | |
| 57 <body> | |
| 58 <ul> | |
| 59 __EOF__ | |
| 60 | |
| 61 for html_file in *.html; do | |
| 62 if [[ "${html_file}" = "index.html" ]]; then | |
| 63 continue | |
| 64 fi | |
| 65 basename=$(${sed_ext} -e 's/\.html$//' <<< "${html_file}") | |
| 66 cat >> index.html << __EOF__ | |
| 67 <li> | |
| 68 <a href="${html_file}">${basename}</a> | |
| 69 </li> | |
| 70 __EOF__ | |
| 71 done | |
| 72 | |
| 73 cat >> index.html << __EOF__ | |
| 74 </ul> | |
| 75 </body> | |
| 76 </html> | |
| 77 __EOF__ | |
| OLD | NEW |