3 if [ -n "$debug" ] ; then
11 pushd "$SRCDIR" > /dev
/null
21 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
27 * { margin: 0; padding: 0; }
28 body { font-family: sans-serif; font-size: 12px; }
29 #head { padding: 20px; background: #00A500; }
30 #head a { color: #000; }
31 #body { padding: 20px; }
32 #foot { padding: 10px; font-size: 9px; border-top: 1px #18A303 solid; margin-top: 25px; }
33 p { line-height: 1.7em; margin-bottom: 1em; }
34 pre { margin-bottom: 0.5em; }
35 .multi-col { -moz-column-width: 20em; -webkit-column-width: 20em; -moz-column-gap: 1em; -webkit-column-gap: 1em; }
36 h1 { margin-bottom: 0.5em; }
37 h2,h3,h4 { margin: 1.3em 0 0.5em 0; }
38 ul, ol { margin: 0.5em 1.5em; }
46 <div id="body" style="multi-col">
54 cat - >> $output <<EOF
59 <p>Generated by Libreoffice CI on $(hostname)</p>
63 date '+%F %T' >> $output
64 cat - >> $output <<EOF
65 | <a href="http://www.documentfoundation.org/privacy">Privacy Policy</a> | <a href="http://www.documentfoundation.org/imprint">Impressum (Legal Info)</a>
77 # Local links: [[...]]
78 # Git links: [git:...]
79 # Other remote links: [...]
80 # Headings: == bleh ==
82 sed -re ' s/\[\[([-_a-zA-Z0-9]+)\]\]/<a href="\1.html">\1<\/a>/g' - \
83 |
sed -re ' s/\[git:([^]]+)\]/<a href="https:\/\/git.libreoffice.org\/core\/+\/refs\/heads\/master\/\1">\1<\/a>/g' \
84 |
sed -re ' s/\[([^]]+)\]/<a href="\1">\1<\/a>/g' \
85 |
sed -re ' s/====([^=]+)====/<h4>\1<\/h4>/g' \
86 |
sed -re ' s/===([^=]+)===/<h3>\1<\/h3>/g' \
87 |
sed -re ' s/==([^=]+)==/<h2>\1<\/h2>/g' \
88 |
sed -re ':a;N;$!ba;s/\n\n/<\/p><p>/g' \
89 |
awk 'BEGIN { print "<p>" } { print } END { print "</p>" }'
92 function proc_text_markdown
{
93 sed -re ' s/\[git:([^]]+)\]/<a href="https:\/\/git.libreoffice.org\/core\/+\/refs\/heads\/master\/\1">\1<\/a>/g'
98 echo "generating index page"
99 header
"LibreOffice Modules" " " "$BASE_OUTPUT/index.html"
101 for module_name
in *; do
102 if [ -d $module_name ]; then
103 cur_file
=$
(echo $module_name/README.md
)
104 if [ -f "$cur_file" ]; then
105 # write index.html entry
106 text
=$
(echo -e "<h2><a href=\"${module_name}.html\">${module_name}</a></h2>\n")
107 if [ ${cur_file: -3} == ".md" ]; then
108 # This is a markdown file.
109 header_text
="$(head -n1 $cur_file)"
110 header_text
="$(echo ${header_text} | sed -e 's/^\#*//g')"
111 text
="${text}${header_text}"
113 text
="${text}$(head -n1 $cur_file | proc_text)"
115 echo -e "$text" >> "$BASE_OUTPUT/index.html"
117 # write detailed module content
118 header
"$module_name" "<a href=\"index.html\">LibreOffice</a> » ${module_name}" "$BASE_OUTPUT/${module_name}.html"
119 text
="<p><b>View module in:</b>"
120 text
="${text} <a href=\"https://git.libreoffice.org/core/+/refs/heads/master/${module_name}\">git</a>"
121 if $
(echo $INPUT_PROJECTS |
grep -q $module_name); then
122 text
="${text} <a href=\"${module_name}/html/classes.html\">Doxygen</a>"
124 text
="${text} </p><p> </p>"
125 echo -e "$text" >> "$BASE_OUTPUT/${module_name}.html"
127 if [ ${cur_file: -3} == ".md" ]; then
128 # This is a markdown file.
129 text
="$(${markdown} $cur_file | proc_text_markdown)"
130 echo -e "$text" >> "$BASE_OUTPUT/${module_name}.html"
132 proc_text
< $cur_file >> "$BASE_OUTPUT/${module_name}.html"
134 footer
"$BASE_OUTPUT/${module_name}.html"
136 empty_modules
[${#empty_modules[*]}]=$module_name
141 if [ ${#empty_modules[*]} -gt 10 ]; then
142 echo -e "<p> </p><p>READMEs were not available for these modules:</p><ul>\n" >> "$BASE_OUTPUT/index.html"
143 for module_name
in "${empty_modules[@]}"; do
144 if [[ "$module_name" =~ ^
(autom4te.cache|dictionaries|docs|helpcompiler|helpcontent2|include|instdir|lo|translations|workdir
)$
]]
148 echo -e "<li><a href=\"https://git.libreoffice.org/core/+/refs/heads/master/${module_name}\">${module_name}</a></li>\n" >> "$BASE_OUTPUT/index.html"
150 echo -e "</ul>\n" >> "$BASE_OUTPUT/index.html"
153 footer
"$BASE_OUTPUT/index.html"