| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 | 2 |
| 3 # Copyright 2015 The Crashpad Authors. All rights reserved. | 3 # Copyright 2015 The Crashpad Authors. All rights reserved. |
| 4 # | 4 # |
| 5 # Licensed under the Apache License, Version 2.0 (the "License"); | 5 # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 # you may not use this file except in compliance with 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 | 7 # You may obtain a copy of the License at |
| 8 # | 8 # |
| 9 # http://www.apache.org/licenses/LICENSE-2.0 | 9 # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 # | 10 # |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 mkdir "${dir}" | 22 mkdir "${dir}" |
| 23 fi | 23 fi |
| 24 } | 24 } |
| 25 | 25 |
| 26 # Run from the Crashpad project root directory. | 26 # Run from the Crashpad project root directory. |
| 27 cd "$(dirname "${0}")/../.." | 27 cd "$(dirname "${0}")/../.." |
| 28 | 28 |
| 29 source doc/support/compat.sh | 29 source doc/support/compat.sh |
| 30 | 30 |
| 31 doc/support/generate_doxygen.sh | 31 doc/support/generate_doxygen.sh |
| 32 doc/support/generate_asciidoc.sh | |
| 33 | 32 |
| 34 output_dir=doc/generated | 33 output_dir=doc/generated |
| 35 maybe_mkdir "${output_dir}" | 34 maybe_mkdir "${output_dir}" |
| 36 | 35 |
| 37 for subdir in doc doxygen man ; do | 36 maybe_mkdir "${output_dir}/doxygen" |
| 38 output_subdir="${output_dir}/${subdir}" | 37 rsync -Ilr --delete --exclude .git "out/doc/doxygen/html/" \ |
| 39 maybe_mkdir "${output_subdir}" | 38 "${output_dir}/doxygen" |
| 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 base_url=https://crashpad.chromium.org/ | |
| 47 ${sed_ext} -e 's%<a href="([^/]+)\.html">%<a href="doc/\1.html">%g' \ | |
| 48 -e 's%<a href="'"${base_url}"'">%<a href="index.html">%g' \ | |
| 49 -e 's%<a href="'"${base_url}"'%<a href="%g' \ | |
| 50 < "${output_dir}/doc/index.html" > "${output_dir}/index.html" | |
| 51 rm "${output_dir}/doc/index.html" | |
| 52 | 39 |
| 53 # Ensure a favicon exists at the root since the browser will always request it. | 40 # Ensure a favicon exists at the root since the browser will always request it. |
| 54 cp doc/favicon.ico "${output_dir}/" | 41 cp doc/favicon.ico "${output_dir}/" |
| 55 | |
| 56 # Create man/index.html | |
| 57 cd "${output_dir}/man" | |
| 58 cat > index.html << __EOF__ | |
| 59 <!DOCTYPE html> | |
| 60 <meta charset="utf-8"> | |
| 61 <title>Crashpad Man Pages</title> | |
| 62 <ul> | |
| 63 __EOF__ | |
| 64 | |
| 65 for html_file in *.html; do | |
| 66 if [[ "${html_file}" = "index.html" ]]; then | |
| 67 continue | |
| 68 fi | |
| 69 basename=$(${sed_ext} -e 's/\.html$//' <<< "${html_file}") | |
| 70 cat >> index.html << __EOF__ | |
| 71 <li> | |
| 72 <a href="${html_file}">${basename}</a> | |
| 73 </li> | |
| 74 __EOF__ | |
| 75 done | |
| 76 | |
| 77 cat >> index.html << __EOF__ | |
| 78 </ul> | |
| 79 __EOF__ | |
| OLD | NEW |