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

3.58 trunk/Scripts/Bash/Functions/Svg

2dc146
2dc146
fa7cae
2dc146

3.58.1 Goals

2dc146
fa7cae

This section exists to organize files related to svg

fa7cae
functionality of <tt>`centos-art.sh'</tt> script.
2dc146

2dc146
fa7cae
2dc146

3.58.2 Description

2dc146
fa7cae

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

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

fa7cae
38bcd9
fa7cae
fa7cae

3.58.2.1 Metadata maintainance

2dc146
fa7cae

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

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

fa7cae

The metadata template was created using the metadata information of a

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

fa7cae

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

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

fa7cae

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

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

fa7cae

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

2dc146

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

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

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

fa7cae
fa7cae
<samp>`Date'</samp>
fa7cae

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

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

2dc146
fa7cae
<samp>`Creator'</samp>
fa7cae

Name of entity primarily responsible for making the content of this

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

2dc146
fa7cae
<samp>`Rights'</samp>
fa7cae

Name of entity with rights to the intellectual Property of this

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

2dc146
fa7cae
<samp>`Publisher'</samp>
fa7cae

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

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

fa7cae
fa7cae
<samp>`Identifier'</samp>
fa7cae

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

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

fa7cae
fa7cae
<samp>`Source'</samp>
fa7cae

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

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

2dc146
fa7cae
<samp>`Relation'</samp>
fa7cae

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

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

fa7cae
fa7cae
<samp>`Language'</samp>
fa7cae

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

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

fa7cae
fa7cae
<samp>`Keywords'</samp>
fa7cae

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

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

fa7cae
fa7cae
<samp>`Coverage'</samp>
fa7cae

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

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

fa7cae
fa7cae
<samp>`Description'</samp>
fa7cae

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

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

2dc146
fa7cae
<samp>`Contributors'</samp>
fa7cae

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

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

2dc146
2dc146
fa7cae

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

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

fa7cae
fa7cae
fa7cae
fa7cae

3.58.2.2 Unused definitions

fa7cae
fa7cae

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

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

fa7cae

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

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

fa7cae

To remove unused definitions from several scalable vector graphics

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

38bcd9
fa7cae
008ee0

3.58.3 Usage

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

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

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

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

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

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

2dc146
2dc146
fa7cae

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

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

fa7cae
Warning

Warning

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

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

fa7cae
fa7cae

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

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

fa7cae

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

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

2c8180
fa7cae
008ee0

3.58.4 See also

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

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

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