File: texinfo-tabulate.awk

package info (click to toggle)
slime 2%3A2.26.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 4,732 kB
  • sloc: lisp: 49,441; ruby: 321; makefile: 237; awk: 10
file content (21 lines) | stat: -rw-r--r-- 500 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env awk -f
#
# Format input lines into a multi-column texinfo table.
# Note: does not do texinfo-escaping of the input.

# This code has been placed in the Public Domain.  All warranties
# are disclaimed.

BEGIN {
  columns = 3;
  printf("@multitable @columnfractions");
  for (i = 0; i < columns; i++)
    printf(" %f", 1.0/columns);
  print
}

{ if (NR % columns == 1) printf("\n@item %s", $0);
  else                   printf(" @tab %s", $0); }

END { printf("\n@end multitable\n"); }