"Fossies" - the Fresh Open Source Software Archive

Member "gawk-5.1.0/doc/it/sidebar.awk" (6 Feb 2020, 1919 Bytes) of package /linux/misc/gawk-5.1.0.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) (G)AWK source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "sidebar.awk": 5.0.1_vs_5.1.0.

    1 # sidebar.awk --- add support for sidebars, other stuff to gawk.texi
    2 
    3 # Copyright (C) 2013, 2016 the Free Software Foundation, Inc.
    4 # 
    5 # This file is part of GAWK, the GNU implementation of the
    6 # AWK Programming Language.
    7 # 
    8 # GAWK 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 3 of the License, or
   11 # (at your option) any later version.
   12 # 
   13 # GAWK 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
   19 # along with this program; if not, write to the Free Software
   20 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
   21 
   22 BEGIN {
   23     print "% ****************************************************"
   24     print "% * DO NOT MODIFY THIS FILE!!!!                      *"
   25     print "% * It was generated from gawktexi.in by sidebar.awk *"
   26     print "% * Edit gawktexi.in instead.                        *"
   27     print "% ****************************************************"
   28 }
   29 
   30 /^@sidebar/ {
   31     sub(/^@sidebar[ \t]+/, "", $0)
   32     title = $0
   33     body = ""
   34     collecting = 1
   35     next
   36 }
   37 
   38 /^@end[ \t]+sidebar[ \t]*$/ {
   39     collecting = 0
   40     printf "@cindex riquadro @subentry %s\n", title
   41     printf "@ifdocbook\n"
   42         printf "@docbook\n"
   43         printf "<sidebar><title>%s</title>\n", title
   44         printf "@end docbook\n"
   45             print  body
   46         print ""
   47         printf "@docbook\n"
   48         printf "</sidebar>\n"
   49         printf "@end docbook\n"
   50     printf "@end ifdocbook\n\n"
   51 
   52     printf "@ifnotdocbook\n"
   53         printf "@cartouche\n"
   54         printf "@center @b{%s}\n\n", title
   55             print  body
   56         printf "@end cartouche\n"
   57     printf "@end ifnotdocbook\n"
   58     body = ""
   59     next
   60 }
   61 
   62 collecting == 1 {
   63     body = body RS $0
   64     next
   65 }
   66 
   67 { print }