3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 # Doxygen / README doc generation
11 # See git for contributors
20 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
26 * { margin: 0; padding: 0; }
27 body { font-family: sans-serif; font-size: 12px; }
28 #head { padding: 20px; background: #18A303; }
29 #head a { color: #000; }
30 #body { padding: 20px; }
31 #foot { padding: 10px; font-size: 9px; border-top: 1px #18A303 solid; margin-top: 25px; }
32 p { line-height: 1.7em; margin-bottom: 1em; }
33 pre { margin-bottom: 0.5em; }
34 .multi-col { -moz-column-width: 13em; -webkit-column-width: 13em; -moz-column-gap: 1em; -webkit-column-gap: 1em; }
35 h1 {margin-bottom: 0.5em;}
36 h2,h3,h4 { margin: 1.3em 0 0.5em 0; }
37 ul, ol { margin: 0.5em 1.5em; }
52 cat - >> $output <<EOF
57 <p>Generated by Libreoffice <a href="http://cgit.freedesktop.org/libreoffice/core/plain/solenv/bin/mkdocs.sh">Module Description Tool</a></p>
61 cat - >> $output <<EOF
72 # Local links: [[...]]
73 # Git links: [git:...]
74 # Other remote links: [...]
75 # Headings: == bleh ==
77 sed -re ' s/\[\[([-_a-zA-Z0-9]+)\]\]/<a href="\1.html">\1<\/a>/g' - \
78 |
sed -re ' s/\[git:([^]]+)\]/<a href="http:\/\/cgit.freedesktop.org\/libreoffice\/core\/tree\/\1">\1<\/a>/g' \
79 |
sed -re ' s/\[([^]]+)\]/<a href="\1">\1<\/a>/g' \
80 |
sed -re ' s/====([^=]+)====/<h4>\1<\/h4>/g' \
81 |
sed -re ' s/===([^=]+)===/<h3>\1<\/h3>/g' \
82 |
sed -re ' s/==([^=]+)==/<h2>\1<\/h2>/g' \
83 |
sed -re ':a;N;$!ba;s/\n\n/<\/p><p>/g' \
84 |
awk 'BEGIN { print "<p>" } { print } END { print "</p>" }'
89 if [ -z "${!parm}" ] ; then
90 echo "grep \"${parm}=\" ./config_host.mk | sed -re \" s/${parm}=//\")"
91 echo "$parm=$(grep \"${parm}=\" ./config_host.mk | sed -re \" s/${parm}=//\")"
92 eval "$parm=$(grep \"${parm}=\" ./config_host.mk | sed -re \" s/${parm}=//\")"
94 if [ -z "${!parm}" ] ; then
95 echo "could not determine $parm" >&2
100 # binaries that we need
101 which doxygen
> /dev
/null
2>&1 ||
{
102 echo "You need doxygen for doc generation" >&2
105 which dot
> /dev
/null
2>&1 ||
{
106 echo "You need the graphviz tools to create the nice inheritance graphs" >&2
115 # Title of the documentation
116 DOXYGEN_PROJECT_PREFIX
="LibreOffice"
118 # get list of modules
119 INPUT_PROJECTS
="`ls */Module_*.mk | sed 's#/.*##'`"
121 # output directory for generated documentation
123 mkdir
-p "$BASE_OUTPUT" ||
{
124 echo "Cannot create $BASE_OUTPUT"
128 # paths for binary and configuration file
131 if test ! -f "$DOXYGEN_CFG"; then
132 echo "doxygen.cfg not found"
136 # strip -I. and bin -I prefix; exlude system headers
137 DOXYGEN_INCLUDE_PATH
=`echo $SOLARINC | sed -e 's/-I\.//g' -e 's/ -I/ /'g -e 's/ -isystem/ /g' -e 's|/usr/[^ ]*| |g'`
139 # setup version string
140 DOXYGEN_VERSION
="master"
143 ###################################################
147 ###################################################
150 echo "cleaning up" && rm -rf $BASE_OUTPUT/*
152 # make the stuff world-readable
156 echo "generating doxygen docs"
157 DOXYGEN_REF_TAGFILES
=""
158 for PROJECT
in $INPUT_PROJECTS;
160 # avoid processing of full project subdirs, only add source and inc
161 DOXYGEN_INPUT
=`printf "%s" "$PROJECT/source $PROJECT/inc include/$PROJECT "`
163 DOXYGEN_OUTPUT
="$BASE_OUTPUT/$PROJECT"
164 DOXYGEN_OUR_TAGFILE
="$DOXYGEN_OUTPUT/$PROJECT.tags"
165 DOXYGEN_PROJECTNAME
="$DOXYGEN_PROJECT_PREFIX Module $PROJECT"
167 # export variables referenced in doxygen config file
169 export DOXYGEN_OUTPUT
170 export DOXYGEN_INCLUDE_PATH
171 export DOXYGEN_VERSION
172 export DOXYGEN_OUR_TAGFILE
173 export DOXYGEN_REF_TAGFILES
174 export DOXYGEN_PROJECTNAME
177 echo "Calling $DOXYGEN_PATH/doxygen $DOXYGEN_CFG with"
178 echo "Input: $DOXYGEN_INPUT"
179 echo "Output: $DOXYGEN_OUTPUT"
180 echo "Include: $DOXYGEN_INCLUDE_PATH"
181 echo "Version: $DOXYGEN_VERSION"
182 echo "Tagfile: $DOXYGEN_OUR_TAGFILE"
183 echo "Ref-Tags: $DOXYGEN_REF_TAGFILES"
184 echo "Title: $DOXYGEN_PROJECTNAME"
186 nice
-15 doxygen
"$DOXYGEN_CFG" >>$BASE_OUTPUT/doxygen.log ||
exit 1
188 # setup referenced tagfiles for next round
189 DOXYGEN_REF_TAGFILES
="$DOXYGEN_REF_TAGFILES $DOXYGEN_OUR_TAGFILE=$BASE_URL/$PROJECT/html"
192 # generate entry page
193 echo "generating index page"
194 header
"LibreOffice Modules" " " "$BASE_OUTPUT/index.html"
195 for module_name
in *; do
196 if [ -d $module_name ]; then
197 cur_file
=$
(echo $module_name/README
* $module_name/readme.txt
*)
198 if [ -f "$cur_file" ]; then
199 # write index.html entry
200 text
="<h2><a href=\"${module_name}.html\">${module_name}</a></h2>\n"
201 text
="${text}$(head -n1 $cur_file | proc_text )"
202 echo -e $text >> "$BASE_OUTPUT/index.html"
204 # write detailed module content
205 header
"$module_name" "<a href=\"index.html\">LibreOffice</a> » ${module_name}" "$BASE_OUTPUT/${module_name}.html"
206 text
="<p><b>View module in:</b>"
207 text
="${text} <a href=\"http://cgit.freedesktop.org/libreoffice/core/tree/${module_name}\">cgit</a>"
208 if $
(echo $INPUT_PROJECTS |
grep -q $module_name); then
209 text
="${text} <a href=\"${module_name}/html/classes.html\">Doxygen</a>"
211 text
="${text} </p><p> </p>"
212 echo -e $text >> "$BASE_OUTPUT/${module_name}.html"
213 proc_text
< $cur_file >> "$BASE_OUTPUT/${module_name}.html"
214 footer
"$BASE_OUTPUT/${module_name}.html"
216 empty_modules
[${#empty_modules[*]}]=$module_name
220 if [ ${#empty_modules[*]} -gt 0 ]; then
221 echo -e "<p> </p><p>READMEs were not available for these modules:</p><ul>\n" >> "$BASE_OUTPUT/index.html"
222 for module_name
in "${empty_modules[@]}"; do
223 echo -e "<li><a href=\"http://cgit.freedesktop.org/libreoffice/core/tree/${module_name}\">${module_name}</a></li>\n" >> "$BASE_OUTPUT/index.html"
225 echo -e "</ul>\n" >> "$BASE_OUTPUT/index.html"
228 footer
"$BASE_OUTPUT/index.html"