Include check for untranslated text
[geeqie.git] / doc / create-doxygen-lua-api.sh
1 #!/bin/bash
2
3 #**********************************************************************
4 # Copyright (C) 2021 - The Geeqie Team
5 #
6 # Author: Colin Clark
7 #
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.
12 #
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.
17 #
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 #**********************************************************************
22 #
23 # This script will create the Lua API html document, which is part of
24 # the Geeqie Help file.
25 #
26 # It is run during the generation of the help files.
27 #
28 # The generated Lua html files are placed in doc/html/lua-api
29 #
30 # The doxygen.conf file is modified to extract only those comments
31 # that are useful as part of an API description.
32 #
33 #**********************************************************************
34
35 export PROJECT="Geeqie"
36 export VERSION=$(git tag --list v[1-9]* | tail -1)
37 export SRCDIR="$PWD/.."
38 export DOCDIR="$PWD/html/lua-api"
39 export INLINE_SOURCES=NO
40 export STRIP_CODE_COMMENTS=YES
41
42 TMPFILE=$(mktemp) || exit 1
43
44 # Modify the Geeqie doxygen.conf file to produce
45 # only the data needed for the lua API document
46 awk '
47 BEGIN {
48         FILE_PATTERNS_found = "FALSE"
49 }
50 {
51         if (FILE_PATTERNS_found == "TRUE")
52                 {
53                 if ($0 ~ /\\/)
54                         {
55                         next
56                         }
57                 else
58                         {
59                         FILE_PATTERNS_found = "FALSE"
60                         }
61                 }
62         if ($1 == SHOW_INCLUDE_FILES)
63                 {
64                 {print "SHOW_INCLUDE_FILES = NO"}
65                 }
66         else if ($1 == "FILE_PATTERNS")
67                 {
68                 print "FILE_PATTERNS = lua.c"
69                 FILE_PATTERNS_found = "TRUE"
70                 next
71                 }
72         else if ($1 == "EXCLUDE_SYMBOLS")
73                 {
74                 print "EXCLUDE_SYMBOLS = L \\"
75                 print "lua_callvalue \\"
76                 print "lua_check_exif \\"
77                 print "lua_check_image \\"
78                 print "lua_init \\"
79                 print "_XOPEN_SOURCE \\"
80                 print "LUA_register_global \\"
81                 print "LUA_register_meta"
82                 }
83         else if ($1 == "SOURCE_BROWSER")
84                 {
85                 print "SOURCE_BROWSER = NO"
86                 }
87         else if ($1 == "HAVE_DOT")
88                 {
89                 {print "HAVE_DOT = NO"}
90                 }
91         else
92                 {
93                 {print}
94                 }
95 }
96 ' ../doxygen.conf > $TMPFILE
97
98 doxygen $TMPFILE
99
100 rm $TMPFILE
101