.. / download
.\" Automatically generated by Pandoc 2.9.2.1
.\"
.TH "s1kd-defaults" "1" "2021-04-16" "" "s1kd-tools"
.hy
.SH NAME
.PP
s1kd-defaults - \f[C].defaults\f[R], \f[C].dmtypes\f[R] and
\f[C].fmtypes\f[R] files management tool
.SH SYNOPSIS
.IP
.nf
\f[C]
s1kd-defaults [-DdFfisth?] [-b <BREX>] [-j <map>]
              [-n <name> -v <value> ...] [-o <dir>] [<file>...]
\f[R]
.fi
.SH DESCRIPTION
.PP
The \f[I]s1kd-defaults\f[R] tool generates a basic \f[C].defaults\f[R]
file for a new CSDB, which is used by several of the other s1kd-tools to
determine default values for S1000D metadata.
It also provides a way to convert between the simple text and XML
formats of the \f[C].defaults\f[R], \f[C].dmtypes\f[R] and
\f[C].fmtypes\f[R] files.
.SH OPTIONS
.TP
-b, --brex <BREX>
Use the specified BREX data module to build the \f[C].defaults\f[R] and
\f[C].dmtypes\f[R] files.
This can be used both when initializing a new CSDB (-i) or either file
can be generated from a BREX data module separately.
.TP
-D, --dmtypes
Convert a \f[C].dmtypes\f[R] file.
.TP
-d, --defaults
Convert a \f[C].defaults\f[R] file.
.TP
-F, --fmtypes
Convert a \f[C].fmtypes\f[R] file.
.TP
-f, --overwrite
Overwrite the existing file after conversion.
.TP
-h, -?, --help
Show help/usage message.
.TP
-i, --init
Initialize a new CSDB by generating the \f[C].defaults\f[R],
\f[C].dmtypes\f[R] and \f[C].fmtypes\f[R] files in the current
directory.
.TP
-J, --dump-brexmap
Dump the default \f[C].brexmap\f[R] file to stdout.
.TP
-j, --brexmap <map>
Use a custom \f[C].brexmap\f[R] file to map a BREX DM to a
\f[C].defaults\f[R] or \f[C].dmtypes\f[R] file.
.TP
-n, --name <name>
The name of a specific default key to set a value for.
The value must be specified after this option with -v.
Multiple pairs of -n and -v can be specified to set multiple default
values.
.TP
-o, --dir <dir>
Initialize or manage configuration files in <dir> instead of the current
directory.
If <dir> does not exist, it will be created.
.TP
-s, --sort
Sort the entries alphabetically for either file/output format.
.TP
-t, --text
Output using the simple text format.
Otherwise, the XML format is used by default.
.TP
-v, --value <value>
The new value to set for the default key specified with -n.
This option must be specified after -n.
.TP
--version
Show version information.
.TP
<file>...
Names of files to convert.
If none are specified, the default names of \f[C].defaults\f[R] (for the
-d option), \f[C].dmtypes\f[R] (for the -D option) or \f[C].fmtypes\f[R]
(for the -F option) in the current directory are used.
.PP
In addition, the following options allow configuration of the XML
parser:
.TP
--dtdload
Load the external DTD.
.TP
--huge
Remove any internal arbitrary parser limits.
.TP
--net
Allow network access to load external DTD and entities.
.TP
--noent
Resolve entities.
.TP
--parser-errors
Emit errors from parser.
.TP
--parser-warnings
Emit warnings from parser.
.TP
--xinclude
Do XInclude processing.
.TP
--xml-catalog <file>
Use an XML catalog when resolving entities.
Multiple catalogs may be loaded by specifying this option multiple
times.
.SS \f[C].brexmap\f[R] file
.PP
This file specifies a mapping between BREX structure object rules and
\f[C].defaults\f[R] and \f[C].dmtypes\f[R] files.
The path to an object can be written in many different ways in a BREX
rule, so the \f[C].brexmap\f[R] file allows any project\[aq]s BREX to be
used to generate these files without having to modify the BREX data
module itself.
.PP
By default, the program will search for a file named \f[C].brexmap\f[R]
in the current directory and parent directories, but any file can be
specified using the -j option.
If there is no \f[C].brexmap\f[R] file and the -j option is not
specified, a default mapping will be used.
.PP
Example of \f[C].brexmap\f[R] file:
.IP
.nf
\f[C]
<brexMap>
<dmtypes path=\[dq]//\[at]infoCode\[dq]/>
<default path=\[dq]//\[at]languageIsoCode\[dq] ident=\[dq]languageIsoCode\[dq]/>
<default path=\[dq]//\[at]countryIsoCode\[dq] ident=\[dq]countryIsoCode\[dq]/>
</brexMap>
\f[R]
.fi
.PP
More exact matches can be made by using the attribute \f[C]id\f[R] on
the \f[C]<dmtypes>\f[R] or \f[C]<default>\f[R] elements.
This overrides the \f[C]path\f[R] attribute, and will only match a BREX
rule with the specified ID.
.SH EXAMPLES
.SS Initialize a new CSDB, using the XML format
.IP
.nf
\f[C]
$ mkdir mycsdb
$ cd mycsdb
$ s1kd-defaults -i
\f[R]
.fi
.SS Initialize a new CSDB, using the simple text format
.IP
.nf
\f[C]
$ mkdir mycsdb
$ cd mycsdb
$ s1kd-defaults -ti
\f[R]
.fi
.SS Generate a custom-named \f[C].defaults\f[R] file
.IP
.nf
\f[C]
$ s1kd-defaults > custom-defaults.xml
\f[R]
.fi
.SS Convert a simple text formatted file to XML
.IP
.nf
\f[C]
$ s1kd-defaults -df
\f[R]
.fi
.SS Sort entries and output in text format
.IP
.nf
\f[C]
$ s1kd-defaults -dts custom-defaults.txt
\f[R]
.fi
.SS Set a default value in the current \f[C].defaults\f[R] file
.IP
.nf
\f[C]
$ s1kd-defaults -df -n issue -v 5.0
\f[R]
.fi
.SH AUTHORS
khzae.net.


gopher://khzae.net/0/s1kd/s1kd-tools/src/tools/s1kd-defaults/doc/s1kd-defaults.1
Styles: Light Dark Classic