Blame Manuals/Repository/repository-html/repository_61.html

4c79b5
4c79b5
<html>
ccb7a3
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
-->
bf28e1
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>
d11e55
<title>CentOS Artwork Repository: 3.58 trunk/Scripts/Bash/Functions/Svg</title>
4c79b5
d11e55
<meta name="description" content="CentOS Artwork Repository: 3.58 trunk/Scripts/Bash/Functions/Svg">
d11e55
<meta name="keywords" content="CentOS Artwork Repository: 3.58 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
300762
d11e55
[ < ]
d11e55
[ > ]
4c79b5
   
38bcd9
[ << ]
38bcd9
[ Up ]
d11e55
[ >> ]
4c79b5
   
4c79b5
   
4c79b5
   
4c79b5
   
4c79b5
[Top]
4c79b5
[Contents]
d11e55
[Index]
4c79b5
[ ? ]
4c79b5
d11e55
af3979
d11e55

3.58 trunk/Scripts/Bash/Functions/Svg

2dc146
c2a1bc
af3979
d11e55

3.58.1 Goals

7e35dc
d11e55

This section exists to organize files related to svg

d11e55
functionality of <tt>`centos-art.sh'</tt> script.
7e35dc

7e35dc
af3979
d11e55

3.58.2 Description

c2a1bc
d11e55

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

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

d11e55
7e35dc
af3979
d11e55

3.58.2.1 Metadata maintainance

7e35dc
d11e55

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

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

d11e55

The metadata template was created using the metadata information of a

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

d11e55

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

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

d11e55

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

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

d11e55

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

2dc146

2dc146
d11e55
<samp>`Title'</samp>
d11e55

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

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

d11e55
d11e55
<samp>`Date'</samp>
d11e55

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

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

7fa1fb
d11e55
<samp>`Creator'</samp>
d11e55

Name of entity primarily responsible for making the content of this

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

bf28e1
d11e55
<samp>`Rights'</samp>
d11e55

Name of entity with rights to the intellectual Property of this

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

bf28e1
d11e55
<samp>`Publisher'</samp>
d11e55

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

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

d11e55
d11e55
<samp>`Identifier'</samp>
d11e55

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

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

d11e55
d11e55
<samp>`Source'</samp>
d11e55

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

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

bf28e1
d11e55
<samp>`Relation'</samp>
d11e55

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

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

d11e55
d11e55
<samp>`Language'</samp>
d11e55

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

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

d11e55
d11e55
<samp>`Keywords'</samp>
d11e55

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

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

d11e55
d11e55
<samp>`Coverage'</samp>
d11e55

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

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

d11e55
d11e55
<samp>`Description'</samp>
d11e55

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

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

7e35dc
d11e55
<samp>`Contributors'</samp>
d11e55

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

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

7e35dc
c2a1bc
d11e55

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

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

d11e55
7e35dc
af3979
d11e55

3.58.2.2 Unused definitions

d11e55
d11e55

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

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

d11e55

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

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

d11e55

To remove unused definitions from several scalable vector graphics

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

d11e55
d11e55
008ee0

3.58.3 Usage

2c8180
2dc146
d11e55
centos-art svg --update-metadata='path/to/dir'
d11e55
centos-art svg --update-metadata='path/to/dir' --filter='regex'
d11e55

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

d11e55
under <samp>`path/to/dir'</samp> directory.
2dc146

2dc146
d11e55
centos-art svg --vacuum-defs='path/to/dir'
d11e55
centos-art svg --vacuum-defs='path/to/dir' --filter='regex'
d11e55

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

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

2dc146
2dc146
d11e55

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

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

d11e55
Warning

Warning

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

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

d11e55
d11e55

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

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

d11e55

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

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

2c8180
d11e55
008ee0

3.58.4 See also

2c8180
4a9d2a
d11e55
3.49 trunk/Scripts/Bash  
4a9d2a
d11e55
3.50 trunk/Scripts/Bash/Functions  
4a9d2a
4a9d2a
c9b54d
035049
300762
d11e55
[ < ]
d11e55
[ > ]
300762
   
38bcd9
[ << ]
d11e55
[ Up ]
d11e55
[ >> ]
300762
4c79b5

4c79b5
 <font size="-1">
bf28e1
  This document was generated on February, 27 2011 using texi2html 1.76.
4c79b5
 </font>
4c79b5
 
4c79b5
4c79b5

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