mindmapdoc 0.3.6 → 0.3.7
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
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/mindmapdoc.rb +16 -7
- metadata +2 -2
- 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: 920c96abd91d1608b9054e896ebc762b91ab2ad3f8a291334af3ac86cb26725c
|
|
4
|
+
data.tar.gz: 57d3b2ac17193339e7520b4ba28d571eb0193b0e5cf27c91554ff30dfff9c1b2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 25a141124db90529c041ef64a58b1102dbe197ebc8d819246b0bac719b375bb5cb6fa451524c8f43acc5c813c7675eae5dd34ffe7e6e85f5d88a3b3ef62a6887
|
|
7
|
+
data.tar.gz: 0af97e180e0f0dff0ce9eda5bb61a2fd65de79a6e57254a968b785f902937236a43eeacce4d36b17824f522566642598acbb405862236e3784c64ad402dcc71b
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data.tar.gz.sig
CHANGED
|
Binary file
|
data/lib/mindmapdoc.rb
CHANGED
|
@@ -7,7 +7,6 @@ require 'c32'
|
|
|
7
7
|
require 'kramdown'
|
|
8
8
|
require 'mindmapviz'
|
|
9
9
|
|
|
10
|
-
|
|
11
10
|
class MindmapDoc
|
|
12
11
|
using ColouredText
|
|
13
12
|
include RXFHelperModule
|
|
@@ -116,6 +115,8 @@ class MindmapDoc
|
|
|
116
115
|
@html
|
|
117
116
|
end
|
|
118
117
|
|
|
118
|
+
# used for finding and parsing mindmapdoc blocks within a Markdown document
|
|
119
|
+
#
|
|
119
120
|
def to_mindmapdoc(s)
|
|
120
121
|
|
|
121
122
|
s2 = s.split(/(?=^--?mm-+)/).map do |raw_s|
|
|
@@ -234,12 +235,14 @@ overflow-y: auto; height: 70vh; "
|
|
|
234
235
|
.gsub(/\b'\b/,"{::nomarkdown}'{:/}")).to_html
|
|
235
236
|
|
|
236
237
|
lines = md.scan(/#[^\n]+\n/)\
|
|
237
|
-
.map {|x| (' ' * (x.scan(/#/).length - 1)) + x[/(?<=# ).*/]}
|
|
238
|
-
|
|
239
|
-
@root
|
|
240
|
-
lines.
|
|
241
|
-
|
|
242
|
-
|
|
238
|
+
.map {|x| (' ' * (x.scan(/#/).length - 1)) + x[/(?<=# ).*/].lstrip}
|
|
239
|
+
|
|
240
|
+
if @root.nil? then
|
|
241
|
+
@root = if lines.first[/^[^#\s]/] then
|
|
242
|
+
lines.shift.chomp
|
|
243
|
+
else
|
|
244
|
+
'root'
|
|
245
|
+
end
|
|
243
246
|
end
|
|
244
247
|
|
|
245
248
|
puts ('lines: ' + lines.inspect).debug if @debug
|
|
@@ -255,6 +258,12 @@ overflow-y: auto; height: 70vh; "
|
|
|
255
258
|
|
|
256
259
|
lines = s.gsub(/\r/,'').strip.lines
|
|
257
260
|
|
|
261
|
+
if @root.nil? and s[/^\w[^\n]+\n\n/] then
|
|
262
|
+
@root = lines.shift
|
|
263
|
+
lines.shift
|
|
264
|
+
end
|
|
265
|
+
|
|
266
|
+
|
|
258
267
|
if @root.nil? and lines.grep(/^\w/).length == 1 then
|
|
259
268
|
@root = lines.shift
|
|
260
269
|
lines.map! {|x| x[2..-1]}
|
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.3.
|
|
4
|
+
version: 0.3.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- James Robertson
|
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
|
35
35
|
B6lHIpiAVH9Sx621FqXBHf0fkcUSiXCWW1BpBLGqPsRAcA19KUIPOOn9D011To8+
|
|
36
36
|
kf4RzXeKdszyRSi+lsn0EdIK
|
|
37
37
|
-----END CERTIFICATE-----
|
|
38
|
-
date: 2019-06-
|
|
38
|
+
date: 2019-06-24 00:00:00.000000000 Z
|
|
39
39
|
dependencies:
|
|
40
40
|
- !ruby/object:Gem::Dependency
|
|
41
41
|
name: c32
|
metadata.gz.sig
CHANGED
|
Binary file
|