svggvs 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -14,6 +14,20 @@ is the name of the directory to place the skeleton project files. You'll get a f
14
14
 
15
15
  ## How it works
16
16
 
17
+ Create an Inkscape SVG file in your project directory. Make sure it has a Source and a Target layer.
18
+ Your card template is made up of sublayers in the Source layer. These layers are copied to the Target layer
19
+ upon processing. The names of the layers are what you refer to in the `#active_layers` method in your `Cardfile`.
20
+ By default, layers are hidden, and hidden layers are deleted after copying to the Target layer,
21
+ unless they have the following names:
22
+
23
+ * (visible): The layer is always visible, regardless if it's specified in `#active_layers`
24
+ * (protect): The layer will not be deleted if it is hidden. Good for clone sources.
25
+
26
+ Hiding/showing layers is the way that you make certain card elements appear/disappear on
27
+ different types of cards with with different properties. You can also replace the text in
28
+ text boxes (both standard and flowroot boxes) by giving those boxes a distinct label (under Object Properties)
29
+ and feeding in a hash of label/text pairs into the `#replacements` method in the `Cardfile`.
30
+
17
31
  Create a `Cardfile` in your working directory. It should look
18
32
  something like this:
19
33
 
data/lib/svggvs/target.rb CHANGED
@@ -25,7 +25,11 @@ module SVGGVS
25
25
  current_parent = current_parent.parent
26
26
  end
27
27
  else
28
- layer['style'] = 'display:none'
28
+ layer['style'] = if layer['inkscape:label'].include?('(visible)')
29
+ ''
30
+ else
31
+ 'display:none'
32
+ end
29
33
  end
30
34
  end
31
35
  end
@@ -1,3 +1,3 @@
1
1
  module Svggvs
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: svggvs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -14,7 +14,7 @@ default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: nokogiri
17
- requirement: &80931760 !ruby/object:Gem::Requirement
17
+ requirement: &82569620 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: '0'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *80931760
25
+ version_requirements: *82569620
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: thor
28
- requirement: &80931550 !ruby/object:Gem::Requirement
28
+ requirement: &82614490 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,7 +33,7 @@ dependencies:
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *80931550
36
+ version_requirements: *82614490
37
37
  description: Generate sets of card game cards using Inkscape templates and Ruby
38
38
  email:
39
39
  - john@coswellproductions.com