wiki_md 0.4.0 → 0.4.1

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
2
  SHA256:
3
- metadata.gz: a6e1eff7820dc24271a514692324ca07d030698c9065f08ce479978d445a1e83
4
- data.tar.gz: 78bf0a5a7f36e440c5cd1acc11dd945635736b49edc9676b7f4da8d36fa712c6
3
+ metadata.gz: a314fa02253872441fd68c16c6d8158745401fe6e58ef5fdd8657421a88577e9
4
+ data.tar.gz: b4f20db2f094e64b9b43a7fbcf2eefb6b040f9b60b7382da94ba930272b7caff
5
5
  SHA512:
6
- metadata.gz: 3e23720d6dc8baa55a33983f83a95dd3ce2e6a722e1684b6f0bc8226b62791841ceb3e4475dfb7adb2b3c3f9690cf284fe1a20421ff3eec0a5288d098893d23f
7
- data.tar.gz: 9ce971d1f1b93c590ccfabf448981a82cc695c82515d4829a02c24d33db46943f93c57ea6ef255c6f6fcbf0fe46dd807cc5026ca8e8fc945353c7db4c7895b2f
6
+ metadata.gz: 1f9bf04cb1e0ec4daa637148acdea9158e8d078684dfa7d7e6338144e07b32da4e4ff16ace51d1e1ae349f19dd15f58ad00fb617b90489467e42fea8d5b05ad4
7
+ data.tar.gz: 0dc5efff3dcfb9380ed01e9018a4d5a045b4f7311050bc90021e7d6e173105a33df12d1443c34c8c1a72da75043573c551cd51eca272e7c58f3a3799e5d68adf
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/wiki_md.rb CHANGED
@@ -49,14 +49,19 @@ class WikiMd
49
49
 
50
50
  @active_heading = title = s[/(?<=^# ).*/]
51
51
 
52
- a = title.split(/ +/)
53
- tag = a.length > 1 ? a.map(&:capitalize).join : a.first
52
+ tagline = s.rstrip.lines.last[/(?<=^\+\s).*/]
54
53
 
55
- s2 = s.rstrip.lines.last =~ /^\+\s+/ ? s : s + "\n\n+ " + tag
54
+ s2 = if tagline then
55
+ s
56
+ else
57
+ a = title.split
58
+ tagline = a.length > 1 ? a.map(&:capitalize).join : a.first
59
+ s + "\n\n+ " + tagline
60
+ end
56
61
 
57
62
  @dxsx.create(x: s2)
58
63
 
59
- @dx.create title: title + ' #' + tag.lstrip,
64
+ @dx.create title: title + ' #' + tagline.lstrip.split.join(' #'),
60
65
  url: [@base_url, File.basename(@filename)[/.*(?=\.\w+)/],
61
66
  URI.escape(title)].join('/')
62
67
  FileX.write @filename, @dxsx.to_s if @filename
@@ -88,6 +93,10 @@ class WikiMd
88
93
  heading2 = r.x.lines.last[/(?<=redirect ).*/]
89
94
  heading2 ? find(heading2) : r
90
95
 
96
+ end
97
+
98
+ def find_tag(tag)
99
+ @dxtags.find tag
91
100
  end
92
101
 
93
102
  def headings()
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wiki_md
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -66,7 +66,7 @@ dependencies:
66
66
  version: '0.3'
67
67
  - - ">="
68
68
  - !ruby/object:Gem::Version
69
- version: 0.3.0
69
+ version: 0.3.1
70
70
  type: :runtime
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
@@ -76,7 +76,7 @@ dependencies:
76
76
  version: '0.3'
77
77
  - - ">="
78
78
  - !ruby/object:Gem::Version
79
- version: 0.3.0
79
+ version: 0.3.1
80
80
  description:
81
81
  email: james@jamesrobertson.eu
82
82
  executables: []
metadata.gz.sig CHANGED
Binary file