From af54a1b8b1b04860302e8a743f512d01a87f6b9c Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Mon, 13 Feb 2012 12:44:47 +0100 Subject: [PATCH] Integrate Josh Heidenreich's nice README parser as start page. From https://github.com/TheJosh/tdf-misc's scrape.php, ported the concept over to bash, to have it run with the doxygen generation. --- solenv/bin/mkdocs.sh | 169 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 133 insertions(+), 36 deletions(-) diff --git a/solenv/bin/mkdocs.sh b/solenv/bin/mkdocs.sh index dbf4c4691afc..a0ad6e4a51ba 100755 --- a/solenv/bin/mkdocs.sh +++ b/solenv/bin/mkdocs.sh @@ -1,27 +1,114 @@ -#!/bin/bash +#!/usr/bin/env bash # -# Doxygen Doc generation +# Doxygen / README doc generation # +# See git for contributors +# + +function header { + title=$1 + breadcrumb=$2 + output=$3 + + cat - > $output < + + + $title + + + + + +
+EOF +} + +function footer { + output=$1 + + cat - >> $output < + + + +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 setup { + parm=$1 + if [ -z "${!parm}" ] ; then + echo "grep \"${parm}=\" ./config_host.mk | sed -re \" s/${parm}=//\")" + echo "$parm=$(grep \"${parm}=\" ./config_host.mk | sed -re \" s/${parm}=//\")" + eval "$parm=$(grep \"${parm}=\" ./config_host.mk | sed -re \" s/${parm}=//\")" + fi + if [ -z "${!parm}" ] ; then + echo "could not determine $parm" >&2 + exit 1 + fi +} # binaries that we need which doxygen > /dev/null 2>&1 || { - echo "You need doxygen for doc generation" + echo "You need doxygen for doc generation" >&2 exit 1 } which dot > /dev/null 2>&1 || { - echo "You need the graphviz tools to create the nice inheritance graphs" + echo "You need the graphviz tools to create the nice inheritance graphs" >&2 exit 1 } -# otherwise, aliases are not expanded below -shopt -s expand_aliases +# suck setup +setup "INPATH" +setup "SOLARINC" +shopt -s nullglob # Title of the documentation DOXYGEN_PROJECT_PREFIX="LibreOffice" -# suck setup -. ./Env.Host.sh - # get list of modules in build order - bah, blows RAM & disk, static list below INPUT_PROJECTS="o3tl basegfx basebmp basic comphelper svl vcl canvas cppcanvas oox svtools goodies drawinglayer xmloff slideshow sfx2 editeng svx writerfilter cui chart2 dbaccess sd starmath sc sw" @@ -44,7 +131,7 @@ fi DOXYGEN_INCLUDE_PATH=`echo $SOLARINC | sed -e ' s/-I\.//'g | sed -e ' s/ -I/ /'g | sed -e ' s|/usr/[^ ]*| |g'` # setup version string -DOXYGEN_VERSION="$GITTAG" +DOXYGEN_VERSION="master" ################################################### @@ -54,12 +141,13 @@ DOXYGEN_VERSION="$GITTAG" ################################################### # cleanup -rm -rf $BASE_OUTPUT/* +echo "cleaning up" && rm -rf $BASE_OUTPUT/* # make the stuff world-readable umask 022 # generate docs +echo "generating doxygen docs" DOXYGEN_REF_TAGFILES="" for PROJECT in `echo $INPUT_PROJECTS|tr ' ' '\n'|sort|tr '\n' ' '`; do @@ -89,39 +177,48 @@ do echo "Ref-Tags: $DOXYGEN_REF_TAGFILES" echo "Title: $DOXYGEN_PROJECTNAME" - nice -15 doxygen "$DOXYGEN_CFG" || exit 1 + #nice -15 doxygen "$DOXYGEN_CFG" || exit 1 # setup referenced tagfiles for next round DOXYGEN_REF_TAGFILES="$DOXYGEN_REF_TAGFILES $DOXYGEN_OUR_TAGFILE=$BASE_URL/$PROJECT/html" done # generate entry page -cat - > $BASE_OUTPUT/index.html < - - - LibreOffice Source Code Documentation (fragmentary) - - -

LibreOffice Source Code Documentation (fragmentary)

-