myoutline 0.4.2 → 0.4.3
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/lib/myoutline.rb +12 -24
- data.tar.gz.sig +0 -0
- metadata +10 -10
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fdaac78cb5087754de66fe05c22dd070d6cdb9f7
|
4
|
+
data.tar.gz: a62c01bd4784c867d40538c68683c41129c545a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21906e0f2104bb483a7bac41235b2a91597cefd49a553ccd09a25a863db05bbaf40b3f89e2e5842aa271d0bc3078dc696281b198393c0870da27eba9911e395b
|
7
|
+
data.tar.gz: cf931109ea97b3c9fb92793693e6292b3164fa9b725592edbfb965d3b25a7624de46a9958cf9e6acbbd4d4dd1827b213ef6f32e2d97bcba76a1736537868f953
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/myoutline.rb
CHANGED
@@ -14,11 +14,12 @@ class MyOutline
|
|
14
14
|
attr_reader :pxi, :links
|
15
15
|
attr_accessor :md
|
16
16
|
|
17
|
-
def initialize(source, debug: false, allsorted: true,
|
18
|
-
|
17
|
+
def initialize(source, debug: false, allsorted: true, autoupdate: true,
|
18
|
+
topic_url: '$topic', md_path: '.', default_md: 'main.md')
|
19
19
|
|
20
20
|
@debug, @source, @topic_url = debug, source, topic_url
|
21
21
|
@allsorted, @autoupdate, @md_path = allsorted, autoupdate, md_path
|
22
|
+
@default_md = default_md
|
22
23
|
|
23
24
|
raw_s, _ = RXFHelper.read(source)
|
24
25
|
build_index(raw_s)
|
@@ -27,11 +28,13 @@ class MyOutline
|
|
27
28
|
|
28
29
|
def fetch(uri)
|
29
30
|
|
30
|
-
s, remaining = @links.locate
|
31
|
+
s, remaining = @links.locate(uri)
|
31
32
|
puts 'fetch() s: ' + s.inspect if @debug
|
32
33
|
redirect = s =~ /^\[r\] +/i
|
33
34
|
return s if redirect
|
34
35
|
|
36
|
+
s ||= @default_md; remaining ||= ''
|
37
|
+
|
35
38
|
f = File.join(@md_path, s)
|
36
39
|
puts 'f: ' + f.inspect if @debug
|
37
40
|
@md = MdEdit.new f, debug: @debug
|
@@ -122,28 +125,11 @@ class MyOutline
|
|
122
125
|
|
123
126
|
private
|
124
127
|
|
125
|
-
def build_index(
|
126
|
-
|
127
|
-
# find the entries which aren't on the main index
|
128
|
-
s = raw_s.sub(/<[^>]+>\n/,'')
|
129
|
-
doc = LineTree.new(s, debug: @debug).to_doc(encapsulate: true)
|
130
|
-
a = doc.root.xpath('entry/text()')
|
131
|
-
puts 'doc: ' + doc.xml if @debug
|
132
|
-
a2 = doc.root.xpath('entry//entry/text()')
|
133
|
-
puts 'a2: ' + a2.inspect if @debug
|
134
|
-
a3 = a2 - a
|
135
|
-
puts 'a3:' + a3.inspect if @debug
|
128
|
+
def build_index(s)
|
136
129
|
|
137
|
-
|
138
|
-
s
|
139
|
-
|
140
|
-
s.prepend '<?ph schema="entries/section[heading]/entry[title, url]"?>
|
141
|
-
|
142
|
-
'
|
143
|
-
|
144
|
-
@pxi = PxIndex.new(s, debug: @debug, indexsorted: true,
|
145
|
-
allsorted: @allsorted)
|
146
|
-
save() if @autoupdate and self.to_s != raw_s
|
130
|
+
@pxi = PxIndex.new(debug: @debug, indexsorted: true, allsorted: @allsorted)
|
131
|
+
@pxi.import s
|
132
|
+
save() if @autoupdate and self.to_s != s
|
147
133
|
read(self.to_treelinks)
|
148
134
|
end
|
149
135
|
|
@@ -182,10 +168,12 @@ class MyOutline
|
|
182
168
|
end
|
183
169
|
|
184
170
|
def read(s)
|
171
|
+
|
185
172
|
@links = PolyrexLinks.new.import(s, debug: @debug)
|
186
173
|
|
187
174
|
s3 = s.lines.map {|x| x.split(/ | # /,2)[0]}.join("\n")
|
188
175
|
@ftx = FileTreeXML.new(s3, debug: @debug)
|
176
|
+
|
189
177
|
end
|
190
178
|
|
191
179
|
def xslt()
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: myoutline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
DFhc5TDtqEkJYiaiznQFl34HUKeCAdeAHkmD8jP3fUC8O7zcLXq69EAXGMXw4efB
|
31
31
|
3Co=
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2018-04-
|
33
|
+
date: 2018-04-14 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: pxindex
|
@@ -38,20 +38,20 @@ dependencies:
|
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: '0.
|
41
|
+
version: '0.2'
|
42
42
|
- - ">="
|
43
43
|
- !ruby/object:Gem::Version
|
44
|
-
version: 0.
|
44
|
+
version: 0.2.0
|
45
45
|
type: :runtime
|
46
46
|
prerelease: false
|
47
47
|
version_requirements: !ruby/object:Gem::Requirement
|
48
48
|
requirements:
|
49
49
|
- - "~>"
|
50
50
|
- !ruby/object:Gem::Version
|
51
|
-
version: '0.
|
51
|
+
version: '0.2'
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.
|
54
|
+
version: 0.2.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: nokogiri
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -98,20 +98,20 @@ dependencies:
|
|
98
98
|
requirements:
|
99
99
|
- - "~>"
|
100
100
|
- !ruby/object:Gem::Version
|
101
|
-
version: '0.
|
101
|
+
version: '0.3'
|
102
102
|
- - ">="
|
103
103
|
- !ruby/object:Gem::Version
|
104
|
-
version: 0.
|
104
|
+
version: 0.3.0
|
105
105
|
type: :runtime
|
106
106
|
prerelease: false
|
107
107
|
version_requirements: !ruby/object:Gem::Requirement
|
108
108
|
requirements:
|
109
109
|
- - "~>"
|
110
110
|
- !ruby/object:Gem::Version
|
111
|
-
version: '0.
|
111
|
+
version: '0.3'
|
112
112
|
- - ">="
|
113
113
|
- !ruby/object:Gem::Version
|
114
|
-
version: 0.
|
114
|
+
version: 0.3.0
|
115
115
|
- !ruby/object:Gem::Dependency
|
116
116
|
name: md_edit
|
117
117
|
requirement: !ruby/object:Gem::Requirement
|
metadata.gz.sig
CHANGED
Binary file
|