From: Pavel Charvat Date: Sun, 10 Aug 2014 14:15:03 +0000 (+0000) Subject: Doc: Generalized makefile rules for all categories of manpages. X-Git-Tag: v6.1.1~10 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=c62955e1ffb10b8eb723b22ddd9ed22991ce33b4;p=libucw.git Doc: Generalized makefile rules for all categories of manpages. --- diff --git a/build/Makebottom b/build/Makebottom index 7e2fea64..bb8c67d0 100644 --- a/build/Makebottom +++ b/build/Makebottom @@ -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 diff --git a/ucw/doc/Makefile b/ucw/doc/Makefile index d5420930..6cd6ce49 100644 --- a/ucw/doc/Makefile +++ b/ucw/doc/Makefile @@ -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 index 00000000..af9d75d9 --- /dev/null +++ b/ucw/doc/ucw-tableprinter.1.txt @@ -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: + + := [,]* + + := [ '[' ']' ] + + is a string that does not contain comma ',' or '[',']' brackets + + := [ ',' ] + +Where 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 index af9d75d9..00000000 --- a/ucw/doc/ucw-tableprinter.txt +++ /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: - - := [,]* - - := [ '[' ']' ] - - is a string that does not contain comma ',' or '[',']' brackets - - := [ ',' ] - -Where 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'. -