]> mj.ucw.cz Git - libucw.git/commitdiff
Doc: Generalized makefile rules for all categories of manpages.
authorPavel Charvat <pchar@ucw.cz>
Sun, 10 Aug 2014 14:15:03 +0000 (14:15 +0000)
committerPavel Charvat <pchar@ucw.cz>
Sun, 10 Aug 2014 14:15:03 +0000 (14:15 +0000)
build/Makebottom
ucw/doc/Makefile
ucw/doc/ucw-tableprinter.1.txt [new file with mode: 0644]
ucw/doc/ucw-tableprinter.txt [deleted file]

index 7e2fea64b3c04a4370861533fad691cc80f4f66a..bb8c67d0ecb12b244a880e15b33d637afdc15cbe 100644 (file)
@@ -210,10 +210,11 @@ $(o)/%.html: $(o)/%.txt $(BUILDSYS)/asciidoc.conf $(BUILDSYS)/asciidoc-xhtml.con
        $(Q)asciidoc -e -f $(BUILDSYS)/asciidoc.conf -f $(BUILDSYS)/asciidoc-xhtml.conf -f $(HOST_PREFIX)/etc/asciidoc/asciidoc.conf -f $(HOST_PREFIX)/etc/asciidoc/xhtml11.conf $<
        $(Q)$(call symlink,$@,run/$(DOCDIR)/$(DOC_MODULE))
 
-$(MANPAGES): $(o)/%.1: $(s)/%.txt run/$(DOCDIR)/man/man1/.dir-stamp
-       $(M)"DOC-MANPAGE $<"
+$(MANPAGES): $(o)/%: $(s)/%.txt
+       $(M)"DOC-MAN $<"
        $(Q)a2x -d manpage -f manpage -D $(dir $@) $<
-       $(Q)$(call symlink,$@,run/$(DOCDIR)/man/man1)
+       $(Q)mkdir -p run/$(DOCDIR)/man/man$(subst .,,$(suffix $@))
+       $(Q)$(call symlink,$@,run/$(DOCDIR)/man/man$(subst .,,$(suffix $@)))
 
 # In reality, we do not depend on the .txt files, but on the corresponding .deflist's.
 # However, the Makefile language cannot express that doc-extract generates both .txt
index d54209300e152246b0b2579e017d50772f55e4c3..6cd6ce4988e4a9aca94a13863a99831b1d4822d4 100644 (file)
@@ -6,8 +6,8 @@ UCW_DOCS=basics log fastbuf index config configure install basecode hash docsys
 UCW_INDEX=$(o)/ucw/doc/def_index.html
 UCW_DOCS_HTML=$(addprefix $(o)/ucw/doc/,$(addsuffix .html,$(UCW_DOCS)))
 
-UCW_MANPAGES=ucw-tableprinter
-UCW_MANPAGES_NROFF=$(addprefix $(o)/ucw/doc/,$(addsuffix .1,$(UCW_MANPAGES)))
+UCW_MANPAGES=ucw-tableprinter.1
+UCW_MANPAGES_NROFF=$(addprefix $(o)/ucw/doc/,$(UCW_MANPAGES))
 MANPAGES+=$(UCW_MANPAGES_NROFF)
 
 $(UCW_INDEX): DOC_HEAD=$(s)/ucw/doc/def_index.txt
