mindmapdoc 0.3.5 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/mindmapdoc.rb +30 -17
- data.tar.gz.sig +0 -0
- metadata +32 -32
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f6a39a2e3c276a3d8beb313c1e321335c3185fabfcefdb8e037f4cc45480b89
|
4
|
+
data.tar.gz: 06e60ea0d795937983910ece47c91aa9ef5c221f0c5f56c68ea4d0a827d7edd1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 926ba9b9e4d40ea5d27cc604c77483fa409ee3c303ae0fd866cfd6657f9720ba54e0ff1877acd6b67c0fd17d04d574cd9a9185296c05eecf7349527b143701d6
|
7
|
+
data.tar.gz: 63d2f1c47f6965c11f7113754c13905dc0c95f44f12e8c26aa80a88c47a4378e27d995928d6f4f64853713fc70d247b23cc26d92cfd63af7d61b58ca9347e891
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/mindmapdoc.rb
CHANGED
@@ -6,12 +6,12 @@
|
|
6
6
|
require 'c32'
|
7
7
|
require 'kramdown'
|
8
8
|
require 'mindmapviz'
|
9
|
-
|
9
|
+
require 'rxfreadwrite'
|
10
10
|
|
11
11
|
|
12
12
|
class MindmapDoc
|
13
13
|
using ColouredText
|
14
|
-
include
|
14
|
+
include RXFReadWriteModule
|
15
15
|
|
16
16
|
attr_accessor :root
|
17
17
|
|
@@ -35,7 +35,7 @@ class MindmapDoc
|
|
35
35
|
end
|
36
36
|
|
37
37
|
puts ('@tree: ' + @tree.inspect).debug if @debug
|
38
|
-
@svg = build_svg(
|
38
|
+
@svg = build_svg(to_tree(rooted: true))
|
39
39
|
|
40
40
|
end
|
41
41
|
|
@@ -117,6 +117,8 @@ class MindmapDoc
|
|
117
117
|
@html
|
118
118
|
end
|
119
119
|
|
120
|
+
# used for finding and parsing mindmapdoc blocks within a Markdown document
|
121
|
+
#
|
120
122
|
def to_mindmapdoc(s)
|
121
123
|
|
122
124
|
s2 = s.split(/(?=^--?mm-+)/).map do |raw_s|
|
@@ -167,8 +169,8 @@ class MindmapDoc
|
|
167
169
|
|
168
170
|
def to_tree(rooted: false)
|
169
171
|
|
170
|
-
if rooted then
|
171
|
-
@tree
|
172
|
+
if rooted then
|
173
|
+
@root.chomp + "\n" + @tree
|
172
174
|
else
|
173
175
|
|
174
176
|
lines = @tree.lines
|
@@ -235,12 +237,14 @@ overflow-y: auto; height: 70vh; "
|
|
235
237
|
.gsub(/\b'\b/,"{::nomarkdown}'{:/}")).to_html
|
236
238
|
|
237
239
|
lines = md.scan(/#[^\n]+\n/)\
|
238
|
-
.map {|x| (' ' * (x.scan(/#/).length - 1)) + x[/(?<=# ).*/]}
|
239
|
-
|
240
|
-
@root
|
241
|
-
lines.
|
242
|
-
|
243
|
-
|
240
|
+
.map {|x| (' ' * (x.scan(/#/).length - 1)) + x[/(?<=# ).*/].lstrip}
|
241
|
+
|
242
|
+
if @root.nil? then
|
243
|
+
@root = if lines.first[/^[^#\s]/] then
|
244
|
+
lines.shift.chomp
|
245
|
+
else
|
246
|
+
'root'
|
247
|
+
end
|
244
248
|
end
|
245
249
|
|
246
250
|
puts ('lines: ' + lines.inspect).debug if @debug
|
@@ -255,16 +259,23 @@ overflow-y: auto; height: 70vh; "
|
|
255
259
|
puts ('inside parse_tree').info if @debug
|
256
260
|
|
257
261
|
lines = s.gsub(/\r/,'').strip.lines
|
262
|
+
|
263
|
+
if @root.nil? and s[/^\w[^\n]+\n\n/] then
|
264
|
+
@root = lines.shift
|
265
|
+
lines.shift
|
266
|
+
end
|
267
|
+
|
268
|
+
|
269
|
+
if @root.nil? and lines.grep(/^\w/).length == 1 then
|
270
|
+
@root = lines.shift
|
271
|
+
lines.map! {|x| x[2..-1]}
|
272
|
+
end
|
273
|
+
|
258
274
|
puts ('lines: ' + lines.inspect) if @debug
|
259
275
|
|
260
|
-
@root = if lines.first[/^[^#\s]/] then
|
261
|
-
lines.shift.chomp
|
262
|
-
elsif @root.nil?
|
263
|
-
'root'
|
264
|
-
end
|
265
276
|
puts ('@root:' + @root.inspect).debug if @debug
|
266
277
|
|
267
|
-
asrc =
|
278
|
+
asrc = lines.map {|x| ' ' + x}
|
268
279
|
|
269
280
|
a2 = asrc.inject([]) do |r,x|
|
270
281
|
|
@@ -275,6 +286,8 @@ overflow-y: auto; height: 70vh; "
|
|
275
286
|
end
|
276
287
|
|
277
288
|
end
|
289
|
+
|
290
|
+
a2.unshift('# ' + @root + "\n") if @root
|
278
291
|
|
279
292
|
a = @txtdoc.split(/.*(?=\n#)/).map(&:strip)
|
280
293
|
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mindmapdoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -11,31 +11,31 @@ cert_chain:
|
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
13
|
MIIEXjCCAsagAwIBAgIBATANBgkqhkiG9w0BAQsFADAsMSowKAYDVQQDDCFnZW1t
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
14
|
+
YXN0ZXIvREM9amFtZXNyb2JlcnRzb24vREM9ZXUwHhcNMjIwMzAxMTAwNzMxWhcN
|
15
|
+
MjMwMzAxMTAwNzMxWjAsMSowKAYDVQQDDCFnZW1tYXN0ZXIvREM9amFtZXNyb2Jl
|
16
|
+
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knZ3zLMiG0pKJ4Ljqlh/rTFkG1XNG+
|
30
|
+
zkPL8ybikwohea+8dg3ZTi8C9CZyvOMIni4CMOK3qZ8gEWTvVGNz8dYlAO8FN10d
|
31
|
+
/DNb1baZ9hRj9i/E5W3UzaBIaWXsd2fqotIUphLlm/iVHFBzMzBlvmaZy0V9S8xf
|
32
|
+
qXML841kOBNOAkpG35s1KoCyY6F1jrnrot/sagyDJH4vpgGME/piHOKVyyVAQtU4
|
33
|
+
OiYZBTqDmR4ozlOJv4Uw21Nd1x+eF6OUSXlqXZTH8VsKPHdu+HosGubPbMGLsIm9
|
34
|
+
L4YaUgJXuxfCm58Yc+0OA+8VYFEo6+NxL1Iq7uef7DuwWTCC0OYA51Pc17m26JVz
|
35
|
+
cZljkW+MlyM8Jl6ReyapxlhkD9UIsbgdo/HXMKjwdTvVSdZwOkBzWLRLg7iNjgyq
|
36
|
+
n5DVIF7fsC7lR1JPwIT6dnyR
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date:
|
38
|
+
date: 2022-03-01 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: c32
|
@@ -61,22 +61,22 @@ dependencies:
|
|
61
61
|
name: kramdown
|
62
62
|
requirement: !ruby/object:Gem::Requirement
|
63
63
|
requirements:
|
64
|
-
- - ">="
|
65
|
-
- !ruby/object:Gem::Version
|
66
|
-
version: 2.1.0
|
67
64
|
- - "~>"
|
68
65
|
- !ruby/object:Gem::Version
|
69
66
|
version: '2.1'
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 2.1.0
|
70
70
|
type: :runtime
|
71
71
|
prerelease: false
|
72
72
|
version_requirements: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
|
-
- - ">="
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
version: 2.1.0
|
77
74
|
- - "~>"
|
78
75
|
- !ruby/object:Gem::Version
|
79
76
|
version: '2.1'
|
77
|
+
- - ">="
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: 2.1.0
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: mindmapviz
|
82
82
|
requirement: !ruby/object:Gem::Requirement
|
@@ -98,7 +98,7 @@ dependencies:
|
|
98
98
|
- !ruby/object:Gem::Version
|
99
99
|
version: 0.2.3
|
100
100
|
description:
|
101
|
-
email:
|
101
|
+
email: digital.robertson@gmail.com
|
102
102
|
executables: []
|
103
103
|
extensions: []
|
104
104
|
extra_rdoc_files: []
|
@@ -123,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
requirements: []
|
126
|
-
rubygems_version: 3.
|
126
|
+
rubygems_version: 3.2.22
|
127
127
|
signing_key:
|
128
128
|
specification_version: 4
|
129
129
|
summary: Transforms a markdown document into a mindmap or a mindmap into a markdown
|
metadata.gz.sig
CHANGED
Binary file
|