Blame Manual/repository-html/repository_81.html

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

2.74 The <tt>`trunk/Scripts/Bash/Cli/Functions/Svg'</tt> Directory

52772c
52772c
52772c
52772c

2.74.1 Goals

52772c
52772c

This section exists to organize files related to svg

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

52772c
52772c
52772c

2.74.2 Description

52772c
52772c

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

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

52772c
52772c
52772c
52772c

2.74.2.1 Metadata maintainance

52772c
52772c

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

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

52772c

The metadata template was created using the metadata information of a

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

52772c

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

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

52772c

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

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

52772c

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

52772c

52772c
52772c
<samp>`Title'</samp>
52772c

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

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

52772c
52772c
<samp>`Date'</samp>
52772c

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

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

52772c
52772c
<samp>`Creator'</samp>
52772c

Name of entity primarily responsible for making the content of this

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

52772c
52772c
<samp>`Rights'</samp>
52772c

Name of entity with rights to the intellectual Property of this

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

52772c
52772c
<samp>`Publisher'</samp>
52772c

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

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

52772c
52772c
<samp>`Identifier'</samp>
52772c

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

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

52772c
52772c
<samp>`Source'</samp>
52772c

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

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

52772c
52772c
<samp>`Relation'</samp>
52772c

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

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

52772c
52772c
<samp>`Language'</samp>
52772c

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

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

52772c
52772c
<samp>`Keywords'</samp>
52772c

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

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

52772c
52772c
<samp>`Coverage'</samp>
52772c

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

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

52772c
52772c
<samp>`Description'</samp>
52772c

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

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

52772c
52772c
<samp>`Contributors'</samp>
52772c

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

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

52772c
52772c
52772c

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

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

52772c
52772c
52772c
52772c

2.74.2.2 Unused definitions

52772c
52772c

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

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

52772c

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

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

52772c

To remove unused definitions from several scalable vector graphics

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

52772c
52772c
52772c

2.74.3 Usage

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

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

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

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

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

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

52772c
52772c
52772c

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

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

52772c
Warning

Warning

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

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

52772c
52772c

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

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

52772c

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

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

52772c
52772c
52772c

2.74.4 See also

52772c
52772c
1856b7
2.62 The <tt>`trunk/Scripts/Bash'</tt> Directory  
52772c
06d106
06d106
06d106
06d106
52772c
[ < ]
1856b7
[ > ]
06d106
   
1856b7
[ << ]
52772c
[ Up ]
1856b7
[ >> ]
06d106
06d106

06d106
 <font size="-1">
52772c
  This document was generated on March, 22 2011 using texi2html 1.76.
06d106
 </font>
06d106
 
06d106
06d106

06d106
</body>
06d106
</html>