Blame Manuals/Repository/repository-html/repository_60.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>
42563b
<title>CentOS Artwork Repository: 3.57 trunk/Scripts/Bash/Functions/Svg</title>
4c79b5
42563b
<meta name="description" content="CentOS Artwork Repository: 3.57 trunk/Scripts/Bash/Functions/Svg">
42563b
<meta name="keywords" content="CentOS Artwork Repository: 3.57 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
42563b
[ < ]
42563b
[ > ]
4c79b5
   
4c79b5
[ << ]
38bcd9
[ Up ]
42563b
[ >> ]
4c79b5
   
4c79b5
   
4c79b5
   
4c79b5
   
4c79b5
[Top]
4c79b5
[Contents]
42563b
[Index]
4c79b5
[ ? ]
4c79b5
42563b
42563b
42563b

3.57 trunk/Scripts/Bash/Functions/Svg

4a9d2a
4a9d2a
42563b
4a9d2a

3.57.1 Goals

4a9d2a
42563b

This section exists to organize files related to svg

42563b
functionality of <tt>`centos-art.sh'</tt> script.
4a9d2a

4a9d2a
42563b
4a9d2a

3.57.2 Description

4a9d2a
42563b

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

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

42563b
c12cdc
42563b
42563b

3.57.2.1 Metadata maintainance

c12cdc
42563b

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

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

42563b

The metadata template was created using the metadata information of a

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

42563b

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

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

42563b

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

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

42563b

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

2c3589

4a9d2a
42563b
<samp>`Title'</samp>
42563b

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

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

42563b
42563b
<samp>`Date'</samp>
42563b

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

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

2c3589
42563b
<samp>`Creator'</samp>
42563b

Name of entity primarily responsible for making the content of this

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

6a8116
42563b
<samp>`Rights'</samp>
42563b

Name of entity with rights to the intellectual Property of this

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

6a8116
42563b
<samp>`Publisher'</samp>
42563b

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

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

42563b
42563b
<samp>`Identifier'</samp>
42563b

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

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

42563b
42563b
<samp>`Source'</samp>
42563b

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

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

6a8116
42563b
<samp>`Relation'</samp>
42563b

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

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

42563b
42563b
<samp>`Language'</samp>
42563b

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

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

42563b
42563b
<samp>`Keywords'</samp>
42563b

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

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

42563b
42563b
<samp>`Coverage'</samp>
42563b

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

42563b
<tt>`centos-art.sh'</tt> script uses the string <samp>`The CentOS Project'</samp>.
6a8116

42563b
42563b
<samp>`Description'</samp>
42563b

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

42563b
<tt>`centos-art.sh'</tt> script uses uses empty value as default.
6a8116

c12cdc
42563b
<samp>`Contributors'</samp>
42563b

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

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

c12cdc
2c3589
42563b

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

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

42563b
42563b
42563b
42563b

3.57.2.2 Unused definitions

42563b
42563b

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

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

42563b

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

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

42563b

To remove unused definitions from several scalable vector graphics

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

c12cdc
42563b
2c3589

3.57.3 Usage

2c3589
2c3589
42563b
centos-art svg --update-metadata='path/to/dir'
42563b
centos-art svg --update-metadata='path/to/dir' --filter='regex'
42563b

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

42563b
under <samp>`path/to/dir'</samp> directory.
2c3589

2c3589
42563b
centos-art svg --vacuum-defs='path/to/dir'
42563b
centos-art svg --vacuum-defs='path/to/dir' --filter='regex'
42563b

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

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

2c3589
2c3589
42563b

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

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

42563b
Warning

Warning

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

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

42563b
42563b

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

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

42563b

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

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

2c3589
42563b
38bcd9

3.57.4 See also

38bcd9
4a9d2a
42563b
3.48 trunk/Scripts/Bash  
4a9d2a
42563b
3.49 trunk/Scripts/Bash/Functions  
4a9d2a
4a9d2a
008ee0
6aec21
300762
42563b
[ < ]
42563b
[ > ]
300762
   
300762
[ << ]
42563b
[ Up ]
42563b
[ >> ]
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>