Blame Manual/Directories/trunk/Scripts/Functions/Render/Config.texi

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