function proc_text
{ # Local links: [[...]] # Git links: [git:...] # Other remote links: [...] # Headings: == bleh == # Paragraphs: \n\n
sed -re ' s/\[\[([-_a-zA-Z0-9]+)\]\]/\1<\/a>/g' - \
| sed -re ' s/\[git:([^]]+)\]/\1<\/a>/g' \
| sed -re ' s/\[([^]]+)\]/\1<\/a>/g' \
| sed -re ' s/====([^=]+)====/
\1<\/h4>/g'
\
| sed -re ' s/===([^=]+)===/
\1<\/h3>/g'
\
| sed -re ' s/==([^=]+)==/
\1<\/h2>/g'
\
| sed -re ':a;N;$!ba;s/\n\n/<\/p>
/g'
\
| awk 'BEGIN { print "
" } { print } END { print "
" }'
}
function proc_text_markdown {
sed -re ' s/\[git:([^]]+)\]/\1<\/a>/g'
}
# generate entry page
echo"generating index page"
header "LibreOffice Modules"" ""$BASE_OUTPUT/index.html"
for module_name in *; do if [ -d $module_name ]; then
cur_file=$(echo $module_name/README.md) if [ -f "$cur_file" ]; then # write index.html entry
text=$(echo -e "
if [ ${cur_file: -3} == ".md" ]; then # This is a markdown file.
text="$(${markdown} $cur_file | proc_text_markdown)" echo -e "$text" >> "$BASE_OUTPUT/${module_name}.html" else
proc_text < $cur_file >> "$BASE_OUTPUT/${module_name}.html" fi
footer "$BASE_OUTPUT/${module_name}.html" else
empty_modules[${#empty_modules[*]}]=$module_name fi fi done
if [ ${#empty_modules[*]} -gt 10 ]; then echo -e "
READMEs were not available for these modules:
\n"
>> "$BASE_OUTPUT/index.html" for module_name in "${empty_modules[@]}"; do if [[ "$module_name" =~ ^(autom4te.cache|dictionaries|docs|helpcompiler|helpcontent2|include|instdir|lo|translations|workdir)$ ]] then
continue fi echo -e "
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.