Blame Identity/Manual/repository-html/repository_78.html

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

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

ed9de5
ed9de5
ed9de5
ed9de5

2.71.1 Goals

ed9de5
ed9de5

This section exists to organize files related to svg

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

ed9de5
ed9de5
ed9de5

2.71.2 Description

ed9de5
ed9de5

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

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

ed9de5
ed9de5
ed9de5
ed9de5

2.71.2.1 Metadata maintainance

ed9de5
ed9de5

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

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

ed9de5

The metadata template was created using the metadata information of a

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

ed9de5

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

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

ed9de5

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

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

ed9de5

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

06d106

06d106
ed9de5
<samp>`Title'</samp>
ed9de5

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

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

06d106
ed9de5
<samp>`Date'</samp>
ed9de5

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

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

ed9de5
ed9de5
<samp>`Creator'</samp>
ed9de5

Name of entity primarily responsible for making the content of this

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

ed9de5
ed9de5
<samp>`Rights'</samp>
ed9de5

Name of entity with rights to the intellectual Property of this

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

ed9de5
ed9de5
<samp>`Publisher'</samp>
ed9de5

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

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

ed9de5
ed9de5
<samp>`Identifier'</samp>
ed9de5

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

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

ed9de5
ed9de5
<samp>`Source'</samp>
ed9de5

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

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

06d106
ed9de5
<samp>`Relation'</samp>
ed9de5

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

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

ed9de5
ed9de5
<samp>`Language'</samp>
ed9de5

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

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

ed9de5
ed9de5
<samp>`Keywords'</samp>
ed9de5

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

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

ed9de5
ed9de5
<samp>`Coverage'</samp>
ed9de5

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

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

ed9de5
ed9de5
<samp>`Description'</samp>
ed9de5

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

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

ed9de5
ed9de5
<samp>`Contributors'</samp>
ed9de5

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

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

06d106
9bfd15
ed9de5

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

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

ed9de5
9bfd15
ed9de5
ed9de5

2.71.2.2 Unused definitions

9bfd15
ed9de5

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

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

ed9de5

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

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

ed9de5

To remove unused definitions from several scalable vector graphics

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

52772c
ed9de5
ed9de5

2.71.3 Usage

52772c
52772c
ed9de5
centos-art svg --update-metadata='path/to/dir'
ed9de5
centos-art svg --update-metadata='path/to/dir' --filter='regex'
ed9de5

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

ed9de5
under <samp>`path/to/dir'</samp> directory.
52772c

52772c
ed9de5
centos-art svg --vacuum-defs='path/to/dir'
ed9de5
centos-art svg --vacuum-defs='path/to/dir' --filter='regex'
ed9de5

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

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

52772c
52772c
ed9de5

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

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

f456e5
Warning

Warning

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

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

52772c
ed9de5

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

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

ed9de5

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

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

06d106
ed9de5
ed9de5

2.71.4 See also

9bfd15
ed9de5
ed9de5
2.60 The <tt>`trunk/Scripts'</tt> Directory  
ed9de5
ed9de5
632e8b
632e8b
632e8b
ed9de5
[ < ]
ed9de5
[ > ]
632e8b
   
1075b9
[ << ]
ed9de5
[ Up ]
ed9de5
[ >> ]
632e8b
632e8b

632e8b
 <font size="-1">
f456e5
  This document was generated on March, 24 2011 using texi2html 1.76.
632e8b
 </font>
632e8b
 
632e8b
632e8b

632e8b
</body>
632e8b
</html>