Module: Sumi::Graphics::Mixtures::Inkscape
- Defined in:
- graphics/lib/sumi/graphics/mixtures/inkscape.rb
Overview
Inkscape-specific SVG DSL helpers.
Instance Method Summary collapse
-
#Group(mod, *args, attributes: {}, **kwargs) { ... } ⇒ Sumi::Graphics::Element
Renders a callable module inside a group.
-
#InkscapeTemplateInfo(name:, desc: nil, author: nil, date: nil, keywords: nil) ⇒ Sumi::Graphics::Element
Adds Inkscape template metadata.
-
#Layer(mod, *args, attributes: {}, **kwargs) { ... } ⇒ Sumi::Graphics::Element
Renders a callable module inside an Inkscape layer.
-
#layer(**attributes) { ... } ⇒ Sumi::Graphics::Element
Builds an Inkscape layer group.
-
#Layer!(mod, *args, attributes: {}, **kwargs) { ... } ⇒ Sumi::Graphics::Element
Renders a callable module inside an insensitive Inkscape layer.
-
#layer!(**attributes) { ... } ⇒ Sumi::Graphics::Element
Builds an insensitive Inkscape layer group.
-
#Pages(*pages, namedview: {}, page: {}) {|page| ... } ⇒ Sumi::Graphics::Element
Builds an Inkscape namedview containing page elements.
-
#PagesTabular(rows:, cols:, width:, height:, gap:, namedview: {}, page: {}) {|page| ... } ⇒ Sumi::Graphics::Element
Builds a tabular set of Inkscape pages.
-
#symbol!(**attributes) { ... } ⇒ Sumi::Graphics::Element
Builds an Inkscape symbol group hidden from the symbols menu.
Instance Method Details
#Group(mod, *args, attributes: {}, **kwargs) { ... } ⇒ Sumi::Graphics::Element
Renders a callable module inside a group. Named modules default the group id to their final constant name. Anonymous modules omit the id unless supplied.
61 62 63 |
# File 'graphics/lib/sumi/graphics/mixtures/inkscape.rb', line 61 def Group(mod, *args, attributes: {}, **kwargs, &block) g(**Wrapper.attributes(mod, attributes, kind: "Group")) { Call(mod, *args, **kwargs, &block) } end |
#InkscapeTemplateInfo(name:, desc: nil, author: nil, date: nil, keywords: nil) ⇒ Sumi::Graphics::Element
Adds Inkscape template metadata.
35 36 37 38 39 40 41 42 43 |
# File 'graphics/lib/sumi/graphics/mixtures/inkscape.rb', line 35 def InkscapeTemplateInfo(name:, desc: nil, author: nil, date: nil, keywords: nil) Element(:"inkscape:_templateinfo") do Element(:"inkscape:_name", name) Element(:"inkscape:_shortdesc", desc) if desc Element(:"inkscape:date", date) if date Element(:"inkscape:author", ) if Element(:"inkscape:_keywords", [*keywords].join(" ")) if keywords end end |
#Layer(mod, *args, attributes: {}, **kwargs) { ... } ⇒ Sumi::Graphics::Element
Renders a callable module inside an Inkscape layer. Named modules default the layer id to their final constant name. Anonymous modules omit the id unless supplied.
75 76 77 |
# File 'graphics/lib/sumi/graphics/mixtures/inkscape.rb', line 75 def Layer(mod, *args, attributes: {}, **kwargs, &block) layer(**Wrapper.attributes(mod, attributes, kind: "Layer")) { Call(mod, *args, **kwargs, &block) } end |
#layer(**attributes) { ... } ⇒ Sumi::Graphics::Element
99 100 101 |
# File 'graphics/lib/sumi/graphics/mixtures/inkscape.rb', line 99 def layer(**, &block) g("inkscape:groupmode": "layer", **, &block) end |
#Layer!(mod, *args, attributes: {}, **kwargs) { ... } ⇒ Sumi::Graphics::Element
Renders a callable module inside an insensitive Inkscape layer. Named modules default the layer id to their final constant name. Anonymous modules omit the id unless supplied.
89 90 91 |
# File 'graphics/lib/sumi/graphics/mixtures/inkscape.rb', line 89 def Layer!(mod, *args, attributes: {}, **kwargs, &block) layer!(**Wrapper.attributes(mod, attributes, kind: "Layer")) { Call(mod, *args, **kwargs, &block) } end |
#layer!(**attributes) { ... } ⇒ Sumi::Graphics::Element
109 110 111 |
# File 'graphics/lib/sumi/graphics/mixtures/inkscape.rb', line 109 def layer!(**, &block) layer("sodipodi:insensitive": "true", **, &block) end |
#Pages(*pages, namedview: {}, page: {}) {|page| ... } ⇒ Sumi::Graphics::Element
Builds an Inkscape namedview containing page elements.
258 |
# File 'graphics/lib/sumi/graphics/mixtures/inkscape.rb', line 258 def Pages(*pages, namedview: {}, page: {}, &block) = Pagination.call(self, pages, namedview:, page:, &block) |
#PagesTabular(rows:, cols:, width:, height:, gap:, namedview: {}, page: {}) {|page| ... } ⇒ Sumi::Graphics::Element
Builds a tabular set of Inkscape pages.
281 282 283 284 |
# File 'graphics/lib/sumi/graphics/mixtures/inkscape.rb', line 281 def PagesTabular(rows:, cols:, width:, height:, gap:, namedview: {}, page: {}, &block) pages = Pagination.tabular(rows:, cols:, width:, height:, gap:) Pages(*pages, namedview:, page:, &block) end |
#symbol!(**attributes) { ... } ⇒ Sumi::Graphics::Element
292 293 294 295 296 297 298 299 300 |
# File 'graphics/lib/sumi/graphics/mixtures/inkscape.rb', line 292 def symbol!(**, &block) if Is?(:defs) g(role: "inkscape:symbol", **, &block) else symbol_element = nil defs { symbol_element = g(role: "inkscape:symbol", **, &block) } symbol_element end end |