card-mod-content 0.18.1 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/card/content/chunk/link.rb +3 -2
- data/lib/card/content/chunk/query_reference.rb +4 -2
- data/lib/card/content/chunk/reference.rb +1 -0
- data/lib/card/content/chunk/uri.rb +3 -1
- data/lib/card/content/chunk/view_stub.rb +2 -0
- data/set/all/templating.rb +1 -1
- data/set/right/default.rb +2 -2
- data/set/self/structure.rb +1 -1
- metadata +6 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5d06413f220c184bef8bfddba6524083e1e4f614924bbe4750acf30e33ccbb4
|
4
|
+
data.tar.gz: 530211a8c3f4bfd6305159188e33adbe72722c57beff4cc1c6a27e41d078774f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c736c037a08cee3d738c17243cd1ce8e82574bcd7484008db1c9c99e07f396d1b5387d3b725ccb456402e43339b7f94b2388d40d347f64d94f226a00fce6288
|
7
|
+
data.tar.gz: d7dc18f96dc4c968470cd6c9705a9f1047e1904c2b490cd32ed26000cdf1dda4e053a5e3ef41bd4e59c375667a39cdb2d2e570e74e9490f04d83a43bf4b1c928
|
@@ -5,6 +5,7 @@ load File.expand_path("reference.rb", __dir__)
|
|
5
5
|
class Card
|
6
6
|
class Content
|
7
7
|
module Chunk
|
8
|
+
# handle chunks of card content that are links
|
8
9
|
class Link < Reference
|
9
10
|
CODE = "L".freeze # L for "Link"
|
10
11
|
attr_reader :link_text
|
@@ -23,7 +24,7 @@ class Card
|
|
23
24
|
|
24
25
|
def inspect
|
25
26
|
"<##{self.class}:e[#{@explicit_link}]n[#{@name}]l[#{@link_text}]" \
|
26
|
-
|
27
|
+
"p[#{@process_chunk}] txt:#{@text}>"
|
27
28
|
end
|
28
29
|
|
29
30
|
# view options
|
@@ -89,7 +90,7 @@ class Card
|
|
89
90
|
return unless raw_syntax
|
90
91
|
|
91
92
|
if (i = divider_index raw_syntax) # if [[A | B]]
|
92
|
-
[raw_syntax[0..(i - 1)], raw_syntax[(i + 1)
|
93
|
+
[raw_syntax[0..(i - 1)], raw_syntax[(i + 1)..]] # [A, B]
|
93
94
|
else # else must be [[ A ]]
|
94
95
|
[raw_syntax, nil] # [A, nil]
|
95
96
|
end
|
@@ -16,6 +16,8 @@ class Card
|
|
16
16
|
# query keywords as name
|
17
17
|
|
18
18
|
require File.expand_path("reference", __dir__)
|
19
|
+
|
20
|
+
# handle chunks of CQL query content that refer to other cards
|
19
21
|
class QueryReference < Reference
|
20
22
|
QUERY_KEYWORDS = ::Set.new(
|
21
23
|
(
|
@@ -56,14 +58,14 @@ class Card
|
|
56
58
|
def full_match content, prefix
|
57
59
|
# matches cardnames that are not keywords
|
58
60
|
# FIXME: would not match cardnames that are keywords
|
59
|
-
match, offset = super
|
61
|
+
match, offset = super
|
60
62
|
return if !match || keyword?(match[1])
|
61
63
|
|
62
64
|
[match, offset]
|
63
65
|
end
|
64
66
|
|
65
67
|
def keyword? str
|
66
|
-
return unless str
|
68
|
+
return false unless str
|
67
69
|
|
68
70
|
QUERY_KEYWORDS.include?(str.tr(" ", "_").downcase)
|
69
71
|
end
|
@@ -45,7 +45,7 @@ class Card
|
|
45
45
|
""
|
46
46
|
end
|
47
47
|
content = prepend_str + content
|
48
|
-
match = super
|
48
|
+
match = super
|
49
49
|
[match, prepend_str.length]
|
50
50
|
end
|
51
51
|
|
@@ -90,6 +90,7 @@ class Card
|
|
90
90
|
end
|
91
91
|
|
92
92
|
# FIXME: DRY, merge these two into one class
|
93
|
+
# handle chunks of card content that refer to email addresses
|
93
94
|
class EmailUri < Uri
|
94
95
|
PREPEND_STR = "mailto:".freeze
|
95
96
|
EMAIL = '[a-zA-Z\\d](?:[-a-zA-Z\\d.]*[a-zA-Z\\d])?\\@'.freeze
|
@@ -107,6 +108,7 @@ class Card
|
|
107
108
|
end
|
108
109
|
end
|
109
110
|
|
111
|
+
# handle chunks of card content that refer to web hosts
|
110
112
|
class HostUri < Uri
|
111
113
|
GENERIC = "aero|biz|com|coop|edu|gov|info|int|mil|" \
|
112
114
|
"museum|name|net|org".freeze
|
data/set/all/templating.rb
CHANGED
@@ -32,7 +32,7 @@ def assigns_type?
|
|
32
32
|
# for example, X+*type+*structure governs all cards of type X,
|
33
33
|
# but the content rule does not (in fact cannot) have the type X.
|
34
34
|
pattern_code = Card.quick_fetch(name.trunk_name.tag_name)&.codename
|
35
|
-
return unless pattern_code && (set_class = Set::Pattern.find pattern_code)
|
35
|
+
return false unless pattern_code && (set_class = Set::Pattern.find pattern_code)
|
36
36
|
|
37
37
|
set_class.assigns_type
|
38
38
|
end
|
data/set/right/default.rb
CHANGED
@@ -8,8 +8,8 @@ format :html do
|
|
8
8
|
|
9
9
|
def quick_form_opts
|
10
10
|
super.merge "data-update-foreign-slot":
|
11
|
-
".card-slot.quick_edit-view.RIGHT-Xinput_type,"\
|
12
|
-
".card-slot.quick_edit-view.RIGHT-Xcontent_option"\
|
11
|
+
".card-slot.quick_edit-view.RIGHT-Xinput_type," \
|
12
|
+
".card-slot.quick_edit-view.RIGHT-Xcontent_option" \
|
13
13
|
".card-slot.quick_edit-view.RIGHT-Xcontent_option_view"
|
14
14
|
end
|
15
15
|
|
data/set/self/structure.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
setting_opts group: :templating, position: 2, rule_type_editable: true,
|
2
2
|
short_help_text: "control card's content / structure",
|
3
|
-
help_text: "Controls cards' content / structure. "\
|
3
|
+
help_text: "Controls cards' content / structure. " \
|
4
4
|
"[[http://decko.org/formatting|more]]"
|
metadata
CHANGED
@@ -1,16 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: card-mod-content
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.19.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ethan McCutchen
|
8
8
|
- Philipp Kühl
|
9
9
|
- Gerry Gleason
|
10
|
-
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date:
|
12
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: card
|
@@ -18,14 +17,14 @@ dependencies:
|
|
18
17
|
requirements:
|
19
18
|
- - '='
|
20
19
|
- !ruby/object:Gem::Version
|
21
|
-
version: 1.
|
20
|
+
version: 1.109.0
|
22
21
|
type: :runtime
|
23
22
|
prerelease: false
|
24
23
|
version_requirements: !ruby/object:Gem::Requirement
|
25
24
|
requirements:
|
26
25
|
- - '='
|
27
26
|
- !ruby/object:Gem::Version
|
28
|
-
version: 1.
|
27
|
+
version: 1.109.0
|
29
28
|
description: ''
|
30
29
|
email:
|
31
30
|
- info@decko.org
|
@@ -70,7 +69,6 @@ metadata:
|
|
70
69
|
documentation_url: http://docs.decko.org/
|
71
70
|
card-mod: content
|
72
71
|
card-mod-group: gem-defaults
|
73
|
-
post_install_message:
|
74
72
|
rdoc_options: []
|
75
73
|
require_paths:
|
76
74
|
- lib
|
@@ -78,15 +76,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
78
76
|
requirements:
|
79
77
|
- - ">="
|
80
78
|
- !ruby/object:Gem::Version
|
81
|
-
version: '3.
|
79
|
+
version: '3.2'
|
82
80
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
83
81
|
requirements:
|
84
82
|
- - ">="
|
85
83
|
- !ruby/object:Gem::Version
|
86
84
|
version: '0'
|
87
85
|
requirements: []
|
88
|
-
rubygems_version: 3.
|
89
|
-
signing_key:
|
86
|
+
rubygems_version: 3.6.8
|
90
87
|
specification_version: 4
|
91
88
|
summary: card content handling
|
92
89
|
test_files: []
|