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

4c79b5
4c79b5
<html>
4c79b5
4c79b5
can you do inside it.
4c79b5
6c4982
Copyright C 2009, 2010 Alain Reguera Delgado. All rights
4c79b5
reserved.
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
-->
915635
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>
2c8180
<title>CentOS Artwork Repository: 3.43 trunk/Scripts/Bash/Functions/Svg</title>
4c79b5
2c8180
<meta name="description" content="CentOS Artwork Repository: 3.43 trunk/Scripts/Bash/Functions/Svg">
2c8180
<meta name="keywords" content="CentOS Artwork Repository: 3.43 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
be6bef
[ < ]
be6bef
[ > ]
4c79b5
   
4c79b5
[ << ]
4c79b5
[ Up ]
915635
[ >> ]
4c79b5
   
4c79b5
   
4c79b5
   
4c79b5
   
4c79b5
[Top]
4c79b5
[Contents]
915635
[Index]
4c79b5
[ ? ]
4c79b5
2c8180
be6bef
2c8180

3.43 trunk/Scripts/Bash/Functions/Svg

cb2a5d
300762
be6bef
fe989b

3.43.1 Goals

fe989b
915635

This section exists to organize files related to svg

915635
functionality of <tt>`centos-art.sh'</tt> script.
2c8180

cb2a5d
be6bef
fe989b

3.43.2 Description

cb2a5d
915635

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

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

915635
915635
915635
915635

3.43.2.1 Metadata maintainance

915635
915635

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

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

915635

The metadata template was created using the metadata information of a

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

915635

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

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

915635

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

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

915635

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

915635

915635
915635
<samp>`Title'</samp>
915635

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

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

915635
915635
<samp>`Date'</samp>
915635

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

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

915635
915635
<samp>`Creator'</samp>
915635

Name of entity primarily responsible for making the content of this

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

915635
915635
<samp>`Rights'</samp>
915635

Name of entity with rights to the intellectual Property of this

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

915635
915635
<samp>`Publisher'</samp>
915635

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

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

915635
915635
<samp>`Identifier'</samp>
915635

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

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

915635
915635
<samp>`Source'</samp>
915635

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

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

915635
915635
<samp>`Relation'</samp>
915635

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

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

915635
915635
<samp>`Language'</samp>
915635

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

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

915635
915635
<samp>`Keywords'</samp>
915635

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

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

915635
915635
<samp>`Coverage'</samp>
915635

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

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

915635
915635
<samp>`Description'</samp>
915635

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

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

915635
915635
<samp>`Contributors'</samp>
915635

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

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

915635
cb2a5d
915635

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

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

915635
915635
915635
915635

3.43.2.2 Unused definitions

915635
915635

As SVG files grow they may end up with unused definitions inside. For

915635
example, if you stop using a pattern or gradient, tags used to define
915635
them are considered unused definitions then. Inkscape 0.46 brings the
915635
<samp>`Vaccum Defs'</samp> feature to remove those unused definitions from SVG
915635
files. The <samp>`Vaccum Defs'</samp> feature is available both at graphical
915635
interface and command line interface.
915635

915635

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

915635
definitions using graphical interface may be enough to you.  In
915635
contrast, if you have houndred of files to maintain it is not a fun
915635
task to use the gui interface to remove unused SVG definitions editing
915635
those files one by one.
915635

915635

To remove unused SVG definitions from several SVG files, the

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

915635
915635
081970

3.43.3 Usage

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

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

915635
under <samp>`path/to/dir'</samp> directory.
2c8180

2c8180
915635
centos-art svg --vacuum-defs='path/to/dir'
915635
centos-art svg --vacuum-defs='path/to/dir' --filter='regex'
915635

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

915635
files under <samp>`path/to/dir'</samp> directory. 
2c8180

2c8180
081970
915635

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

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

915635
Warning

Warning

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

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

081970
915635

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

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

915635

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

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

915635
915635
4c79b5

3.43.4 See also

4c79b5
915635
915635
3.34 trunk/Scripts/Bash  
915635
915635
3.35 trunk/Scripts/Bash/Functions  
915635
915635
4c79b5
4c79b5
4c79b5
915635
[ < ]
915635
[ > ]
4c79b5
   
4c79b5
[ << ]
be6bef
[ Up ]
915635
[ >> ]
4c79b5
4c79b5

4c79b5
 <font size="-1">
915635
  This document was generated on November, 10 2010 using texi2html 1.76.
4c79b5
 </font>
4c79b5
 
4c79b5
4c79b5

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