diff --git a/solenv/bin/mkdocs.sh b/solenv/bin/mkdocs.sh
index 0f92ff87e532..4b70787787e8 100755
--- a/solenv/bin/mkdocs.sh
+++ b/solenv/bin/mkdocs.sh
@@ -85,8 +85,7 @@ function proc_text {
}
function proc_text_markdown {
- sed -re ' s/\[\[([-_a-zA-Z0-9]+)\]\]/\1<\/a>/g' - \
- | sed -re ' s/\[git:([^]]+)\]/\1<\/a>/g'
+ sed -re ' s/\[git:([^]]+)\]/\1<\/a>/g'
}
function check_cmd {
@@ -226,10 +225,10 @@ 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* $module_name/readme.txt*)
+ cur_file=$(echo $module_name/README.md)
if [ -f "$cur_file" ]; then
# write index.html entry
- text="${module_name}
\n"
+ text=$(echo -e "${module_name}
\n")
if [ ${cur_file: -3} == ".md" ]; then
# This is a markdown file.
@@ -239,7 +238,7 @@ for module_name in *; do
else
text="${text}$(head -n1 $cur_file | proc_text)"
fi
- echo -e $text >> "$BASE_OUTPUT/index.html"
+ echo -e "$text" >> "$BASE_OUTPUT/index.html"
# write detailed module content
header "$module_name" "LibreOffice » ${module_name}" "$BASE_OUTPUT/${module_name}.html"
@@ -249,12 +248,12 @@ for module_name in *; do
text="${text} Doxygen"
fi
text="${text}
" - echo -e $text >> "$BASE_OUTPUT/${module_name}.html" + echo -e "$text" >> "$BASE_OUTPUT/${module_name}.html" if [ ${cur_file: -3} == ".md" ]; then # This is a markdown file. text="$(${markdown} $cur_file | proc_text_markdown)" - echo $text >> "$BASE_OUTPUT/${module_name}.html" + echo -e "$text" >> "$BASE_OUTPUT/${module_name}.html" else proc_text < $cur_file >> "$BASE_OUTPUT/${module_name}.html" fi @@ -265,9 +264,13 @@ for module_name in *; do fi done -if [ ${#empty_modules[*]} -gt 0 ]; then +if [ ${#empty_modules[*]} -gt 10 ]; then echo -e "
READMEs were not available for these modules:
" } { print } END { print "
" }' } +function proc_text_markdown { + sed -re ' s/\[git:([^]]+)\]/\1<\/a>/g' +} + # generate entry page echo "generating index page" @@ -95,28 +100,37 @@ header "LibreOffice Modules" " " "$BASE_OUTPUT/index.html" for module_name in *; do if [ -d $module_name ]; then - cur_file= - if [ -f $module_name/readme.txt ] ; then - cur_file="$module_name/readme.txt" - elif [ -f $module_name/README ] ; then - cur_file="$module_name/README" - fi - if [ -n "$cur_file" ]; then + cur_file=$(echo $module_name/README.md) + if [ -f "$cur_file" ]; then # write index.html entry - text="View module in:" text="${text} cgit" - if [ -d ./docs/${module_name} ] ; then + if $(echo $INPUT_PROJECTS | grep -q $module_name); then text="${text} Doxygen" fi text="${text}
" - echo -e $text >> "$BASE_OUTPUT/${module_name}.html" + echo -e "$text" >> "$BASE_OUTPUT/${module_name}.html" + + 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 @@ -124,9 +138,13 @@ for module_name in *; do fi done -if [ ${#empty_modules[*]} -gt 0 ]; then +if [ ${#empty_modules[*]} -gt 10 ]; then echo -e "
READMEs were not available for these modules: