middlemac-extras 1.0.9 → 1.0.10

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1f1bf37078cfe11386a8818f85d6590977f7bce8
4
- data.tar.gz: 6f7f71d6d9659d01893fe251f1050a5cd7df7ea8
3
+ metadata.gz: 388a2f2b206613513f0144bbb7b678666ca7bc8e
4
+ data.tar.gz: ea309459983cd5d51d932615a0b384476c03742f
5
5
  SHA512:
6
- metadata.gz: 5451db71c800300cb9ef009e464a1d48b46a2920ad42a8a8d8455bb47432d4bd07dd958f0ea47b94919fb2a0cba15ef1556ff93840a8c9e04c42a839a12dfa1d
7
- data.tar.gz: 55d393044768891b9a77faa61a445d29c24f9b4fb5ea8f8924ada2db39debb6ebdda0ff38ee579202d8d82f043186b390fa3059217e390e81323788dc14ee7e3
6
+ metadata.gz: 9d31050d09b88de67c8efcaaff385ce392502b9c48ca481c7a1705ac203db465117d6b2ff5faafa15aa1617753be6a6cd7f61c69b79629700fbc3ceba346fea0
7
+ data.tar.gz: 7c2d1d41e699882c10e3e105a6513273549dff8e97e667485c72c356bc95597975765dc7a3645cf1ececff8a1e42865849e989caf42d72b1cfdc8c0e4b50a201
data/CHANGELOG.md CHANGED
@@ -1,9 +1,13 @@
1
1
  middlemac-extras change log
2
2
  ===========================
3
3
 
4
- - Version 1.0.9 / 2018-April-28
4
+ - Version 1.0.10 / 2018-April-28
5
5
 
6
+ - Update to 1.0.10 for use with newer middlemac.
6
7
  - Updated to 1.0.9. md_links no longer outputs empty quotes if no description.
8
+
9
+ - Version 1.0.8 / 2016-May-15
10
+
7
11
  - Bump to 1.0.8 improvements:
8
12
  - Better version management in Rakefile.
9
13
  - Fixes failing Cucumber testing by forcing capybara development dependency.
@@ -9,7 +9,7 @@ gem 'wdm', '~> 0.1.0', platforms: [:mswin, :mingw]
9
9
  gem 'tzinfo-data', platforms: [:mswin, :mingw, :jruby]
10
10
 
11
11
  # Middleman Gems
12
- gem 'middlemac-extras', '~> 1.0.9'
12
+ gem 'middlemac-extras', '~> 1.0.10'
13
13
  gem 'middleman', '~> 4.1.7'
14
14
  gem 'middleman-syntax'
15
15
 
@@ -58,7 +58,7 @@ helpers do
58
58
  end
59
59
 
60
60
  def product_version
61
- '1.0.9'
61
+ '1.0.10'
62
62
  end
63
63
 
64
64
  end
@@ -49,6 +49,52 @@ for every image found in your project.</p>
49
49
 
50
50
  </ul>
51
51
 
52
+ </div>
53
+ </div>
54
+
55
+ <div class="method_details ">
56
+ <h3 class="signature " id="md_hblinks-instance_method">
57
+
58
+ #<strong>md_hblinks</strong> &#x21d2; <tt>String</tt>
59
+
60
+
61
+
62
+
63
+
64
+ </h3><div class="docstring">
65
+ <div class="discussion">
66
+ <p>This helper provides access to <code>middlemac-extras</code>’
67
+ index of links in Markdown reference format, enabling
68
+ you to use reference-style links in documents. Because
69
+ this helper includes literal Markdown, it’s only useful
70
+ in Markdown documents. This is only useful when using
71
+ Middlemac 3.0.0 or newer, which includes support for
72
+ helpbook style links.</p>
73
+
74
+
75
+ </div>
76
+ </div>
77
+ <div class="tags">
78
+
79
+ <p class="tag_title">Returns:</p>
80
+ <ul class="return">
81
+
82
+ <li>
83
+
84
+
85
+ <span class='type'>(<tt>String</tt>)</span>
86
+
87
+
88
+
89
+ &mdash;
90
+ <div class='inline'><p>Returns a string with the Markdown
91
+ index of every page in your project.</p>
92
+ </div>
93
+
94
+ </li>
95
+
96
+ </ul>
97
+
52
98
  </div>
53
99
  </div>
54
100
 
@@ -57,6 +57,7 @@ class MiddlemacExtras < ::Middleman::Extension
57
57
  super
58
58
 
59
59
  @md_links_b = nil
60
+ @md_links_modern_b = nil
60
61
  @md_images_b = nil
61
62
  @md_sizes_b = nil
62
63
 
@@ -74,6 +75,7 @@ class MiddlemacExtras < ::Middleman::Extension
74
75
  # changes. For speed we don't want to recalculate everything
75
76
  # every time a helper is used, but only the first time.
76
77
  @md_links_b = nil
78
+ @md_links_modern_b = nil
77
79
  @md_images_b = nil
78
80
  @md_sizes_b = nil
79
81
 
@@ -102,6 +104,22 @@ class MiddlemacExtras < ::Middleman::Extension
102
104
  end
103
105
 
104
106
 
107
+ #--------------------------------------------------------
108
+ # This helper provides access to `middlemac-extras`’
109
+ # index of links in Markdown reference format, enabling
110
+ # you to use reference-style links in documents. Because
111
+ # this helper includes literal Markdown, it’s only useful
112
+ # in Markdown documents. This is only useful when using
113
+ # Middlemac 3.0.0 or newer, which includes support for
114
+ # helpbook style links.
115
+ # @return [String] Returns a string with the Markdown
116
+ # index of every page in your project.
117
+ #--------------------------------------------------------
118
+ def md_hblinks
119
+ extensions[:MiddlemacExtras].md_links_modern_b
120
+ end
121
+
122
+
105
123
  #--------------------------------------------------------
106
124
  # This helper provides access to `middlemac-extras`’
107
125
  # index of images in Markdown reference format, enabling
@@ -269,6 +287,31 @@ class MiddlemacExtras < ::Middleman::Extension
269
287
  end
270
288
 
271
289
 
290
+ #########################################################
291
+ # This accessor for @md_links_modern_b lazily populates
292
+ # the backing variable and buffers it for repeated use.
293
+ # In the event of file changes, a server restart is
294
+ # needed.
295
+ # @returns [String] Returns the Markdown reference list.
296
+ # @!visibility private
297
+ #########################################################
298
+ def md_links_modern_b
299
+ unless @md_links_modern_b
300
+ @md_links_modern_b = get_link_data('text/html', 'application/xhtml')
301
+ .collect { |l|
302
+ if l[:title]
303
+ "[#{l[:reference]}]: #{l[:hb_link]} \"#{l[:title]}\""
304
+ else
305
+ "[#{l[:reference]}]: #{l[:hb_link]}"
306
+ end
307
+ }
308
+ .join("\n")
309
+ end
310
+
311
+ @md_links_modern_b
312
+ end
313
+
314
+
272
315
  #########################################################
273
316
  # This accessor for @md_images_b lazily populates the
274
317
  # backing variable and buffers it for repeated use. In
@@ -309,6 +352,7 @@ class MiddlemacExtras < ::Middleman::Extension
309
352
  reference_path.shift
310
353
  reference = File.basename(r.destination_path, '.*').gsub(%r{ }, '_')
311
354
  link = r.url
355
+ hb_link = defined?(r.hb_NavId) ? "#/#{r.hb_NavId}" : nil
312
356
  title = r.data.title ? r.data.title.gsub(%r{</?[^>]+?>}, '') : nil
313
357
 
314
358
  i = 0
@@ -318,7 +362,7 @@ class MiddlemacExtras < ::Middleman::Extension
318
362
  i += 1
319
363
  end
320
364
 
321
- all_links << {:reference => reference, :link => link, :title => title}
365
+ all_links << {:reference => reference, :link => link, :title => title, :hb_link => hb_link}
322
366
  end # .each
323
367
 
324
368
  all_links
@@ -1,5 +1,5 @@
1
1
  module Middleman
2
2
  module MiddlemacExtras
3
- VERSION = '1.0.9'
3
+ VERSION = '1.0.10'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middlemac-extras
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.9
4
+ version: 1.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Derry