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 +4 -4
- data/lib/jekyll-archimate.rb +2 -0
- data/lib/jekyll/archimate/catalog_tag.rb +2 -6
- data/lib/jekyll/archimate/conditional_file.rb +1 -0
- data/lib/jekyll/archimate/markup_converter.rb +13 -0
- data/lib/jekyll/archimate/matrix_tag.rb +0 -8
- data/lib/jekyll/archimate/tag_attribute_parser.rb +48 -0
- data/lib/jekyll/archimate/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 286ae636a15d00a41da942349afb0fe96030d76d
|
4
|
+
data.tar.gz: 1d3f7e8e92b72b9df7b6fabc01b74154b21b898f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89d6bb51fd7a584436eb6c7cd34acb4a465ef29c8cc1b17b7265e6699ea263de5c15005557d74cb4050d5a07acc7683f6f54cfdb9afb8c4e4957222747a64bc3
|
7
|
+
data.tar.gz: e67b30a145482b2a3e5ce3ae2f43c7854a731cea0db1d8ba10e6c2e9f610e66e7e845ce9839b5dc812339aa417cd9c627e2e59ed5e41352118aabc6681bc7c8e
|
data/lib/jekyll-archimate.rb
CHANGED
@@ -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
|
@@ -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
|
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.
|
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-
|
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
|