Blame Identity/Manual/repository-xhtml/repository_80.xhtml

c8f7b7
728c6d
728c6d
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
728c6d
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
728c6d
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
9bfd15
<head>
9bfd15
a6f1b3
    <title>CentOS Artwork Repository: 2.73 The trunk/Scripts/Functions/Svg Directory</title>
c8f7b7
c8f7b7
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
a6f1b3
    <meta name="description" content="CentOS Artwork Repository: 2.73 The trunk/Scripts/Functions/Svg Directory" />
a6f1b3
    <meta name="keywords" content="CentOS Artwork Repository: 2.73 The trunk/Scripts/Functions/Svg Directory" />
728c6d
    <meta name="resource-type" content="document" />
728c6d
    <meta name="distribution" content="global" />
728c6d
    <meta name="generator" content="texi2html 1.76" />
728c6d
    <meta name="copyright" content="2009-2011 Alain Reguera Delgado" />
9bfd15
c8f7b7
    <link href="/home/centos/artwork/trunk/Identity/Manual/repository.css" rel="stylesheet" type="text/css" media="screen projection" />
9bfd15
9bfd15
</head>
9bfd15
728c6d
<body>
9bfd15
728c6d
728c6d
728c6d
728c6d
728c6d
    
728c6d
728c6d
        
c8f7b7
a6f1b3
9bfd15
a6f1b3
[ < ]
a6f1b3
[ > ]
9bfd15
   
c8f7b7
[ << ]
a6f1b3
[ Up ]
a6f1b3
[ >> ]
9bfd15
   
9bfd15
   
9bfd15
   
9bfd15
   
c8f7b7
[Top]
c8f7b7
[Contents]
a6f1b3
[Index]
c8f7b7
[ ? ]
9bfd15
a6f1b3
a6f1b3
a6f1b3

2.73 The <tt>`trunk/Scripts/Functions/Svg'</tt> Directory

a6f1b3
a6f1b3

a6f1b3
a6f1b3

2.73.1 Goals

a6f1b3
a6f1b3

This section exists to organize files related to svg

a6f1b3
functionality of <tt>`centos-art.sh'</tt> script.
a6f1b3

a6f1b3

ed9de5
a6f1b3

2.73.2 Description

a6f1b3
a6f1b3

The svg functionality of <tt>`centos-art.sh'</tt> script helps you

a6f1b3
to maintain scalable vector graphics (SVG) inside repository. For
a6f1b3
example, suppose you've been working in CentOS default design models
a6f1b3
under <tt>`trunk/Identity/Themes/Models/'</tt>, and you want to set common
a6f1b3
metadata to all of them, and later remove all unused SVG defintions
a6f1b3
from <samp>`*.svg'</samp> files. Doing so file by file may be a tedious task,
a6f1b3
so the <tt>`centos-art.sh'</tt> script provides the svg
a6f1b3
functionality to aid you maintain such actions.
a6f1b3

a6f1b3
a6f1b3

a6f1b3
a6f1b3

2.73.2.1 Metadata maintainance

a6f1b3
a6f1b3

The metadata used is defined by Inkscape 0.46 using the SVG standard

a6f1b3
markup. The <tt>`centos-art.sh'</tt> script replaces everything
a6f1b3
in-between <metadata and </metadata> tags with a
a6f1b3
predefined metadata template we've set for this purpose.
a6f1b3

a6f1b3

The metadata template was created using the metadata information of a

a6f1b3
file which, using Inkscape 0.46, all metadata fields were set. This
a6f1b3
created a complete markup representation of how SVG metadata would
a6f1b3
look like. Later, we replaced every single static value with a
a6f1b3
translation marker in the form <samp>`=SOMETEXT='</samp>, where
a6f1b3
SOMETEXT is the name of its main opening tag. Later, we
a6f1b3
transform the metadata template into a sed replacement set of commads
a6f1b3
escaping new lines at the end of each line.
a6f1b3

a6f1b3

With metadata template in place, the <tt>`centos-art.sh'</tt> script uses

a6f1b3
it to create a metadata template instance for the file being processed
a6f1b3
currently.  The metadata template instance contains the metadata
a6f1b3
portion of sed replacement commands with translation markers already
a6f1b3
traduced.  In this action, instance creation, is where we take
a6f1b3
advantage of automation and generate metadata values like title, date,
a6f1b3
keywords, source, identifier, and relation dynamically, based on the
a6f1b3
file path <tt>`centos-art.sh'</tt> script is currently creating metadata
a6f1b3
information for.
a6f1b3

a6f1b3

