Update copyright year.
[m17n/m17n-docs.git] / utils / dbdata.awk
index be6fd3f..57cf343 100644 (file)
@@ -2,16 +2,49 @@ BEGIN {
   print "/***";
 }
 
-/".*\.(tbl|mim|tab|flt)"/ {
-  FROM=match($0, "\".*\.(tbl|mim|tab|flt)\"") + 1;
+/"LANGUAGE.tbl"/ {
+  DIR=FILENAME;
+  gsub("/[^/]*$", "", DIR)
+  system("utils/dbdata.sh "DIR"/LANGDATA LANGUAGE.tbl");
+  printf "\n";
+  next;
+}
+
+/".*\.(fst|tbl)"/ {
+  FROM=match($0, "\".*\\.(mim|flt|fst|tbl)\"") + 1;
+  LEN=RLENGTH-2;
+  FILE=substr($0, FROM, LEN);
+  DIR=FILENAME;
+  gsub("/[^/]*$", "", DIR)
+  system("utils/dbdata.sh "DIR" "FILE);
+  printf "\n";
+  next;
+}
+
+/".*\.mim"/ {
+  FROM=match($0, "\".*\\.mim\"") + 1;
+  LEN=RLENGTH-2;
+  FILE=substr($0, FROM, LEN);
+  DIR=FILENAME;
+  gsub("/[^/]*$", "", DIR)
+  system("utils/dbdata.sh "DIR"/MIM "FILE);
+  printf "\n";
+  next;
+}
+
+/".*\.flt"/ {
+  FROM=match($0, "\".*\\.flt\"") + 1;
   LEN=RLENGTH-2;
   FILE=substr($0, FROM, LEN);
-  system("sed -n '/^[;#][;#]* <li>/,/^$/s/^[;#][;#]* *//p' "FILE);
+  DIR=FILENAME;
+  gsub("/[^/]*$", "", DIR)
+  system("utils/dbdata.sh "DIR"/FLT "FILE);
   printf "\n";
+  next;
 }
 
-/^;; / {
-  print substr($0, 4);
+/^;;;/ {
+  print substr($0, 5);
 }
 
 END {