Blame Manuals/en/Html/Repository/repository_47.html

4c79b5
4c79b5
<html>
09d4f2
09d4f2
09d4f2
The CentOS Artwork Repository exists to organize and automate The
09d4f2
CentOS Project corporate visual identity (, to
09d4f2
start on).
4c79b5
6c4982
Copyright C 2009, 2010 Alain Reguera Delgado. All rights
4c79b5
reserved.
4c79b5
4c79b5
Permission is granted to copy, distribute and/or modify this document
4c79b5
under the terms of the GNU Free Documentation License, Version 1.2 or
4c79b5
any later version published by the Free Software Foundation; with no
4c79b5
Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A
4c79b5
copy of the license is included in the section entitled GNU Free
4c79b5
Documentation License.  
4c79b5
-->
008ee0
4c79b5
4c79b5
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
4c79b5
            Karl Berry  <karl@freefriends.org>
4c79b5
            Olaf Bachmann <obachman@mathematik.uni-kl.de>
4c79b5
            and many others.
4c79b5
Maintained by: Many creative people <dev@texi2html.cvshome.org>
4c79b5
Send bugs and suggestions to <users@texi2html.cvshome.org>
4c79b5
4c79b5
-->
4c79b5
<head>
e68a7a
<title>CentOS Artwork Repository: 3.44 trunk/Scripts/Bash/Functions/Svg</title>
4c79b5
e68a7a
<meta name="description" content="CentOS Artwork Repository: 3.44 trunk/Scripts/Bash/Functions/Svg">
e68a7a
<meta name="keywords" content="CentOS Artwork Repository: 3.44 trunk/Scripts/Bash/Functions/Svg">
4c79b5
<meta name="resource-type" content="document">
4c79b5
<meta name="distribution" content="global">
4c79b5
<meta name="Generator" content="texi2html 1.76">
4c79b5
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4c79b5
<style type="text/css">
4c79b5
1e9202
@import "/home/centos/artwork/trunk/Identity/Models/Css/Texi2html/common.css";
4c79b5
4c79b5
a.summary-letter {text-decoration: none}
4c79b5
pre.display {font-family: serif}
4c79b5
pre.format {font-family: serif}
4c79b5
pre.menu-comment {font-family: serif}
4c79b5
pre.menu-preformatted {font-family: serif}
4c79b5
pre.smalldisplay {font-family: serif; font-size: smaller}
4c79b5
pre.smallexample {font-size: smaller}
4c79b5
pre.smallformat {font-family: serif; font-size: smaller}
4c79b5
pre.smalllisp {font-size: smaller}
4c79b5
span.sansserif {font-family:sans-serif; font-weight:normal;}
4c79b5
ul.toc {list-style: none}
4c79b5
-->
4c79b5
</style>
4c79b5
4c79b5
4c79b5
</head>
4c79b5
4c79b5
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
4c79b5
4c79b5
cbf5a9
[ < ]
cbf5a9
[ > ]
4c79b5
   
4c79b5
[ << ]
4c79b5
[ Up ]
e68a7a
[ >> ]
4c79b5
   
4c79b5
   
4c79b5
   
4c79b5
   
4c79b5
[Top]
4c79b5
[Contents]
e68a7a
[Index]
4c79b5
[ ? ]
4c79b5
e68a7a
cbf5a9
e68a7a

3.44 trunk/Scripts/Bash/Functions/Svg

008ee0
ef356a
cbf5a9
54b5a5

3.44.1 Goals

54b5a5
e68a7a

This section exists to organize files related to svg

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

008ee0
cbf5a9
54b5a5

3.44.2 Description

54b5a5
e68a7a

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

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

e68a7a
e68a7a
e68a7a
e68a7a

3.44.2.1 Metadata maintainance

e68a7a
e68a7a

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

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

e68a7a

The metadata template was created using the metadata information of a

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

e68a7a

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

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

e68a7a

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

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

e68a7a

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

e68a7a

e68a7a
e68a7a
<samp>`Title'</samp>
e68a7a

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

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

e68a7a
e68a7a
<samp>`Date'</samp>
e68a7a

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

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

e68a7a
e68a7a
<samp>`Creator'</samp>
e68a7a

Name of entity primarily responsible for making the content of this

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

e68a7a
e68a7a
<samp>`Rights'</samp>
e68a7a

Name of entity with rights to the intellectual Property of this

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

e68a7a
e68a7a
<samp>`Publisher'</samp>
e68a7a

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

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

e68a7a
e68a7a
<samp>`Identifier'</samp>
e68a7a

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

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

e68a7a
e68a7a
<samp>`Source'</samp>
e68a7a

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

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

e68a7a
e68a7a
<samp>`Relation'</samp>
e68a7a

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

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

e68a7a
e68a7a
<samp>`Language'</samp>
e68a7a

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

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

e68a7a
e68a7a
<samp>`Keywords'</samp>
e68a7a

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

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

e68a7a
e68a7a
<samp>`Coverage'</samp>
e68a7a

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

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

e68a7a
e68a7a
<samp>`Description'</samp>
e68a7a

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

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

e68a7a
e68a7a
<samp>`Contributors'</samp>
e68a7a

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

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

e68a7a
63f275
e68a7a

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

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

e68a7a
008ee0
e68a7a
e68a7a

3.44.2.2 Unused definitions

008ee0
e68a7a

As SVG files grow they may end up with unused definitions inside. For

e68a7a
example, if you stop using a pattern or gradient, tags used to define
e68a7a
them are considered unused definitions then. Inkscape 0.46 brings the
e68a7a
<samp>`Vaccum Defs'</samp> feature to remove those unused definitions from SVG
e68a7a
files. The <samp>`Vaccum Defs'</samp> feature is available both at graphical
e68a7a
interface and command line interface.
e68a7a

e68a7a

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

e68a7a
definitions using graphical interface may be enough to you.  In
e68a7a
contrast, if you have houndred of files to maintain it is not a fun
e68a7a
task to use the gui interface to remove unused SVG definitions editing
e68a7a
those files one by one.
e68a7a

e68a7a

To remove unused SVG definitions from several SVG files, the

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

e68a7a
e68a7a
008ee0

3.44.3 Usage

008ee0
63f275
e68a7a
centos-art svg --update-metadata='path/to/dir'
e68a7a
centos-art svg --update-metadata='path/to/dir' --filter='regex'
e68a7a

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

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

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

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

e68a7a
files under <samp>`path/to/dir'</samp> directory. 
63f275

63f275
2c8180
63f275

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

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

63f275
Warning

Warning

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

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

2c8180
e68a7a

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

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

63f275

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

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

63f275
e68a7a
4c79b5

3.44.4 See also

4c79b5
2c8180
63f275
3.36 trunk/Scripts/Bash  
63f275
63f275
3.37 trunk/Scripts/Bash/Functions  
2c8180
2c8180
4c79b5
4c79b5
4c79b5
e68a7a
[ < ]
e68a7a
[ > ]
4c79b5
   
4c79b5
[ << ]
cbf5a9
[ Up ]
e68a7a
[ >> ]
4c79b5
4c79b5

4c79b5
 <font size="-1">
008ee0
  This document was generated on December, 2 2010 using texi2html 1.76.
4c79b5
 </font>
4c79b5
 
4c79b5
4c79b5

4c79b5
</body>
4c79b5
</html>