With metadata template instance in place, the <tt>`centos-art.sh'</tt>

a6f1b3
script uses it to replace real values inside all <samp>`.svg'</samp> files
a6f1b3
under the current location you're running the <tt>`centos-art.sh'</tt>
a6f1b3
script on.  Default behaviour is to ask user to enter each metadatum
a6f1b3
required, one by one. If user leaves metadatum empty, by pressing
a6f1b3
RET key, <tt>`centos-art.sh'</tt> uses its default value.
a6f1b3

a6f1b3

The <tt>`centos-art.sh'</tt> script modifies the following metadata:

a6f1b3

a6f1b3
a6f1b3
<samp>`Title'</samp>
a6f1b3

Name by which this document is formally known. If no value is set

a6f1b3
here, <tt>`centos-art.sh'</tt> script uses the file name as title.
a6f1b3

a6f1b3
a6f1b3
<samp>`Date'</samp>
a6f1b3

Date associated with the creation of this document (YYYY-MM-DD). If no

a6f1b3
value is set here, <tt>`centos-art.sh'</tt> script uses the current date
a6f1b3
information as in date +%Y-%m-%d.
a6f1b3

a6f1b3
a6f1b3
<samp>`Creator'</samp>
a6f1b3

Name of entity primarily responsible for making the content of this

a6f1b3
document. If no value is set here, <tt>`centos-art.sh'</tt> script uses
a6f1b3
the string <samp>`The CentOS Project'</samp>.
a6f1b3

a6f1b3
a6f1b3
<samp>`Rights'</samp>
a6f1b3

Name of entity with rights to the intellectual Property of this

a6f1b3
document. If no value is set here, <tt>`centos-art.sh'</tt> script uses
a6f1b3
the string <samp>`The CentOS Project'</samp>.
a6f1b3

a6f1b3
a6f1b3
<samp>`Publisher'</samp>
a6f1b3

Name of entity responsible for making this document available. If no

a6f1b3
value is set here, <tt>`centos-art.sh'</tt> script uses the string
a6f1b3
<samp>`The CentOS Project'</samp>.
a6f1b3

a6f1b3
a6f1b3
<samp>`Identifier'</samp>
a6f1b3

Unique URI to reference this document. If no value is set here,

a6f1b3
<tt>`centos-art.sh'</tt> script uses the current file path to build the
a6f1b3
related url that points to current file location inside repository
a6f1b3
central server.
a6f1b3

a6f1b3
a6f1b3
<samp>`Source'</samp>
a6f1b3

Unique URI to reference the source of this document. If no value is

a6f1b3
set here, <tt>`centos-art.sh'</tt> script uses current file path to build
a6f1b3
the related url that points to current file location inside repository
a6f1b3
central server.
a6f1b3

a6f1b3
a6f1b3
<samp>`Relation'</samp>
a6f1b3

Unique URI to a related document. If no value is set here,

a6f1b3
<tt>`centos-art.sh'</tt> script uses current file path to build the
a6f1b3
related url that points to current file location inside repository
a6f1b3
central server.
a6f1b3

a6f1b3
a6f1b3
<samp>`Language'</samp>
a6f1b3

Two-letter language tag with optional subtags for the language of this

