jekyll-archimate 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 450c76bef35c5a96c2dd7b52a7e8598ef0b3910a
4
- data.tar.gz: 9506cf3a7a0a23f70ac2f4083be19f9ae25023b2
3
+ metadata.gz: 286ae636a15d00a41da942349afb0fe96030d76d
4
+ data.tar.gz: 1d3f7e8e92b72b9df7b6fabc01b74154b21b898f
5
5
  SHA512:
6
- metadata.gz: ad3da00341c4db0c5329e8e23a50cdf1eac79c9f0fcbf36db9f85a6cfd8acc4171716a98539c77f69183cc27053f2d28b2965a0ab3c43c0cd4674dc8bdc2bd21
7
- data.tar.gz: 79ac5eae532d4709e7fe08de80acea38649c8f3c95ae8d5029a565648ef1b5a442681b888c91ae00069e15bed420d7258e0a29c5ded297e54b82a9730b691bc5
6
+ metadata.gz: 89d6bb51fd7a584436eb6c7cd34acb4a465ef29c8cc1b17b7265e6699ea263de5c15005557d74cb4050d5a07acc7683f6f54cfdb9afb8c4e4957222747a64bc3
7
+ data.tar.gz: e67b30a145482b2a3e5ce3ae2f43c7854a731cea0db1d8ba10e6c2e9f610e66e7e845ce9839b5dc812339aa417cd9c627e2e59ed5e41352118aabc6681bc7c8e
@@ -13,7 +13,9 @@ module Jekyll
13
13
  end
14
14
 
15
15
  require "jekyll/archimate/version"
16
+ require "jekyll/archimate/markup_converter"
16
17
  require "jekyll/archimate/archimate_cache"
18
+ require "jekyll/archimate/tag_attribute_parser"
17
19
  require "jekyll/archimate/archimate_diagram_tag"
18
20
  require "jekyll/archimate/catalog_tag"
19
21
  require "jekyll/archimate/application_interaction_matrix_tag"
@@ -7,6 +7,8 @@ module Jekyll
7
7
  # {% element_catalog type:"Principle" | caption:"Principles Catalog" %}
8
8
  #
9
9
  class CatalogTag < Liquid::Tag
10
+ include MarkupConverter
11
+
10
12
  attr_reader :context
11
13
  attr_reader :caption
12
14
  attr_reader :element_types
@@ -96,12 +98,6 @@ module Jekyll
96
98
  @element_types = element_type.split(",").map(&:strip)
97
99
  end
98
100
 
99
- def converter(context)
100
- # Gather settings
101
- site = context.registers[:site]
102
- site.find_converter_instance(::Jekyll::Converters::Markdown)
103
- end
104
-
105
101
  def site
106
102
  @site ||= context.registers[:site]
107
103
  end
@@ -32,6 +32,7 @@ module Jekyll
32
32
  def write(content)
33
33
  return unless needs_write?(content)
34
34
  Jekyll.logger.info "Rendering #{relative_path}"
35
+ write_file(content)
35
36
  end
36
37
 
37
38
  private
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Jekyll
4
+ module Archimate
5
+ module MarkupConverter
6
+ def converter(context)
7
+ # Gather settings
8
+ site = context.registers[:site]
9
+ site.find_converter_instance(::Jekyll::Converters::Markdown)
10
+ end
11
+ end
12
+ end
13
+ end
@@ -78,8 +78,6 @@ module Jekyll
78
78
  end
79
79
 
80
80
  def scan_attributes(context)
81
- @converter = converter(context)
82
-
83
81
  # Render any liquid variables
84
82
  markup = Liquid::Template.parse(@markup).render(context)
85
83
 
@@ -94,12 +92,6 @@ module Jekyll
94
92
  @element_types = element_type.split(",").map(&:strip)
95
93
  end
96
94
 
97
- def converter(context)
98
- # Gather settings
99
- site = context.registers[:site]
100
- site.find_converter_instance(::Jekyll::Converters::Markdown)
101
- end
102
-
103
95
  def site
104
96
  @site ||= context.registers[:site]
105
97
  end
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Jekyll
4
+ module Archimate
5
+ # For the element catalog, the "type" argument syntax is:
6
+ #
7
+ # element_spec[,element_spec]*
8
+ #
9
+ # Where:
10
+ #
11
+ # element_spec: element_type_name | element_type_name_stereotype | element_ref_relationship
12
+ # element_type_name: "BusinessActor", "DataObject", etc.
13
+ # element_type_name_stereotype: element_type_name<<stereotype>>
14
+ # element_ref_relationship: element_ref rel_direction element_spec
15
+ #
16
+ # Examples:
17
+ #
18
+ # * `BusinessActor`
19
+ # * `BusinessActor<<Organization>>`
20
+ # * `BusinessActor<<Organization>>,BusinessActor` - Note, this should be a unique set - the organization stereotyped Business Actor shouldn't be duplicated in the BusinessActor list.
21
+ # * `BusinessActor,Location` - Note, this should be a list of Business Actors, followed by a list of Locations
22
+ #
23
+ # Class requirements
24
+ # @converter
25
+ # @markup
26
+ module TagAttributeParser
27
+ def scan_attributes(context)
28
+ @converter = converter(context)
29
+
30
+ # Render any liquid variables
31
+ markup = Liquid::Template.parse(@markup).render(context)
32
+
33
+ # Extract tag attributes
34
+ attributes = {}
35
+ markup.scan(Liquid::TagAttributes) do |key, value|
36
+ attributes[key] = value
37
+ end
38
+
39
+ caption = attributes['caption']&.gsub!(/\A"|"\Z/, '')
40
+ # @caption = @converter.convert(caption).gsub(/<\/?p[^>]*>/, '').chomp if @caption
41
+ @caption = @converter.convert(caption).gsub(%r{</?p[^>]*>}, '').chomp if @caption
42
+ element_type = attributes['type']
43
+ element_type = element_type.gsub!(/\A"|"\Z/, '') if element_type
44
+ @element_types = element_type.split(",").map(&:strip)
45
+ end
46
+ end
47
+ end
48
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module Archimate
5
- VERSION = "0.2.3"
5
+ VERSION = "0.2.4"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-archimate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Morga
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-10-27 00:00:00.000000000 Z
11
+ date: 2017-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -111,10 +111,12 @@ files:
111
111
  - lib/jekyll/archimate/entity_base.rb
112
112
  - lib/jekyll/archimate/folder.rb
113
113
  - lib/jekyll/archimate/json_file.rb
114
+ - lib/jekyll/archimate/markup_converter.rb
114
115
  - lib/jekyll/archimate/matrix_tag.rb
115
116
  - lib/jekyll/archimate/model_entity.rb
116
117
  - lib/jekyll/archimate/relationship_entity.rb
117
118
  - lib/jekyll/archimate/svg_file.rb
119
+ - lib/jekyll/archimate/tag_attribute_parser.rb
118
120
  - lib/jekyll/archimate/unified_model.rb
119
121
  - lib/jekyll/archimate/version.rb
120
122
  homepage: https://github.com/mmorga/jekyll-archimate