Blob Blame History Raw
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
<html>
<!--This manual describes what the CentOS Artwork Repository is and what
can you do inside it.

Copyright C 2009, 2010 CentOS Artwork SIG. All rights
reserved.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with no
Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A
copy of the license is included in the section entitled GNU Free
Documentation License.  
-->
<!-- Created on October, 19 2010 by texi2html 1.76 -->
<!--
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
            Karl Berry  <karl@freefriends.org>
            Olaf Bachmann <obachman@mathematik.uni-kl.de>
            and many others.
Maintained by: Many creative people <dev@texi2html.cvshome.org>
Send bugs and suggestions to <users@texi2html.cvshome.org>

-->
<head>
<title>CentOS Artwork Repository: 3.46 trunk/Scripts/Bash/Functions/Render/Config</title>

<meta name="description" content="CentOS Artwork Repository: 3.46 trunk/Scripts/Bash/Functions/Render/Config">
<meta name="keywords" content="CentOS Artwork Repository: 3.46 trunk/Scripts/Bash/Functions/Render/Config">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="texi2html 1.76">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
<!--
@import "/home/centos/artwork/trunk/Identity/Models/Css/Texi2html/common.css";

a.summary-letter {text-decoration: none}
pre.display {font-family: serif}
pre.format {font-family: serif}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: serif; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: serif; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.sansserif {font-family:sans-serif; font-weight:normal;}
ul.toc {list-style: none}
-->
</style>


</head>

<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">

<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="repository_48.html#SEC241" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC243" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="repository_3.html#SEC3" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="repository_3.html#SEC3" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="repository_67.html#SEC350" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="repository.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="repository_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="repository_67.html#SEC350" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="repository_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="trunk-Scripts-Bash-Functions-Render-Config"></a>
<a name="SEC242"></a>
<h2 class="section"> 3.46 trunk/Scripts/Bash/Functions/Render/Config </h2>


<a name="SEC243"></a>
<h3 class="subsection"> 3.46.1 Goals </h3>

<p>The <tt>`trunk/Scripts/Bash/Config'</tt> directory exists to oraganize
pre-rendering configuration scripts.
</p>

<a name="SEC244"></a>
<h3 class="subsection"> 3.46.2 Description </h3>

<p>Pre-rendering configuration scripts let you customize the way
<code>centos-art.sh</code> script renders identity and translation
repository entries.  Pre-rendering configuration scripts are
<tt>`render.conf.sh'</tt> files with <code>render_loadConfig</code> function
definition inside. 
</p>
<p>There is one <tt>`render.conf.sh'</tt> 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. 
</p>

<a name="SEC245"></a>
<h4 class="subsubsection"> 3.46.2.1 The <tt>`render.conf.sh'</tt> identity model </h4>

<p>Inside CentOS Artwork Repository, we consider identity entries to all
directories under <tt>`trunk/Identity'</tt> 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.
</p>
<p>Inside identity pre-rendering configuration scripts, image-based
pre-rendering configuration scripts look like the following:
</p>
<pre class="verbatim">#!/bin/bash

function render_loadConfig {

    # Define rendering actions.
    ACTIONS[0]='BASE:renderImage'
    ACTIONS[1]='POST:renderFormats: tif xpm pdf ppm'

}
</pre>
<p>Inside identity pre-rendering configuration scripts, text-based
pre-rendering configuration scripts look like the following:
</p>
<pre class="verbatim">#!/bin/bash

function render_loadConfig {

    # Define rendering actions.
    ACTIONS[0]='BASE:renderText'
    ACTIONS[1]='POST:formatText: --width=70 --uniform-spacing'

}
</pre>
<p>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. 
</p>

<a name="SEC246"></a>
<h4 class="subsubsection"> 3.46.2.2 The <tt>`render.conf.sh'</tt> translation model </h4>

<p>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.
</p>

