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

4c79b5
4c79b5
<html>
6414c4
09d4f2
6414c4
Copyright C 2009, 2010, 2011  Alain Reguera Delgado
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
-->
92fb7f
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>
c489c0
<title>The CentOS Artwork Repository: 3.45 trunk/Scripts/Bash/Functions/Svg</title>
4c79b5
c489c0
<meta name="description" content="The CentOS Artwork Repository: 3.45 trunk/Scripts/Bash/Functions/Svg">
c489c0
<meta name="keywords" content="The CentOS Artwork Repository: 3.45 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
01b527
[ < ]
01b527
[ > ]
4c79b5
   
4c79b5
[ << ]
4c79b5
[ Up ]
c489c0
[ >> ]
4c79b5
   
4c79b5
   
4c79b5
   
4c79b5
   
4c79b5
[Top]
4c79b5
[Contents]
c489c0
[Index]
4c79b5
[ ? ]
4c79b5
c489c0
01b527
c489c0

3.45 trunk/Scripts/Bash/Functions/Svg

2c8180
2c8180
01b527
273af8

3.45.1 Goals

e68a7a
c489c0

This section exists to organize files related to svg

035049
functionality of <tt>`centos-art.sh'</tt> script.
54b5a5

e68a7a
01b527
273af8

3.45.2 Description

60c152
c489c0

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

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

c489c0
c489c0
c489c0
c489c0

3.45.2.1 Metadata maintainance

c489c0
c489c0

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

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

c489c0

The metadata template was created using the metadata information of a

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

c489c0

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

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

c489c0

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

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

c489c0

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

c489c0

c489c0
c489c0
<samp>`Title'</samp>
c489c0

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

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

c489c0
c489c0
<samp>`Date'</samp>
c489c0

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

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

c489c0
c489c0
<samp>`Creator'</samp>
c489c0

Name of entity primarily responsible for making the content of this

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

c489c0
c489c0
<samp>`Rights'</samp>
c489c0

Name of entity with rights to the intellectual Property of this

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

c489c0
c489c0
<samp>`Publisher'</samp>
c489c0

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

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

c489c0
c489c0
<samp>`Identifier'</samp>
c489c0

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

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

c489c0
c489c0
<samp>`Source'</samp>
c489c0

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

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

c489c0
c489c0
<samp>`Relation'</samp>
c489c0

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

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

c489c0
c489c0
<samp>`Language'</samp>
c489c0

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

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

c489c0
c489c0
<samp>`Keywords'</samp>
c489c0

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

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

c489c0
c489c0
<samp>`Coverage'</samp>
c489c0

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

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

c489c0
c489c0
<samp>`Description'</samp>
c489c0

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

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

c489c0
c489c0
<samp>`Contributors'</samp>
c489c0

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

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

c489c0
035049
c489c0

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

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

c489c0
c6292c
c489c0
c489c0

3.45.2.2 Unused definitions

749e81
c489c0

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

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

c489c0

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

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

c489c0

To remove unused definitions from several scalable vector graphics

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

c489c0
c489c0
035049

3.45.3 Usage

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

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

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

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

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

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

e37211
e68a7a
035049

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

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

035049
Warning

Warning

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

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

035049
c489c0

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

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

035049

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

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

e37211
c489c0
300762

3.45.4 See also

4c79b5
2c8180
c489c0
3.36 trunk/Scripts/Bash  
54b5a5
c489c0
3.37 trunk/Scripts/Bash/Functions  
2c8180
2c8180
4c79b5
4c79b5
4c79b5
c489c0
[ < ]
c489c0
[ > ]
4c79b5
   
4c79b5
[ << ]
01b527
[ Up ]
c489c0
[ >> ]
4c79b5
4c79b5

4c79b5
 <font size="-1">
92fb7f
  This document was generated on January, 5 2011 using texi2html 1.76.
4c79b5
 </font>
4c79b5
 
4c79b5
4c79b5

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