3 if [ -n "$debug" ] ; then
10 pushd "$SRCDIR" > /dev
/null
20 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
26 * { margin: 0; padding: 0; }
27 body { font-family: sans-serif; font-size: 12px; }
28 #head { padding: 20px; background: #00A500; }
29 #head a { color: #000; }
30 #body { padding: 20px; }
31 #foot { padding: 10px; font-size: 9px; border-top: 1px #18A303 solid; margin-top: 25px; }
32 p { line-height: 1.7em; margin-bottom: 1em; }
33 pre { margin-bottom: 0.5em; }
34 .multi-col { -moz-column-width: 20em; -webkit-column-width: 20em; -moz-column-gap: 1em; -webkit-column-gap: 1em; }
35 h1 { margin-bottom: 0.5em; }
36 h2,h3,h4 { margin: 1.3em 0 0.5em 0; }
37 ul, ol { margin: 0.5em 1.5em; }
45 <div id="body" style="multi-col">
53 cat - >> $output <<EOF
58 <p>Generated by Libreoffice CI on $(hostname)</p>
62 date '+%F %T' >> $output
63 cat - >> $output <<EOF
64 | <a href="http://www.documentfoundation.org/privacy">Privacy Policy</a> | <a href="http://www.documentfoundation.org/imprint">Impressum (Legal Info)</a>
76 # Local links: [[...]]
77 # Git links: [git:...]
78 # Other remote links: [...]
79 # Headings: == bleh ==
81 sed -re ' s/\[\[([-_a-zA-Z0-9]+)\]\]/<a href="\1.html">\1<\/a>/g' - \
82 |
sed -re ' s/\[git:([^]]+)\]/<a href="https:\/\/cgit.freedesktop.org\/libreoffice\/core\/tree\/\1">\1<\/a>/g' \
83 |
sed -re ' s/\[([^]]+)\]/<a href="\1">\1<\/a>/g' \
84 |
sed -re ' s/====([^=]+)====/<h4>\1<\/h4>/g' \
85 |
sed -re ' s/===([^=]+)===/<h3>\1<\/h3>/g' \
86 |
sed -re ' s/==([^=]+)==/<h2>\1<\/h2>/g' \
87 |
sed -re ':a;N;$!ba;s/\n\n/<\/p><p>/g' \
88 |
awk 'BEGIN { print "<p>" } { print } END { print "</p>" }'
93 echo "generating index page"
94 header
"LibreOffice Modules" " " "$BASE_OUTPUT/index.html"
96 for module_name
in *; do
97 if [ -d $module_name ]; then
99 if [ -f $module_name/readme.txt
] ; then
100 cur_file
="$module_name/readme.txt"
101 elif [ -f $module_name/README
] ; then
102 cur_file
="$module_name/README"
104 if [ -n "$cur_file" ]; then
105 # write index.html entry
106 text
="<h2><a href=\"${module_name}.html\">${module_name}</a></h2>\n"
107 text
="${text}$(head -n1 $cur_file | proc_text )"
108 echo -e $text >> "$BASE_OUTPUT/index.html"
110 # write detailed module content
111 header
"$module_name" "<a href=\"index.html\">LibreOffice</a> » ${module_name}" "$BASE_OUTPUT/${module_name}.html"
112 text
="<p><b>View module in:</b>"
113 text
="${text} <a href=\"https://cgit.freedesktop.org/libreoffice/core/tree/${module_name}\">cgit</a>"
114 if [ -d .
/docs
/${module_name} ] ; then
115 text
="${text} <a href=\"${module_name}/html/classes.html\">Doxygen</a>"
117 text
="${text} </p><p> </p>"
118 echo -e $text >> "$BASE_OUTPUT/${module_name}.html"
119 proc_text
< $cur_file >> "$BASE_OUTPUT/${module_name}.html"
120 footer
"$BASE_OUTPUT/${module_name}.html"
122 empty_modules
[${#empty_modules[*]}]=$module_name
127 if [ ${#empty_modules[*]} -gt 0 ]; then
128 echo -e "<p> </p><p>READMEs were not available for these modules:</p><ul>\n" >> "$BASE_OUTPUT/index.html"
129 for module_name
in "${empty_modules[@]}"; do
130 echo -e "<li><a href=\"https://cgit.freedesktop.org/libreoffice/core/tree/${module_name}\">${module_name}</a></li>\n" >> "$BASE_OUTPUT/index.html"
132 echo -e "</ul>\n" >> "$BASE_OUTPUT/index.html"
135 footer
"$BASE_OUTPUT/index.html"