<a name="SEC247"></a>
<h4 class="subsubsection"> 3.46.2.3 The <tt>`render.conf.sh'</tt> rendering actions </h4>

<p>Inside both image-based and text-based identity pre-rendering
configuration scripts, we use the <samp>`ACTIONS'</samp> array variable to
define the way <code>centos-art.sh</code> script performs identity
rendering.  Identity rendering is organized by one <samp>`BASE'</samp> action,
and optional <samp>`POST'</samp> and <samp>`LAST'</samp> rendering actions.
</p>
<p>The <samp>`BASE'</samp> action specifies what kind of rendering does the
<code>centos-art.sh</code> script will perform with the files related to
the pre-rendering configuration script. The <samp>`BASE'</samp> action is
required. Possible values to <samp>`BASE'</samp> action are either
<samp>`renderImage'</samp> or <samp>`renderText'</samp> only.
</p>
<p>To specify the <samp>`BASE'</samp> action you need to set the <samp>`BASE:'</samp>
string followed by one of the possible values. For example, if you
want to render images, consider the following definition of
<samp>`BASE'</samp> action:
</p>
<pre class="verbatim">ACTIONS[0]='BASE:renderImage'
</pre>
<p>Only one <samp>`BASE'</samp> action must be specified. If more than one
<samp>`BASE'</samp> action is specified, the last one is used. If no
<samp>`BASE'</samp> action is specified at all, an error is triggered and the
<code>centos-art.sh</code> script ends its execution.
</p>
<p>The <samp>`POST'</samp> 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'</samp> actions to apply many different
actions over the same already rendered file. Possible values to
<samp>`POST'</samp> action are <samp>`renderFormats'</samp>, <samp>`renderSyslinux'</samp>,
<samp>`renderGrub'</samp>, etc. 
</p>
<p>To specify the <samp>`POST'</samp> action, you need to use set the
<samp>`POST:'</samp> 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>, <samp>`jpg'</samp>, and
<samp>`tif'</samp> images, based on already rendered <samp>`png'</samp> image, and
also organize the produced files in directories named as their own
extensions:
</p>
<pre class="verbatim">ACTIONS[0]='BASE:renderImage'
ACTIONS[1]='POST:renderFormats: xpm jpg tif'
ACTIONS[2]='POST:groupByFormat: png xpm jpg tif'
</pre>
<p>In the previous example, file organization takes place at the moment
of rendering, just after producing the <samp>`png'</samp> 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'</samp> action line:
</p>
<pre class="verbatim">ACTIONS[0]='BASE:renderImage'
ACTIONS[1]='POST:renderFormats: xpm jpg tif'
</pre>
<p>The <samp>`LAST'</samp> action specifies which actions to apply once the last
file in the list of files to process has been rendered. The
<samp>`LAST'</samp> action is optional. Possible values for <samp>`LAST'</samp>
actions may be <samp>`groupByFormat'</samp>, <samp>`renderGdmTgz'</samp>, etc.
</p>
<blockquote class="blue"><img src="/home/centos/artwork/trunk/Identity/Widgets/Img/icon-admonition-info.png" alt="info"><h3>Note</h3><p> See section <a href="repository_48.html#SEC237">trunk/Scripts/Bash/Functions/Render</a>, to know more
about possible values for <samp>`BASE'</samp>, <samp>`POST'</samp> and <samp>`LAST'</samp>
action definitions.
</p></blockquote>

<p>To specify the <samp>`LAST'</samp> action, you need to set the <samp>`LAST:'</samp>
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:
</p>
<pre class="verbatim">ACTIONS[0]='BASE:renderImage'
ACTIONS[1]='POST:renderFormats: xpm jpg tif'
ACTIONS[2]='LAST:groupByformat: png xpm jpg tif'
</pre>

<a name="SEC248"></a>
<h3 class="subsection"> 3.46.3 Usage </h3>

<p>Use the following commands to administer both identity and translation
pre-rendering configuration scripts:
</p>
<dl compact="compact">
<dt> <samp>`centos-art config 'path/to/dir/' --create'</samp></dt>
<dd>
<p>Use this command to create <samp>`path/to/dir'</samp> related pre-rendering
configuration script.
</p>
</dd>
<dt> <samp>`centos-art config 'path/to/dir/' --edit'</samp></dt>
<dd>
<p>Use this command to edit <samp>`path/to/dir'</samp> related pre-rendering
configuration script.  
</p>
</dd>
<dt> <samp>`centos-art config 'path/to/dir/' --read'</samp></dt>
<dd>
<p>Use this command to read <samp>`path/to/dir'</samp> related pre-rendering
configuration script.  
</p>
</dd>
<dt> <samp>`centos-art config 'path/to/dir/' --remove'</samp></dt>
<dd>
<p>Use this command to remove <samp>`path/to/dir'</samp> related pre-rendering
configuration script.
</p>
</dd>
</dl>

<p>In the commands above, <samp>`path/to/dir'</samp> refers to one renderable
directory path under <tt>`trunk/Identity'</tt> or
<tt>`trunk/Translations'</tt> structures only. 
</p>

<a name="SEC249"></a>
<h3 class="subsection"> 3.46.4 See also </h3>

<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="repository_38.html#SEC207">3.35 trunk/Scripts/Bash/Config/Identity</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="repository_39.html#SEC212">3.36 trunk/Scripts/Bash/Config/Translations</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="repository_37.html#SEC195">3.34 trunk/Scripts/Bash</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>


<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC248" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="repository_50.html#SEC250" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="repository_3.html#SEC3" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC242" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="repository_67.html#SEC350" title="Next chapter"> &gt;&gt; </a>]</td>
</tr></table>
<p>
 <font size="-1">
  This document was generated on <i>October, 19 2010</i> using <a href="http://texi2html.cvshome.org/"><i>texi2html 1.76</i></a>.
 </font>
 <br>

</p>
</body>
</html>