@subsection Goals
The @file{trunk/Scripts/Bash/Config} directory exists to oraganize
pre-rendering configuration scripts.
@subsection Description
Pre-rendering configuration scripts let you customize the way
@command{centos-art.sh} script renders identity and translation
repository entries. Pre-rendering configuration scripts are
@file{render.conf.sh} files with @command{render_loadConfig} function
definition inside.
There is one @file{render.conf.sh} file for each pre-rendering
configuration entry. Pre-rendering configuration entries can be based
both on identity and translation repository entires. Pre-rendering
configuration entries are required for each identity entry, but not
for translation entries.
@subsubsection The @file{render.conf.sh} identity model
Inside CentOS Artwork Repository, we consider identity entries to all
directories under @file{trunk/Identity} directory. Identity entries can be
image-based or text-based. When you render image-based identity
entries you need to use image-based pre-rendering configuration
scripts. Likewise, when you render text-based identity entries you
need to use text-based pre-rendering configuration scripts.
Inside identity pre-rendering configuration scripts, image-based
pre-rendering configuration scripts look like the following:
@verbatim
#!/bin/bash
function render_loadConfig {
# Define rendering actions.
ACTIONS[0]='BASE:renderImage'
ACTIONS[1]='POST:renderFormats: tif xpm pdf ppm'
}
@end verbatim
Inside identity pre-rendering configuration scripts, text-based
pre-rendering configuration scripts look like the following:
@verbatim
#!/bin/bash
function render_loadConfig {
# Define rendering actions.
ACTIONS[0]='BASE:renderText'
ACTIONS[1]='POST:formatText: --width=70 --uniform-spacing'
}
@end verbatim
When using identity pre-rendering configuration scripts, you can
extend both image-based and text-based pre-rendering configuration
scripts using image-based and text-based post-rendering actions,
respectively.
@subsubsection The @file{render.conf.sh} translation model
Translation pre-rendering configuration scripts take precedence before
default translation rendering action. Translation pre-rendering
actions are useful when default translation rendering action do not
fit itself to translation entry rendering requirements.
@subsubsection The @file{render.conf.sh} rendering actions
Inside both image-based and text-based identity pre-rendering
configuration scripts, we use the @samp{ACTIONS} array variable to
define the way @command{centos-art.sh} script performs identity
rendering. Identity rendering is organized by one @samp{BASE} action,
and optional @samp{POST} and @samp{LAST} rendering actions.
The @samp{BASE} action specifies what kind of rendering does the
@command{centos-art.sh} script will perform with the files related to
the pre-rendering configuration script. The @samp{BASE} action is
required. Possible values to @samp{BASE} action are either
@samp{renderImage} or @samp{renderText} only.
To specify the @samp{BASE} action you need to set the @samp{BASE:}
string followed by one of the possible values. For example, if you
want to render images, consider the following definition of
@samp{BASE} action:
@verbatim
ACTIONS[0]='BASE:renderImage'
@end verbatim
Only one @samp{BASE} action must be specified. If more than one
@samp{BASE} action is specified, the last one is used. If no
@samp{BASE} action is specified at all, an error is triggered and the
@command{centos-art.sh} script ends its execution.
The @samp{POST} action specifies which action to apply for
each file rendered (at the rendering time). This action is optional.
You can set many different @samp{POST} actions to apply many different
actions over the same already rendered file. Possible values to
@samp{POST} action are @samp{renderFormats}, @samp{renderSyslinux},
@samp{renderGrub}, etc.
To specify the @samp{POST} action, you need to use set the
@samp{POST:} followed by the function name of the action you want to
perform. The exact form depends on your needs. For example, consider
the following example to produce @samp{xpm}, @samp{jpg}, and
@samp{tif} images, based on already rendered @samp{png} image, and
also organize the produced files in directories named as their own
extensions:
@verbatim
ACTIONS[0]='BASE:renderImage'
ACTIONS[1]='POST:renderFormats: xpm jpg tif'
ACTIONS[2]='POST:groupByFormat: png xpm jpg tif'
@end verbatim
In the previous example, file organization takes place at the moment
of rendering, just after producing the @samp{png} base file and before
going to the next file in the list of files to render. If you don't
want to organized the produced files in directories named as their own
extensions, just remove the @samp{POST:groupByFormat} action line:
@verbatim
ACTIONS[0]='BASE:renderImage'
ACTIONS[1]='POST:renderFormats: xpm jpg tif'
@end verbatim
The @samp{LAST} action specifies which actions to apply once the last
file in the list of files to process has been rendered. The
@samp{LAST} action is optional. Possible values for @samp{LAST}
actions may be @samp{groupByFormat}, @samp{renderGdmTgz}, etc.
@quotation
@strong{Note} --- @strong{Removed}(xref:trunk Scripts Bash Functions Render) ---, to know more
about possible values for @samp{BASE}, @samp{POST} and @samp{LAST}
action definitions.
@end quotation
To specify the @samp{LAST} action, you need to set the @samp{LAST:}
string followed by the function name of the action you want to
perform. For example, consider the following example if you want to
render all files first and organize them later:
@verbatim
ACTIONS[0]='BASE:renderImage'
ACTIONS[1]='POST:renderFormats: xpm jpg tif'
ACTIONS[2]='LAST:groupByformat: png xpm jpg tif'
@end verbatim
@subsection Usage
Use the following commands to administer both identity and translation
pre-rendering configuration scripts:
@table @samp
@item centos-art config --create='path/to/dir/'
Use this command to create @samp{path/to/dir} related pre-rendering
configuration script.
@item centos-art config --edit='path/to/dir/'
Use this command to edit @samp{path/to/dir} related pre-rendering
configuration script.
@item centos-art config --read='path/to/dir/'
Use this command to read @samp{path/to/dir} related pre-rendering
configuration script.
@item centos-art config --remove='path/to/dir/'
Use this command to remove @samp{path/to/dir} related pre-rendering
configuration script.
@end table
In the commands above, @samp{path/to/dir} refers to one renderable
directory path under @file{trunk/Identity} or
@file{trunk/Translations} structures only.
@subsection See also
@menu
* Directories trunk Scripts::
@comment --- Removed(* Directories trunk Scripts Functions::) ---
@comment --- Removed(* Directories trunk Scripts Functions Render::) ---
@end menu