This file is indexed.

/usr/share/doc/glue-sprite/html/options.html is in glue-sprite 0.11.1-2build1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Command line arguments &mdash; glue 0.11.1 documentation</title>
    
    <link rel="stylesheet" href="_static/nature.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    './',
        VERSION:     '0.11.1',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="top" title="glue 0.11.1 documentation" href="index.html" />
    <link rel="next" title="Settings" href="settings.html" />
    <link rel="prev" title="Templates" href="templates.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="settings.html" title="Settings"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="templates.html" title="Templates"
             accesskey="P">previous</a> |</li>
        <li><a href="index.html">glue 0.11.1 documentation</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="command-line-arguments">
<h1>Command line arguments<a class="headerlink" href="#command-line-arguments" title="Permalink to this headline"></a></h1>
<div class="section" id="a-algorithm">
<h2>-a &#8211;algorithm<a class="headerlink" href="#a-algorithm" title="Permalink to this headline"></a></h2>
<p>The criteria that <tt class="docutils literal"><span class="pre">glue</span></tt> uses to order the images before adding them to the canvas can be tunned. By default the algorithm is <cite>square</cite>, but in some situations using another ordering like <cite>vertical</cite> or <cite>horizontal</cite> could be useful depending on the kind of images you are spriting.</p>
<ul class="simple">
<li>The <cite>square</cite> algorithm was inspired by the <a class="reference external" href="http://codeincomplete.com/posts/2011/5/7/bin_packing/">Binary Tree Bin Packing Algorithm Article</a> by Jake Gordon.</li>
<li>The <cite>vertical</cite> one allocates the images vertically aligning them to the left of the sprite.</li>
<li>The <cite>vertical-right</cite> one allocates the images vertically aligning them to the right of the sprite.</li>
<li>The <cite>horizontal</cite> one allocates the images aligning them to the top of the sprite.</li>
<li>The <cite>horizontal-bottom</cite> one allocates the images aligning them to the bottom of the sprite.</li>
<li>The <cite>diagonal</cite> one allocates the images diagonally. It was inspired by the <a class="reference external" href="http://www.aaronbarker.net/2010/07/diagonal-sprites/">Diagonal CSS Sprites Article</a> by Aaron Barker.</li>
</ul>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>glue <span class="nb">source </span>output --algorithm<span class="o">=[</span>square<span class="p">|</span>vertical<span class="p">|</span>hortizontal<span class="p">|</span>diagonal<span class="p">|</span>vertical-right<span class="p">|</span>horizontal-bottom<span class="o">]</span>
</pre></div>
</div>
</div>
<div class="section" id="c-crop">
<h2>-c &#8211;crop<a class="headerlink" href="#c-crop" title="Permalink to this headline"></a></h2>
<p>Usually designers add some unnecessary transparent space around the images because it is easier for them to work with a larger canvas. <tt class="docutils literal"><span class="pre">glue</span></tt> can optimize our sprite by croping all the unnecessary transparent spaces that the original images could have.</p>
<img alt="_images/crop.png" src="_images/crop.png" />
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>glue <span class="nb">source </span>output --crop
</pre></div>
</div>
</div>
<div class="section" id="caat">
<h2>&#8211;caat<a class="headerlink" href="#caat" title="Permalink to this headline"></a></h2>
<p>Using the <tt class="docutils literal"><span class="pre">--caat</span></tt> option, <tt class="docutils literal"><span class="pre">Glue</span></tt> will generate both a sprite image and a caat metadata file.</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>glue <span class="nb">source </span>output --caat
</pre></div>
</div>
</div>
<div class="section" id="cachebuster">
<h2>&#8211;cachebuster<a class="headerlink" href="#cachebuster" title="Permalink to this headline"></a></h2>
<p>If you decide to add an expires header to your static resources (and if you haven&#8217;t already you really should), you need to worry about cache busting these resources every time you change one of them.</p>
<p>Cache busting is a technique that prevents a browser from reusing a resource that was already downloaded and cached. Cache in general is good, but in some situations could be annoying if it&#8217;s duration is too long and we want to update a resource <strong>now</strong>.</p>
<p>This technique adds a flag to every url that links an external resource (PNG in this case). This flag usually is the last modified time or the <tt class="docutils literal"><span class="pre">hash</span></tt> of the file.</p>
<p><tt class="docutils literal"><span class="pre">glue</span></tt> can use this technique to automatically add the <tt class="docutils literal"><span class="pre">hash</span></tt> of the PNG file to the CSS url, so as soon as the file change (add/remove an image) the <tt class="docutils literal"><span class="pre">hash</span></tt> will be different and the browser will re-download the image.</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>glue <span class="nb">source </span>output --cachebuster
</pre></div>
</div>
<p>Original css:</p>
<div class="highlight-css"><div class="highlight"><pre><span class="nc">.sprite-icons-zoom</span><span class="p">{</span> <span class="k">background</span><span class="o">:</span><span class="sx">url(&#39;sprites/icons/icons.png&#39;)</span><span class="p">;</span> <span class="k">top</span><span class="o">:</span><span class="m">0</span><span class="p">;</span> <span class="k">left</span><span class="o">:</span><span class="m">0</span><span class="p">;</span> <span class="k">no-repeat</span><span class="p">;}</span>
<span class="nc">.sprite-icons-wrench_orange</span><span class="p">{</span> <span class="k">background</span><span class="o">:</span><span class="sx">url(&#39;sprites/icons/icons.png&#39;)</span><span class="p">;</span> <span class="k">top</span><span class="o">:</span><span class="m">0</span><span class="p">;</span> <span class="k">left</span><span class="o">:-</span><span class="m">16</span><span class="p">;</span> <span class="k">no-repeat</span><span class="p">;}</span>
<span class="o">...</span>
</pre></div>
</div>
<p>After &#8211;cachebuster:</p>
<div class="highlight-css"><div class="highlight"><pre><span class="nc">.sprite-icons-zoom</span><span class="p">{</span> <span class="k">background</span><span class="o">:</span><span class="sx">url(&#39;sprites/icons/icons.png?p3c54d&#39;)</span><span class="p">;</span> <span class="k">top</span><span class="o">:</span><span class="m">0</span><span class="p">;</span> <span class="k">left</span><span class="o">:</span><span class="m">0</span><span class="p">;</span> <span class="k">no-repeat</span><span class="p">;}</span>
<span class="nc">.sprite-icons-wrench_orange</span><span class="p">{</span> <span class="k">background</span><span class="o">:</span><span class="sx">url(&#39;sprites/icons/icons.png?p3c54d&#39;)</span><span class="p">;</span> <span class="k">top</span><span class="o">:</span><span class="m">0</span><span class="p">;</span> <span class="k">left</span><span class="o">:-</span><span class="m">16</span><span class="p">;</span> <span class="k">no-repeat</span><span class="p">;}</span>
<span class="o">...</span>
</pre></div>
</div>
</div>
<div class="section" id="cachebuster-filename">
<h2>&#8211;cachebuster-filename<a class="headerlink" href="#cachebuster-filename" title="Permalink to this headline"></a></h2>
<p>This option has the same purpose than <tt class="docutils literal"><span class="pre">--cachebuster</span></tt> but insted of using the hash of the PNG as a queryarg it uses it as part of the filename.</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>glue <span class="nb">source </span>output --cachebuster-filename
</pre></div>
</div>
<p>Original css:</p>
<div class="highlight-css"><div class="highlight"><pre><span class="nc">.sprite-icons-zoom</span><span class="p">{</span> <span class="k">background</span><span class="o">:</span><span class="sx">url(&#39;sprites/icons/icons.png&#39;)</span><span class="p">;</span> <span class="k">top</span><span class="o">:</span><span class="m">0</span><span class="p">;</span> <span class="k">left</span><span class="o">:</span><span class="m">0</span><span class="p">;</span> <span class="k">no-repeat</span><span class="p">;}</span>
<span class="nc">.sprite-icons-wrench_orange</span><span class="p">{</span> <span class="k">background</span><span class="o">:</span><span class="sx">url(&#39;sprites/icons/icons.png&#39;)</span><span class="p">;</span> <span class="k">top</span><span class="o">:</span><span class="m">0</span><span class="p">;</span> <span class="k">left</span><span class="o">:-</span><span class="m">16</span><span class="p">;</span> <span class="k">no-repeat</span><span class="p">;}</span>
<span class="o">...</span>
</pre></div>
</div>
<p>After &#8211;cachebuster:</p>
<div class="highlight-css"><div class="highlight"><pre><span class="nc">.sprite-icons-zoom</span><span class="p">{</span> <span class="k">background</span><span class="o">:</span><span class="sx">url(&#39;sprites/icons/icons_p3c54d.png&#39;)</span><span class="p">;</span> <span class="k">top</span><span class="o">:</span><span class="m">0</span><span class="p">;</span> <span class="k">left</span><span class="o">:</span><span class="m">0</span><span class="p">;</span> <span class="k">no-repeat</span><span class="p">;}</span>
<span class="nc">.sprite-icons-wrench_orange</span><span class="p">{</span> <span class="k">background</span><span class="o">:</span><span class="sx">url(&#39;sprites/icons/icons_p3c54d.png&#39;)</span><span class="p">;</span> <span class="k">top</span><span class="o">:</span><span class="m">0</span><span class="p">;</span> <span class="k">left</span><span class="o">:-</span><span class="m">16</span><span class="p">;</span> <span class="k">no-repeat</span><span class="p">;}</span>
<span class="o">...</span>
</pre></div>
</div>
</div>
<div class="section" id="cachebuster-filename-only-sprites">
<h2>&#8211;cachebuster-filename-only-sprites<a class="headerlink" href="#cachebuster-filename-only-sprites" title="Permalink to this headline"></a></h2>
<p>Unlike <tt class="docutils literal"><span class="pre">--cachebuster-filename</span></tt>, glue will only apply filename cachebusting to the sprite image and not to both the <tt class="docutils literal"><span class="pre">CSS</span></tt> and the sprite image.</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>glue <span class="nb">source </span>output --cachebuster-filename-only-sprites
</pre></div>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">New in version 0.9.2</p>
</div>
</div>
<div class="section" id="cocos2d">
<h2>&#8211;cocos2d<a class="headerlink" href="#cocos2d" title="Permalink to this headline"></a></h2>
<p>Using the <tt class="docutils literal"><span class="pre">--cocos2d</span></tt> option, <tt class="docutils literal"><span class="pre">Glue</span></tt> will generate both a sprite image and a xml metadata file compatible with cocos2d.</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>glue <span class="nb">source </span>output --cocos2d
</pre></div>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">New in version 0.9</p>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The output of this format has not been deeply tested and we are looking for a cocos2d-champion who can sponsor this feature.</p>
</div>
</div>
<div class="section" id="css-img">
<h2>&#8211;css &#8211;img<a class="headerlink" href="#css-img" title="Permalink to this headline"></a></h2>
<p>Usually both CSS and PNG files reside on different folders, e.g. <cite>css</cite> and <cite>img</cite>. If you want to choose an individual folder for each type of file you can use the <tt class="docutils literal"><span class="pre">--img=&lt;dir&gt;</span> <span class="pre">--css=&lt;dir&gt;</span></tt> options together to customize where the output files will be created.</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>glue <span class="nb">source</span> --img<span class="o">=</span>images/compiled --css<span class="o">=</span>css/compiled
</pre></div>
</div>
</div>
<div class="section" id="css-template">
<h2>&#8211;css-template<a class="headerlink" href="#css-template" title="Permalink to this headline"></a></h2>
<p>While using <tt class="docutils literal"><span class="pre">--css</span></tt> you can use your own css template using <tt class="docutils literal"><span class="pre">--css-template=&lt;FILE&gt;</span></tt>.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">By default glue will use it&#8217;s own internal <tt class="docutils literal"><span class="pre">css</span></tt> template, so this command <strong>is not required</strong> unless you want to super-customize glue&#8217;s <tt class="docutils literal"><span class="pre">css</span></tt> output using <strong>your own</strong> template. You can find further documentation about how templates work in the <a class="reference internal" href="templates.html"><em>templates documentation page.</em></a></p>
</div>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>glue <span class="nb">source </span>output --css-template<span class="o">=</span>my_template.jinja
</pre></div>
</div>
</div>
<div class="section" id="force">
<h2>&#8211;force<a class="headerlink" href="#force" title="Permalink to this headline"></a></h2>
<p>By default <tt class="docutils literal"><span class="pre">glue</span></tt> store some metadata inside the generated sprites in order to not rebuild it again if the source images and settings are the same. Glue set two different keys, <tt class="docutils literal"><span class="pre">glue</span></tt> with the version number the sprite was build and <tt class="docutils literal"><span class="pre">hash</span></tt>, generated using the source images data, name and all the relevant sprite settings like padding, margin etc...</p>
<p>In order to avoid this behaviour you can use <tt class="docutils literal"><span class="pre">--force</span></tt> and <tt class="docutils literal"><span class="pre">glue</span></tt> will always build the sprites.</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>glue <span class="nb">source </span>output --force
</pre></div>
</div>
</div>
<div class="section" id="follow-links">
<h2>&#8211;follow-links<a class="headerlink" href="#follow-links" title="Permalink to this headline"></a></h2>
<p>Follow symbolic links.</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>glue <span class="nb">source </span>output --follow-links
</pre></div>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Be aware that following links can lead to infinite recursion if a link points to a parent directory of itself. <tt class="docutils literal"><span class="pre">glue</span></tt> does not keep track of the directories it visited already.</p>
</div>
</div>
<div class="section" id="html">
<h2>&#8211;html<a class="headerlink" href="#html" title="Permalink to this headline"></a></h2>
<p>Using the <tt class="docutils literal"><span class="pre">--html</span></tt> option, <tt class="docutils literal"><span class="pre">Glue</span></tt> will also generate a test html per sprite using all the available CSS classes. This option is only useful for testing purposes. Glue generate the <tt class="docutils literal"><span class="pre">html</span></tt> file in the same directory as the CSS file.</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>glue <span class="nb">source </span>output --html
</pre></div>
</div>
</div>
<div class="section" id="json">
<h2>&#8211;json<a class="headerlink" href="#json" title="Permalink to this headline"></a></h2>
<p>Using the <tt class="docutils literal"><span class="pre">--json</span></tt> option, <tt class="docutils literal"><span class="pre">Glue</span></tt> will generate both a sprite image and a json metadata file.</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>glue <span class="nb">source </span>output --json
</pre></div>
</div>
</div>
<div class="section" id="json-format">
<h2>&#8211;json-format<a class="headerlink" href="#json-format" title="Permalink to this headline"></a></h2>
<p>Using the <tt class="docutils literal"><span class="pre">--json-format</span></tt> option you can customize how the generated <tt class="docutils literal"><span class="pre">JSON</span></tt> will look. You can choose between <tt class="docutils literal"><span class="pre">array</span></tt> and <tt class="docutils literal"><span class="pre">hash</span></tt>.</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>glue <span class="nb">source </span>output --json --json-format<span class="o">=</span><span class="nb">hash</span>
</pre></div>
</div>
<p>Example <tt class="docutils literal"><span class="pre">array</span></tt> output:</p>
<div class="highlight-json"><div class="highlight"><pre>{&quot;frames&quot;: [{&quot;filename&quot;: &quot;apple.png&quot;, width&quot;: 128, &quot;height&quot;: 128, ...}, {...}], &quot;meta&quot;: {...}}
</pre></div>
</div>
<p>Example <tt class="docutils literal"><span class="pre">hash</span></tt> output:</p>
<div class="highlight-json"><div class="highlight"><pre>{&quot;frames&quot;: {&quot;apple.png&quot;: {&quot;width&quot;: 128, &quot;height&quot;: 128, ...}, &quot;orange.png&quot;: {...}, &quot;meta&quot;: {...}}
</pre></div>
</div>
</div>
<div class="section" id="l-less">
<h2>-l &#8211;less<a class="headerlink" href="#l-less" title="Permalink to this headline"></a></h2>
<p><a class="reference external" href="http://lesscss.org/">less</a>  is a dynamic stylesheet language that extends CSS with dynamic behaviors.
<tt class="docutils literal"><span class="pre">glue</span></tt> can also create <tt class="docutils literal"><span class="pre">.less</span></tt> files adding the <tt class="docutils literal"><span class="pre">--less</span></tt> option.
This files contain exactly the same CSS code. This option only changes the file format.</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>glue <span class="nb">source </span>output --less
</pre></div>
</div>
</div>
<div class="section" id="less-template">
<h2>&#8211;less-template<a class="headerlink" href="#less-template" title="Permalink to this headline"></a></h2>
<p>While using <tt class="docutils literal"><span class="pre">--less</span></tt> you can use your own less template using <tt class="docutils literal"><span class="pre">--less-template=&lt;FILE&gt;</span></tt>.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">By default glue will use it&#8217;s own internal <tt class="docutils literal"><span class="pre">less</span></tt> template, so this command <strong>is not required</strong> unless you want to super-customize glue&#8217;s <tt class="docutils literal"><span class="pre">less</span></tt> output using <strong>your own</strong> template. You can find further documentation about how templates work in the <a class="reference internal" href="templates.html"><em>templates documentation page.</em></a></p>
</div>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>glue <span class="nb">source </span>output --less-template<span class="o">=</span>my_template.jinja
</pre></div>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">New in version 0.9.2</p>
</div>
</div>
<div class="section" id="margin">
<h2>&#8211;margin<a class="headerlink" href="#margin" title="Permalink to this headline"></a></h2>
<p>If you want to spread the images around the sprite but you don&#8217;t want to count this space as image width/height (as happens using <cite>&#8211;padding`</cite>), you can use the <tt class="docutils literal"><span class="pre">--margin</span></tt> option followed by the margin you want to add:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>glue <span class="nb">source </span>output --margin<span class="o">=</span>10
<span class="nv">$ </span>glue <span class="nb">source </span>output --margin<span class="o">=</span><span class="s1">&#39;10 20&#39;</span>
<span class="nv">$ </span>glue <span class="nb">source </span>output --margin<span class="o">=</span><span class="s1">&#39;10 20 30 40&#39;</span>
</pre></div>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">New in version 0.9</p>
</div>
</div>
<div class="section" id="namespace">
<h2>&#8211;namespace<a class="headerlink" href="#namespace" title="Permalink to this headline"></a></h2>
<p>By default <tt class="docutils literal"><span class="pre">glue</span></tt> adds the namespace <tt class="docutils literal"><span class="pre">sprite</span></tt> to all the generated CSS class names. If you want to use your own namespace you can override the default one using the <tt class="docutils literal"><span class="pre">--namespace</span></tt> option.</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>glue <span class="nb">source </span>output --namespace<span class="o">=</span>my-namespace
</pre></div>
</div>
<p>If you want to completely remove the namespace (both the global and the sprite part) you can use:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>glue <span class="nb">source </span>output --sprite-namespace<span class="o">=</span> --namespace<span class="o">=</span>
</pre></div>
</div>
</div>
<div class="section" id="no-img">
<h2>&#8211;no-img<a class="headerlink" href="#no-img" title="Permalink to this headline"></a></h2>
<p>Don&#8217;t create any sprite image.</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>glue <span class="nb">source </span>output --no-img
</pre></div>
</div>
</div>
<div class="section" id="no-css">
<h2>&#8211;no-css<a class="headerlink" href="#no-css" title="Permalink to this headline"></a></h2>
<p>Don&#8217;t create any CSS file.</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>glue <span class="nb">source </span>output --no-css
</pre></div>
</div>
</div>
<div class="section" id="ordering">
<h2>&#8211;ordering<a class="headerlink" href="#ordering" title="Permalink to this headline"></a></h2>
<p>Before processing the images using the <cite>algorithm</cite> glue orders the images. The default ordering is <cite>maxside</cite> but you can configure it using the <tt class="docutils literal"><span class="pre">--ordering</span></tt> option.</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>glue <span class="nb">source </span>output --ordering<span class="o">=[</span>maxside<span class="p">|</span>width<span class="p">|</span>height<span class="p">|</span>area<span class="p">|</span>filename<span class="o">]</span>
</pre></div>
</div>
<p>You can reverse how any of the available algorithms works prepending a <cite>-</cite>.</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>glue <span class="nb">source </span>output --ordering<span class="o">=[</span>-maxside<span class="p">|</span>-width<span class="p">|</span>-height<span class="p">|</span>-area<span class="p">|</span>-filename<span class="o">]</span>
</pre></div>
</div>
</div>
<div class="section" id="p-padding">
<h2>-p &#8211;padding<a class="headerlink" href="#p-padding" title="Permalink to this headline"></a></h2>
<p>If you want to add the same padding around all images you can use the <tt class="docutils literal"><span class="pre">--padding</span></tt> option:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>glue <span class="nb">source </span>output --padding<span class="o">=</span>10
<span class="nv">$ </span>glue <span class="nb">source </span>output --padding<span class="o">=</span><span class="m">10</span> 20
<span class="nv">$ </span>glue <span class="nb">source </span>output --padding<span class="o">=</span><span class="m">10</span> <span class="m">20</span> <span class="m">30</span> 40
</pre></div>
</div>
</div>
<div class="section" id="png8">
<h2>&#8211;png8<a class="headerlink" href="#png8" title="Permalink to this headline"></a></h2>
<p>By using the flag <tt class="docutils literal"><span class="pre">png8</span></tt> the output image format will be png8 instead of png32.</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>glue <span class="nb">source </span>output --png8
</pre></div>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">This feature is unstable in OSX &gt; 10.7 because a bug in PIL.</p>
</div>
</div>
<div class="section" id="project">
<h2>&#8211;project<a class="headerlink" href="#project" title="Permalink to this headline"></a></h2>
<p>As it&#8217;s explained at the <a class="reference internal" href="quickstart.html"><em>quickstart page</em></a> the default behaviour of <tt class="docutils literal"><span class="pre">glue</span></tt> is to handle one unique sprite folder. If you need to generate several sprites for a project, you can use the <tt class="docutils literal"><span class="pre">--project</span></tt> option to handle multiple folders with only one command.</p>
<p>The suggested setup is to create a new folder for every sprite, and add inside all the images you need for each one. <tt class="docutils literal"><span class="pre">glue</span></tt> will create a new sprite for every folder:</p>
<div class="highlight-python"><div class="highlight"><pre>images
├── actions
│   ├── add.png
│   └── remove.png
├── borders
│   ├── top_left.png
│   └── top_right.png
└── icons
    ├── comment.png
    ├── new.png
    └── rss.png
</pre></div>
</div>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>glue <span class="nb">source </span>output --project
</pre></div>
</div>
</div>
<div class="section" id="pseudo-class-separator">
<h2>&#8211;pseudo-class-separator<a class="headerlink" href="#pseudo-class-separator" title="Permalink to this headline"></a></h2>
<p>As it&#8217;s explained at the <a class="reference internal" href="pseudoclasses.html"><em>pseudo-classes page</em></a> using the filename of the source images you can customize the pseudo class related to the images, so if you simply append <tt class="docutils literal"><span class="pre">__hover</span></tt> to the filename <tt class="docutils literal"><span class="pre">glue</span></tt> will add <tt class="docutils literal"><span class="pre">:hover</span></tt> to the CSS class name.</p>
<p>Since <tt class="docutils literal"><span class="pre">glue</span> <span class="pre">0.9</span></tt> this separator is <tt class="docutils literal"><span class="pre">__</span></tt> but for previous version it use to be only <tt class="docutils literal"><span class="pre">_</span></tt>. In order to not make <tt class="docutils literal"><span class="pre">glue</span> <span class="pre">&lt;</span> <span class="pre">0.9</span></tt> users rename their images, <tt class="docutils literal"><span class="pre">glue</span> <span class="pre">0.9</span></tt> introduces this new option so you can customize the separator.</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>glue <span class="nb">source </span>output --pseudo-class-separator<span class="o">=</span>_
</pre></div>
</div>
</div>
<div class="section" id="q-quiet">
<h2>-q &#8211;quiet<a class="headerlink" href="#q-quiet" title="Permalink to this headline"></a></h2>
<p>This flag will make <tt class="docutils literal"><span class="pre">glue</span></tt> suppress all console output.</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>glue <span class="nb">source </span>output -q
</pre></div>
</div>
</div>
<div class="section" id="r-recursive">
<h2>-r &#8211;recursive<a class="headerlink" href="#r-recursive" title="Permalink to this headline"></a></h2>
<p>Read directories recursively and add all the images to the same sprite.</p>
<p>Example structure:</p>
<div class="highlight-python"><div class="highlight"><pre>source
├── actions
│   ├── add.png
│   └── remove.png
├── borders
│   ├── top_left.png
│   └── top_right.png
└── icons
    ├── comment.png
    ├── new.png
    ├── rss.png
    └── blog
        ├── rss.png
        └── atom.png
</pre></div>
</div>
<p>If you want to create only one sprite image you should use.</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>glue <span class="nb">source </span>output --recursive
</pre></div>
</div>
<p>On the other hand if you want to create three different sprites (one per folder) you can combine <tt class="docutils literal"><span class="pre">--project</span></tt> and <tt class="docutils literal"><span class="pre">--recursive</span></tt>.</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>glue <span class="nb">source </span>output --recursive --project
</pre></div>
</div>
</div>
<div class="section" id="ratios">
<h2>&#8211;ratios<a class="headerlink" href="#ratios" title="Permalink to this headline"></a></h2>
<p><tt class="docutils literal"><span class="pre">Glue</span></tt> can automatically scale down your sprites to automatically fit them into low-dpi devices. <tt class="docutils literal"><span class="pre">Glue</span></tt> assumes that the source images are the biggests you want to serve, then <tt class="docutils literal"><span class="pre">glue</span></tt> will create one sprite for each ratio you set in this command. For more information, read <a class="reference internal" href="ratios.html"><em>Retina Sprites: Ratios</em></a>.</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>glue <span class="nb">source </span>output --ratios<span class="o">=</span>2,1
<span class="nv">$ </span>glue <span class="nb">source </span>output --ratios<span class="o">=</span>2,1.5,1
</pre></div>
</div>
</div>
<div class="section" id="retina">
<h2>&#8211;retina<a class="headerlink" href="#retina" title="Permalink to this headline"></a></h2>
<p>The option <tt class="docutils literal"><span class="pre">--retina</span></tt> is only a shortcut for <tt class="docutils literal"><span class="pre">--ratios=2,1</span></tt>.</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>glue <span class="nb">source </span>output --retina
</pre></div>
</div>
</div>
<div class="section" id="s-source-o-output">
<h2>-s &#8211;source -o &#8211;output<a class="headerlink" href="#s-source-o-output" title="Permalink to this headline"></a></h2>
<p>There are two ways to choose which are the <tt class="docutils literal"><span class="pre">source</span></tt> and the <tt class="docutils literal"><span class="pre">output</span></tt> directories. Using the first and the second positional arguments is the traditional way of using <tt class="docutils literal"><span class="pre">glue</span></tt> but in order to standardize how configuration is handled <tt class="docutils literal"><span class="pre">glue</span> <span class="pre">0.9</span></tt> intruduced these two new options.</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>glue output --source<span class="o">=</span>DIR --output<span class="o">=</span>DIR
</pre></div>
</div>
</div>
<div class="section" id="scss">
<h2>&#8211;scss<a class="headerlink" href="#scss" title="Permalink to this headline"></a></h2>
<p><a class="reference external" href="http://sass-lang.com/">scss/sass</a>  is another dynamic stylesheet language that extends CSS with dynamic behaviors.
<tt class="docutils literal"><span class="pre">glue</span></tt> can also create <tt class="docutils literal"><span class="pre">.scss</span></tt> files adding the <tt class="docutils literal"><span class="pre">--scss</span></tt> option.
This files contain exactly the same CSS code. This option only changes the file format.</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>glue <span class="nb">source </span>output --scss
</pre></div>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">New in version 0.9</p>
</div>
</div>
<div class="section" id="scss-template">
<h2>&#8211;scss-template<a class="headerlink" href="#scss-template" title="Permalink to this headline"></a></h2>
<p>While using <tt class="docutils literal"><span class="pre">--scss</span></tt> you can use your own less template using <tt class="docutils literal"><span class="pre">--scss-template=&lt;FILE&gt;</span></tt>.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">By default glue will use it&#8217;s own internal <tt class="docutils literal"><span class="pre">scss</span></tt> template, so this command <strong>is not required</strong> unless you want to super-customize glue&#8217;s <tt class="docutils literal"><span class="pre">scss</span></tt> output using <strong>your own</strong> template. You can find further documentation about how templates work in the <a class="reference internal" href="templates.html"><em>templates documentation page.</em></a></p>
</div>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>glue <span class="nb">source </span>output --scss-template<span class="o">=</span>my_template.jinja
</pre></div>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">New in version 0.9.2</p>
</div>
</div>
<div class="section" id="separator">
<h2>&#8211;separator<a class="headerlink" href="#separator" title="Permalink to this headline"></a></h2>
<p><tt class="docutils literal"><span class="pre">glue</span></tt> by default uses <tt class="docutils literal"><span class="pre">-</span></tt> as separator for the CSS class names. If you want to customize this behaviour you can use <tt class="docutils literal"><span class="pre">--separator</span></tt> to specify your own
one:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>glue <span class="nb">source </span>output --separator<span class="o">=</span>_
</pre></div>
</div>
<p>If you want to use <a class="reference external" href="http://en.wikipedia.org/wiki/CamelCase">camelCase</a> instead of a separator, choose <tt class="docutils literal"><span class="pre">camelcase</span></tt> as separator.</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>glue <span class="nb">source </span>output --separator<span class="o">=</span>camelcase
</pre></div>
</div>
</div>
<div class="section" id="sprite-namespace">
<h2>&#8211;sprite-namespace<a class="headerlink" href="#sprite-namespace" title="Permalink to this headline"></a></h2>
<p>By default <tt class="docutils literal"><span class="pre">glue</span></tt> adds the sprite&#8217;s name as past of the CSS class namespace. If you want to use your own namespace you can override the default one using the <tt class="docutils literal"><span class="pre">--sprite-namespace</span></tt> option.</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>glue <span class="nb">source </span>output --sprite-namespace<span class="o">=</span>custom
</pre></div>
</div>
<p>As part of the new sprite namespace you can use the key <tt class="docutils literal"><span class="pre">%(sprite)s</span></tt> to refer to the original namespace.</p>
<p>If you want to completely remove the namespace (both the global and the sprite part) you can use:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>glue <span class="nb">source </span>output --sprite-namespace<span class="o">=</span> --namespace<span class="o">=</span>
</pre></div>
</div>
</div>
<div class="section" id="u-url">
<h2>-u &#8211;url<a class="headerlink" href="#u-url" title="Permalink to this headline"></a></h2>
<p>By default <tt class="docutils literal"><span class="pre">glue</span></tt> adds to the PNG file name the relative url between the CSS and the PNG file. If for any reason you need to change this behaviour, you can use <tt class="docutils literal"><span class="pre">url=&lt;your-static-url-to-the-png-file&gt;</span></tt> and <tt class="docutils literal"><span class="pre">glue</span></tt> will replace its suggested one with your url.</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>glue <span class="nb">source </span>output --url<span class="o">=</span>http://static.example.com/
</pre></div>
</div>
</div>
<div class="section" id="watch">
<h2>&#8211;watch<a class="headerlink" href="#watch" title="Permalink to this headline"></a></h2>
<p>While you are developing a site it could be quite frustrating running <tt class="docutils literal"><span class="pre">Glue</span></tt> once and another every time you change a source image or a filename. <tt class="docutils literal"><span class="pre">--watch</span></tt> will allow you to keep <tt class="docutils literal"><span class="pre">Glue</span></tt> running in the background and it&#8217;ll rebuild the sprite every time it detects changes on the source directory.</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>glue <span class="nb">source </span>output --watch
</pre></div>
</div>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Command line arguments</a><ul>
<li><a class="reference internal" href="#a-algorithm">-a &#8211;algorithm</a></li>
<li><a class="reference internal" href="#c-crop">-c &#8211;crop</a></li>
<li><a class="reference internal" href="#caat">&#8211;caat</a></li>
<li><a class="reference internal" href="#cachebuster">&#8211;cachebuster</a></li>
<li><a class="reference internal" href="#cachebuster-filename">&#8211;cachebuster-filename</a></li>
<li><a class="reference internal" href="#cachebuster-filename-only-sprites">&#8211;cachebuster-filename-only-sprites</a></li>
<li><a class="reference internal" href="#cocos2d">&#8211;cocos2d</a></li>
<li><a class="reference internal" href="#css-img">&#8211;css &#8211;img</a></li>
<li><a class="reference internal" href="#css-template">&#8211;css-template</a></li>
<li><a class="reference internal" href="#force">&#8211;force</a></li>
<li><a class="reference internal" href="#follow-links">&#8211;follow-links</a></li>
<li><a class="reference internal" href="#html">&#8211;html</a></li>
<li><a class="reference internal" href="#json">&#8211;json</a></li>
<li><a class="reference internal" href="#json-format">&#8211;json-format</a></li>
<li><a class="reference internal" href="#l-less">-l &#8211;less</a></li>
<li><a class="reference internal" href="#less-template">&#8211;less-template</a></li>
<li><a class="reference internal" href="#margin">&#8211;margin</a></li>
<li><a class="reference internal" href="#namespace">&#8211;namespace</a></li>
<li><a class="reference internal" href="#no-img">&#8211;no-img</a></li>
<li><a class="reference internal" href="#no-css">&#8211;no-css</a></li>
<li><a class="reference internal" href="#ordering">&#8211;ordering</a></li>
<li><a class="reference internal" href="#p-padding">-p &#8211;padding</a></li>
<li><a class="reference internal" href="#png8">&#8211;png8</a></li>
<li><a class="reference internal" href="#project">&#8211;project</a></li>
<li><a class="reference internal" href="#pseudo-class-separator">&#8211;pseudo-class-separator</a></li>
<li><a class="reference internal" href="#q-quiet">-q &#8211;quiet</a></li>
<li><a class="reference internal" href="#r-recursive">-r &#8211;recursive</a></li>
<li><a class="reference internal" href="#ratios">&#8211;ratios</a></li>
<li><a class="reference internal" href="#retina">&#8211;retina</a></li>
<li><a class="reference internal" href="#s-source-o-output">-s &#8211;source -o &#8211;output</a></li>
<li><a class="reference internal" href="#scss">&#8211;scss</a></li>
<li><a class="reference internal" href="#scss-template">&#8211;scss-template</a></li>
<li><a class="reference internal" href="#separator">&#8211;separator</a></li>
<li><a class="reference internal" href="#sprite-namespace">&#8211;sprite-namespace</a></li>
<li><a class="reference internal" href="#u-url">-u &#8211;url</a></li>
<li><a class="reference internal" href="#watch">&#8211;watch</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="templates.html"
                        title="previous chapter">Templates</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="settings.html"
                        title="next chapter">Settings</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="_sources/options.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="settings.html" title="Settings"
             >next</a> |</li>
        <li class="right" >
          <a href="templates.html" title="Templates"
             >previous</a> |</li>
        <li><a href="index.html">glue 0.11.1 documentation</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2013, Jorge Bastida.
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
    </div>
  </body>
</html>