Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  mkdocs_portal.sh   Sprache: Shell

 
#!/usr/bin/env bash

if [ -n "$debug" ] ; then
    set -x
fi

markdown="markdown"
SRCDIR="$1"
BASE_OUTPUT="$2"

pushd "$SRCDIR" > /dev/null


function header
{
    local title="$1"
    local breadcrumb="$2"
    local output="$3"

    cat - > $output <<EOF
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
        <title>$title</title>

        <style>
        * { margin: 0; padding: 0; }
        body { font-family: sans-serif; font-size: 12px; }
        #head { padding: 20px; background: #00A500; }
        #head a { color: #000; }
        #body { padding: 20px; }
        #foot { padding: 10px; font-size: 9px; border-top: 1px #18A303 solid; margin-top: 25px; }
        p { line-height: 1.7em; margin-bottom: 1em; }
        pre { margin-bottom: 0.5em; }
        .multi-col { -moz-column-width: 20em; -webkit-column-width: 20em; -moz-column-gap: 1em; -webkit-column-gap: 1em; }
        h1 { margin-bottom: 0.5em; }
        h2,h3,h4 { margin: 1.3em 0 0.5em 0; }
        ul, ol { margin: 0.5em 1.5em; }
        </style>
</head>
<body>
        <div id="head">
        <h1>${title}</h1>
        <p>${breadcrumb}</p>
        </div>
        <div id="body" style="multi-col">
EOF
}

function footer
{
local output="$1"

  cat - >> $output <<EOF

</div>
<div id="foot">
  <small>
    <p>Generated by Libreoffice CI on $(hostname)</p>
    <p>Last updated:
EOF

date '+%F %T' >> $output
cat - >> $output <<EOF
    | <a href="http://www.documentfoundation.org/privacy">Privacy Policy</a> | <a href="http://www.documentfoundation.org/imprint">Impressum (Legal Info)</a>
    </p>
  </small>
</div>
</body>
</html>
EOF

}

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 "

${module_name}.html\">${module_name}

\n")
            if [ ${cur_file: -3} == ".md" ]; then
                # This is a markdown file.
                header_text="$(head -n1 $cur_file)"
                header_text="$(echo ${header_text} | sed -e 's/^\#*//g')"
                text="${text}${header_text}"
            else
                text="${text}$(head -n1 $cur_file | proc_text)"
            fi
            echo -e "$text" >> "$BASE_OUTPUT/index.html"

            # write detailed module content
            header "$module_name" "index.html\">LibreOffice » ${module_name}" "$BASE_OUTPUT/${module_name}.html"
            text="

View module in:"
            text="${text}   https://git.libreoffice.org/core/+/refs/heads/master/${module_name}\">git"
            if $(echo $INPUT_PROJECTS | grep -q $module_name); then
                text="${text}   ${module_name}/html/classes.html\">Doxygen"
            fi
            text="${text}

 

"

            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
        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 "
  • https://git.libreoffice.org/core/+/refs/heads/master/${module_name}\">${module_name}
  • \n"
     >> "$BASE_OUTPUT/index.html"
        done
        echo -e "
\n"
 >> "$BASE_OUTPUT/index.html"
fi

footer "$BASE_OUTPUT/index.html"

popd > /dev/null

## done


Messung V0.5
C=96 H=87 G=91

¤ Dauer der Verarbeitung: 0.1 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

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.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge