myoutline 0.4.4 → 0.4.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 8a3df25ba19223d3630612441c9c157b05b0b1aa
4
- data.tar.gz: f1e325e49cd1f8a16215f446b712dd94b5367b47
2
+ SHA256:
3
+ metadata.gz: d1b6e81f06399bb9e831e88a29c6467a5ded9dfd61bbfce42f57d6a1a7fb620c
4
+ data.tar.gz: 3a769e535de5132b480e89b1eaa190e7803173c53f1d59b04878f9fb5a152230
5
5
  SHA512:
6
- metadata.gz: b108ce8f581ae7be0eba62ea3246bdbaa85703acdb4a2f6443ae869bc2dc7c2725b056dafeb6e5623e06e0dbfa59a9963167c312d2898dbac474b8381d09e803
7
- data.tar.gz: 954539f6c9df906323a4a072bfcc02a784459ce6e183e602a0b592c04f59ced91c22b33401131826e089f08adcd228885239e8decf4601e287a37c1ccc665818
6
+ metadata.gz: 8d2986b96ef7c4f28e23a7289a5796c727a8351eb42ad1a4b373e109d2ef13244734de0de82316230a0bc57a04ca38fc09afbd48afbf6e1799323ec9ea032492
7
+ data.tar.gz: 5436100739b574c27d1da15e6e0a960591d46444aa2d2bb9f53f7b6e57d8c3e7f901f828771eee1e7003b584de53725d00c98607b2fc6edc65d4c06e9c792bc5
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -15,6 +15,7 @@ class MyOutline
15
15
  attr_accessor :md
16
16
 
17
17
  class Outline
18
+ using ColouredText
18
19
 
19
20
  attr_reader :ftx, :links, :pxi
20
21
 
@@ -29,10 +30,10 @@ class MyOutline
29
30
 
30
31
  def autosave(s=nil)
31
32
 
32
- puts 'inside autosave ; @autoupdate: ' + @autoupdate.inspect if @debug
33
+ puts ('inside autosave ; @autoupdate: ' + @autoupdate.inspect).debug if @debug
33
34
 
34
35
  if @autoupdate then
35
- puts 'before save' if @debug
36
+ puts 'before save'.info if @debug
36
37
  save() if s.nil? or self.to_s != s
37
38
  end
38
39
 
@@ -183,7 +184,7 @@ class MyOutline
183
184
 
184
185
  def to_html()
185
186
 
186
- px = self.to_px
187
+ px = self.outline.to_px
187
188
 
188
189
  px.each_recursive do |x, parent|
189
190
 
@@ -197,19 +198,26 @@ class MyOutline
197
198
 
198
199
  end
199
200
 
200
- doc = Nokogiri::XML(px.to_xml)
201
+ doc = Nokogiri::XML(px.to_xml)
201
202
  xsl = Nokogiri::XSLT(xslt())
202
203
 
203
- doc = Rexle.new(xsl.transform(doc).to_s)
204
+ html_doc = Rexle.new(xsl.transform(doc).to_s)
204
205
 
205
- doc.root.css('.atopic').each do |e|
206
+ html_doc.root.css('.atopic').each do |e|
207
+
206
208
  puts 'e: ' + e.parent.parent.xml.inspect if @debug
207
- e.attributes[:href] = @topic_url.sub(/\$topic/, e.text)\
208
- .sub(/\$id/, e.attributes[:id]).sub(/\$trail/, e.attributes[:trail])\
209
- .to_s.gsub(/ +/,'-')
209
+
210
+ href = e.attributes[:href]
211
+ if href.empty? or href[0] == '!' then
212
+
213
+ e.attributes[:href] = @topic_url.sub(/\$topic/, e.text)\
214
+ .sub(/\$id/, e.attributes[:id]).sub(/\$trail/, e.attributes[:trail])\
215
+ .to_s.gsub(/ +/,'-')
216
+
217
+ end
210
218
  end
211
219
 
212
- doc.xml(pretty: true)
220
+ html_doc.xml(pretty: true, declaration: false)
213
221
 
214
222
  end
215
223
 
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
4
+ version: 0.4.5
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-15 00:00:00.000000000 Z
33
+ date: 2019-01-15 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: pxindex
@@ -159,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
159
159
  version: '0'
160
160
  requirements: []
161
161
  rubyforge_project:
162
- rubygems_version: 2.6.13
162
+ rubygems_version: 2.7.6
163
163
  signing_key:
164
164
  specification_version: 4
165
165
  summary: Helps build an outline from plain text.
metadata.gz.sig CHANGED
Binary file