# Take apart bits of HTML and puts them back together again in new and # fascinating ways. Copyright (C) 2002 Free Software Foundation, Inc. # Contributed by Phil Edwards . Simple two-state automaton # inspired by Richard Henderson's gcc/mkmap-symver.awk. # 'file' is the name of the file on stdin # 'title' is the text to print at the start of the list BEGIN { state = "looking"; entries = 0; printf ("
  • %s\n", title); printf (" \n
  • \n\n"); } function extract_info(line) { # thistarget will be things like "#5" or "elsewhere.html" match(line,"href=\".*\""); thistarget = substr(line,RSTART+6,RLENGTH-7); # take apart the filename split(file,X,"/"); if (thistarget ~ /^#/) { # local name, use directory and filename target = file thistarget } else { # different file, only use directory target = X[1] "/" thistarget } # visible text gsub("","",line); start = index(line,"\">") + 2; thistext = substr(line,start); # Assemble and store the HTML for later output. entry[entries++] = "
  • " thistext "
  • " } # vim:sw=2