3 #**********************************************************************
4 # Copyright (C) 2021 - The Geeqie Team
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License along
19 # with this program; if not, write to the Free Software Foundation, Inc.,
20 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 #**********************************************************************
23 # Facilitate the integration of the Doxygen html files
26 # doxygen-help.sh <parameter to be searched for>
28 # The environment variable DOCDIR must be set to point to the
29 # Doxygen html files location.
30 # The environment variable PROJECT must be set to the value used
31 # when creating the Doxygen files.
33 # Set a hot key in the code editor to call this script with
34 # the highlighted variable or function name as a parameter.
36 # The file $DOCDIR/$PROJECT.tag contains an index of all documented
37 # items and is scanned to locate the relevant html section.
39 # xdg-open is used to call the html browser to display the document.
41 #**********************************************************************
43 # To generate the Doxygen html files set the following
44 # environment variables:
45 # DOCDIR (destination folder)
46 # SRCDIR (must point to the level above the source code)
50 # Then run 'doxygen doxygen.conf'
52 if [[ -z "${DOCDIR}" ]]
54 echo "Environment variable DOCDIR not set"
55 zenity --title="Geeqie" --width=200 --warning --text="Environment variable DOCDIR not set"
56 elif [[ -z "${PROJECT}" ]]
58 echo "Environment variable PROJECT not set"
59 zenity --title="Geeqie" --width=200 --warning --text="Environment variable PROJECT not set"
61 url_found=$(awk -v search_param="$1" -v docdir="$DOCDIR" '
63 if ($1 == "<name>_"search_param"</name>")
66 n=split($1, anchorfile, /[<>]/)
69 n=split($1, anchor, /[<>]/)
70 struct_result="file://"docdir"/html/" anchorfile[3] "#" anchor[3]
74 if ($1 == "<name>"search_param"</name>")
77 n=split($1, anchorfile, /[<>]/)
80 n=split($1, anchor, /[<>]/)
81 function_result="file://"docdir"/html/" anchorfile[3] "#" anchor[3]
86 if (struct_result != "")
90 else if (function_result != "")
95 ' "$DOCDIR"/"$PROJECT".tag)
97 if [[ -z $url_found ]]
101 xdg-open "$url_found"