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 <meta charset="utf-8"> |
| 54 <title>Crashpad Man Pages</title> |
| 55 <ul> |
| 56 __EOF__ |
| 57 |
| 58 for html_file in *.html; do |
| 59 if [[ "${html_file}" = "index.html" ]]; then |
| 60 continue |
| 61 fi |
| 62 basename=$(${sed_ext} -e 's/\.html$//' <<< "${html_file}") |
| 63 cat >> index.html << __EOF__ |
| 64 <li> |
| 65 <a href="${html_file}">${basename}</a> |
| 66 </li> |
| 67 __EOF__ |
| 68 done |
| 69 |
| 70 cat >> index.html << __EOF__ |
| 71 </ul> |
| 72 __EOF__ |
OLD | NEW |