Blame Manuals/en/Texinfo/Repository/trunk/Scripts/Bash/Functions/Render/Config.texi

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