|
|
c8f7b7 |
|
|
|
728c6d |
|
|
|
728c6d |
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
|
|
728c6d |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
|
728c6d |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
|
728c6d |
<head>
|
|
|
632e8b |
|
|
|
c8f7b7 |
<title>CentOS Artwork Repository: 2.71 The trunk/Scripts/Functions/Svg Directory</title>
|
|
|
c8f7b7 |
|
|
|
c8f7b7 |
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
|
|
728c6d |
<meta name="description" content="CentOS Artwork Repository: 2.71 The trunk/Scripts/Functions/Svg Directory" />
|
|
|
728c6d |
<meta name="keywords" content="CentOS Artwork Repository: 2.71 The trunk/Scripts/Functions/Svg Directory" />
|
|
|
728c6d |
<meta name="resource-type" content="document" />
|
|
|
728c6d |
<meta name="distribution" content="global" />
|
|
|
728c6d |
<meta name="generator" content="texi2html 1.76" />
|
|
|
728c6d |
<meta name="copyright" content="2009-2011 Alain Reguera Delgado" />
|
|
|
632e8b |
|
|
|
c8f7b7 |
<link href="/home/centos/artwork/trunk/Identity/Manual/repository.css" rel="stylesheet" type="text/css" media="screen projection" />
|
|
|
632e8b |
|
|
|
728c6d |
</head>
|
|
|
632e8b |
|
|
|
728c6d |
<body>
|
|
|
632e8b |
|
|
|
728c6d |
|
|
|
632e8b |
|
|
|
728c6d |
|
|
|
632e8b |
|
|
|
728c6d |
|
|
|
632e8b |
|
|
|
728c6d |
|
|
|
c8f7b7 |
|
|
|
c8f7b7 |
|
|
|
632e8b |
|
|
|
c8f7b7 |
[ < ]
|
|
|
ed9de5 |
[ > ]
|
|
|
632e8b |
|
|
|
c8f7b7 |
[ << ]
|
|
|
c8f7b7 |
[ Up ]
|
|
|
c8f7b7 |
[ >> ]
|
|
|
632e8b |
|
|
|
632e8b |
|
|
|
632e8b |
|
|
|
632e8b |
|
|
|
c8f7b7 |
[Top]
|
|
|
c8f7b7 |
[Contents]
|
|
|
c8f7b7 |
[Index]
|
|
|
c8f7b7 |
[ ? ]
|
|
|
632e8b |
|
|
|
ed9de5 |
|
|
|
ed9de5 |
|
|
|
ed9de5 |
2.71 The <tt>`trunk/Scripts/Functions/Svg'</tt> Directory
|
|
|
ed9de5 |
|
|
|
728c6d |
|
|
|
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 |
|
|
|
728c6d |
|
|
|
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 |
|
|
|
728c6d |
|
|
|
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 |
|
|
|
728c6d |
|
|
|
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 |
|
|
|
728c6d |
|
|
|
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 |
|
|
|
728c6d |
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 |
|
|
|
728c6d |
|
|
|
ed9de5 |
|
|
|
ed9de5 |
2.71.4 See also
|
|
|
9bfd15 |
|
|
|
ed9de5 |
|
|
|
c8f7b7 |
2.60 The <tt>`trunk/Scripts'</tt> Directory
|
|
|
ed9de5 |
|
|
|
ed9de5 |
|
|
|
632e8b |
|
|
|
728c6d |
|
|
|
632e8b |
|
|
|
ed9de5 |
[ < ]
|
|
|
c8f7b7 |
[ > ]
|
|
|
632e8b |
|
|
|
c8f7b7 |
[ << ]
|
|
|
ed9de5 |
[ Up ]
|
|
|
c8f7b7 |
[ >> ]
|
|
|
632e8b |
|
|
|
632e8b |
|
|
|
728c6d |
|
|
|
728c6d |
|
|
|
728c6d |
|
|
|
728c6d |
|
|
|
728c6d |
|
|
|
728c6d |
|
|
|
728c6d |
|
|
|
728c6d |
|
|
|
728c6d |
|
|
|
728c6d |
|
|
|
632e8b |
</body>
|
|
|
728c6d |
|
|
|
632e8b |
</html>
|