diff --git a/ucw/doc/ucw-tableprinter.1.txt b/ucw/doc/ucw-tableprinter.1.txt
new file mode 100644 (file)
index 0000000..af9d75d
--- /dev/null
@@ -0,0 +1,81 @@
+UCW-TABLEPRINTER(1)
+===================
+
+NAME
+----
+
+ucw-tableprinter - UCW table printer is a program module that allows user-customized printing of tables.
+
+DESCRIPTION
+-----------
+
+The table printer module provides formatting of 2-dimensional tables
+in various ways.
+
+Each table print-out consists of a number of rows, which are processed
+one after another. All rows have the same number of columns. Once a
+table is defined, it can be printed using a variety of formatters
+(block-line, human-readable, machine-readable, etc.).
+
+The table definition consists of various column definitions, each
+column definition is a pair consisting of a name and a type. Name of
+each column must be unique in the whole table. Each column definition
+can be instantiated(printed) in its own format, e.g., a size column
+can be printed three-times: 1) in bytes; 2) in gigabytes; 3)
+human-readable.
+
+The table can be controlled using various options:
+
+[options="header"]
+|===============================================================================================================
+| option      | argument                    | meaning
+| `header`    | 0 or 1                      | set whether a table header should be printed
+| `noheader`  | 'none'                      | equivalent to `header`=0
+| `cols`      | comma-separated column list | set order of columns
+| `fmt`              | `human`/`machine`/`block`   | set table formatter to one of the built-in formatters
+| `col-delim` | string                      | set column delimiter
+| `cells`     | string                      | set column cell format mode, possibilities are: default, raw, pretty
+| `raw`              | 'none'                      | set column cell format to raw data, equivalent to cells:raw
+| `pretty`    | 'none'                      | set column cell format to pretty-printing, equivalent to cells:pretty
+|===============================================================================================================
+
+Column order (`cols` option) has the following format:
+
+<col-order-string> := <col-def>[,<col-def>]*
+
+<col-def> := <col-name> [ '[' <col-opts> ']' ]
+
+<col-name> is a string that does not contain comma ',' or '[',']' brackets
+
+<col-opts> := <string> [ ',' <string> ]
+
+Where <col-opts> is a comma-separated list of options.
+
+Column delimiter option (`col-delim`) can be an arbitrary string. The
+cell format option `cells` can have one of the possible three values:
+1) `pretty`, 2) `default`, 3) `raw`. The `raw` and `pretty` value of
+`cells` option can be shortcutted as options `raw` and `pretty` with
+no value.
+
+Additionally to standard types (like integer, floating point) there
+are the two following types: 1) size; 2) timestamp. The 'size' type
+has the following case-sensitive column options: `KB`, `MB`, `GB`,
+`TB`, `auto`, e.g., a column of type size and name `file-size` can be
+specified as `file-size[MB]` or `file-size[auto]`.  The 'timestamp'
+has the following case-sensitive column options: 1) `datetime` which
+corresponds to date(1) format "%F %T", 2) `timestamp` which
+corresponds to a number of seconds relative to start of some epoch.
+
+Description of table formats
+-----------------------------
+
+'human-readable': prints columns separated by single space, rows
+separated by newline '\n'.
+
+'block-line': prints each column on one line, i.e., the column
+separator is '\n', rows are separated by double newlines
+'\n\n'. Therefore, rows forms newline separated blocks of rows.
+
+'machine-readable': prints columns separated by a tabulator '\t', rows
+separated by '\n'.
+
diff --git a/ucw/doc/ucw-tableprinter.txt b/ucw/doc/ucw-tableprinter.txt
deleted file mode 100644 (file)
index af9d75d..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-UCW-TABLEPRINTER(1)
-===================
-
-NAME
-----
-
-ucw-tableprinter - UCW table printer is a program module that allows user-customized printing of tables.
-
-DESCRIPTION
------------
-
-The table printer module provides formatting of 2-dimensional tables
-in various ways.
-
-Each table print-out consists of a number of rows, which are processed
-one after another. All rows have the same number of columns. Once a
-table is defined, it can be printed using a variety of formatters
-(block-line, human-readable, machine-readable, etc.).
-
-The table definition consists of various column definitions, each
-column definition is a pair consisting of a name and a type. Name of
-each column must be unique in the whole table. Each column definition
-can be instantiated(printed) in its own format, e.g., a size column
-can be printed three-times: 1) in bytes; 2) in gigabytes; 3)
-human-readable.
-
-The table can be controlled using various options:
-
-[options="header"]
-|===============================================================================================================
-| option      | argument                    | meaning
-| `header`    | 0 or 1                      | set whether a table header should be printed
-| `noheader`  | 'none'                      | equivalent to `header`=0
-| `cols`      | comma-separated column list | set order of columns
-| `fmt`              | `human`/`machine`/`block`   | set table formatter to one of the built-in formatters
-| `col-delim` | string                      | set column delimiter
-| `cells`     | string                      | set column cell format mode, possibilities are: default, raw, pretty
-| `raw`              | 'none'                      | set column cell format to raw data, equivalent to cells:raw
-| `pretty`    | 'none'                      | set column cell format to pretty-printing, equivalent to cells:pretty
-|===============================================================================================================
-
-Column order (`cols` option) has the following format:
-
-<col-order-string> := <col-def>[,<col-def>]*
-
-<col-def> := <col-name> [ '[' <col-opts> ']' ]
-
-<col-name> is a string that does not contain comma ',' or '[',']' brackets
-
-<col-opts> := <string> [ ',' <string> ]
-
-Where <col-opts> is a comma-separated list of options.
-
-Column delimiter option (`col-delim`) can be an arbitrary string. The
-cell format option `cells` can have one of the possible three values:
-1) `pretty`, 2) `default`, 3) `raw`. The `raw` and `pretty` value of
-`cells` option can be shortcutted as options `raw` and `pretty` with
-no value.
-
-Additionally to standard types (like integer, floating point) there
-are the two following types: 1) size; 2) timestamp. The 'size' type
-has the following case-sensitive column options: `KB`, `MB`, `GB`,
-`TB`, `auto`, e.g., a column of type size and name `file-size` can be
-specified as `file-size[MB]` or `file-size[auto]`.  The 'timestamp'
-has the following case-sensitive column options: 1) `datetime` which
-corresponds to date(1) format "%F %T", 2) `timestamp` which
-corresponds to a number of seconds relative to start of some epoch.
-
-Description of table formats
------------------------------
-
-'human-readable': prints columns separated by single space, rows
-separated by newline '\n'.
-
-'block-line': prints each column on one line, i.e., the column
-separator is '\n', rows are separated by double newlines
-'\n\n'. Therefore, rows forms newline separated blocks of rows.
-
-'machine-readable': prints columns separated by a tabulator '\t', rows
-separated by '\n'.
-