a6f1b3
document. (e.g. <samp>`en-GB'</samp>). If no value is set here,
a6f1b3
<tt>`centos-art.sh'</tt> script uses the current locale information as in
a6f1b3
cli_getCurrentLocale function.
a6f1b3

a6f1b3
a6f1b3
<samp>`Keywords'</samp>
a6f1b3

The topic of this document as comma-separated key words, prhases, or

a6f1b3
classifications. If no value is set here, <tt>`centos-art.sh'</tt> script
a6f1b3
uses file path to build 
a6f1b3

a6f1b3
a6f1b3
<samp>`Coverage'</samp>
a6f1b3

Extent or scope of this document. If no value is set here,

a6f1b3
<tt>`centos-art.sh'</tt> script uses the string <samp>`The CentOS Project'</samp>.
a6f1b3

a6f1b3
a6f1b3
<samp>`Description'</samp>
a6f1b3

Description about the document. If no value is set here,

a6f1b3
<tt>`centos-art.sh'</tt> script uses uses empty value as default.
a6f1b3

a6f1b3
a6f1b3
<samp>`Contributors'</samp>
a6f1b3

People that contributes in the creation/maintainance of the document.

a6f1b3
If no value is set here, <tt>`centos-art.sh'</tt> script uses uses empty
a6f1b3
value as default.
a6f1b3

a6f1b3
a6f1b3
a6f1b3

The <samp>`License'</samp> metadatum is not set as a choise, by now. It is

a6f1b3
fixed Creative Common Attribution Share-Alike 3.0 License. This is done in order to
a6f1b3
grant license consistency among all SVG files we manage inside CentOS
a6f1b3
Artwork Repository.
a6f1b3

a6f1b3
a6f1b3

a6f1b3
a6f1b3

2.73.2.2 Unused definitions

a6f1b3
a6f1b3

Many of the no-longer-used gradients, patterns, and markers (more

a6f1b3
precisely, those which you edited manually) remain in the
a6f1b3
corresponding palettes and can be reused for new objects. However if
a6f1b3
you want to optimize your document, use the <samp>`Vacuum Defs'</samp> command
a6f1b3
in <samp>`File'</samp> menu. It will remove any gradients, patterns, or
a6f1b3
markers which are not used by anything in the document, making the
a6f1b3
file smaller. 
a6f1b3

a6f1b3

If you have one or two couple of files, removing unused definitions

a6f1b3
using the graphical interface may be enough to you.  In contrast, if
a6f1b3
you have dozens or even houndreds of scalable vector graphics files to
a6f1b3
maintain it is not a fun task to use the graphical interface to remove
a6f1b3
unused definitions editing those files one by one.
a6f1b3

a6f1b3

To remove unused definitions from several scalable vector graphics

a6f1b3
files, the <tt>`centos-art.sh'</tt> script uses Inkscape command-line
a6f1b3
interface, specifically with the <samp>`--vaccum-defs'</samp> option.
a6f1b3

a6f1b3

a6f1b3
a6f1b3

2.73.3 Usage

a6f1b3
a6f1b3
a6f1b3
centos-art svg --update-metadata='path/to/dir'
a6f1b3
centos-art svg --update-metadata='path/to/dir' --filter='regex'
a6f1b3

Use these commands to update metadata information to <samp>`.svg'</samp> files

a6f1b3
under <samp>`path/to/dir'</samp> directory.
a6f1b3

a6f1b3
a6f1b3
centos-art svg --vacuum-defs='path/to/dir'
a6f1b3
centos-art svg --vacuum-defs='path/to/dir' --filter='regex'
a6f1b3

Use these commands to remove unused definitions inside <samp>`.svg'</samp>

a6f1b3
files under <samp>`path/to/dir'</samp> directory. 
a6f1b3

a6f1b3
a6f1b3
a6f1b3

When you provide <samp>`--filter='regex''</samp> argument, the list of files

a6f1b3
to process is reduced as specified in <samp>`regex'</samp> regular expression.
a6f1b3
Inside <tt>`centos-art.sh'</tt> script, the <samp>`regex'</samp> regular
a6f1b3
expression is used in combination with find command to look
a6f1b3
for files matching the regular expression path pattern.
a6f1b3

a6f1b3
Warning

Warning

In order for <samp>`regex'</samp> regular expression to match

a6f1b3
a file, the <samp>`regex'</samp> regular expresion must match the whole file
a6f1b3
path not just the file name. 
a6f1b3

a6f1b3
a6f1b3

For example, if you want to match all <tt>`summary.svg'</tt> files inside

a6f1b3
<tt>`path/to/dir'</tt>, use the .+/summary regular expression.
a6f1b3
Later, <tt>`centos-art.sh'</tt> script uses this value inside
a6f1b3
^$REGEX\.svg$ expression in order to build the final regular
a6f1b3
expression (i.e., ^.+/summary\.svg$) that is evaluated against
a6f1b3
available file paths inside the list of files to process.
a6f1b3

a6f1b3

Exceptionally, when you provide <samp>`--filter='regex''</samp> in the way

a6f1b3
that <samp>`regex'</samp>, appended to <samp>`path/to/dir/'</samp> (i.e.
a6f1b3
<samp>`path/to/dir/regex'</samp>), matches a regular file; the
a6f1b3
<tt>`centos-art.sh'</tt> script uses the file matching as only file in the
a6f1b3
list of files to process. 
a6f1b3

a6f1b3

a6f1b3
a6f1b3

2.73.4 See also

a6f1b3
a6f1b3
a6f1b3
2.62 The <tt>`trunk/Scripts'</tt> Directory  
a6f1b3
52772c
a6f1b3
728c6d

9bfd15
a6f1b3
[ < ]
a6f1b3
[ > ]
9bfd15
   
c8f7b7
[ << ]
a6f1b3
[ Up ]
a6f1b3
[ >> ]
9bfd15
9bfd15
728c6d
            

728c6d
728c6d
        
728c6d
728c6d
    
728c6d
728c6d
    

728c6d
728c6d
728c6d
9bfd15
</body>
728c6d
9bfd15
</html>