middleman-plaintext 0.8.0 → 0.8.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
  SHA1:
3
- metadata.gz: e8b489cb329dbdc6de7f164dbe87a5b1a2ad6116
4
- data.tar.gz: 2416e0bedfe5afa5ef7bd4357fb9b2e96ed9c443
3
+ metadata.gz: 9399fbd5517fd246964c7041c70b880b1f4aac10
4
+ data.tar.gz: b831625b4a2973f1f3db401f84ddbc1f3948f6b5
5
5
  SHA512:
6
- metadata.gz: e73f75c621490a830ffef49a08bd65df0ca0d53d807339e5996630bbe1c14b186dce7cffb8008fce1a78d21eabf391df7372e816ffb613ba0a269524883b56cc
7
- data.tar.gz: 488663d17561d3376b644f7144b6fdc2fc51c1b0ab1bb748d5aa4fd2745cf1013c25f536fb112feefbaf96e16a1de3cd370520de01cf892e2975c17f16765819
6
+ metadata.gz: bbb0592f76780922f7005913f9deb82e05459bf82b326a48c46c668b3ec04e50f5d1de9bbb1c0b42bfb46dafad386e0c453421a5fbfa230331749f215acf643c
7
+ data.tar.gz: 42935ca55e4d2c12655274a38b12b90cf56fae16ec12d6c2c0a56db737d980ea302376aea009becd93a41413bf6fe363fab11e60324b5d7c8437d92fbef9b90c
data/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  Generate plaintext versions of resources. Inspired heavily by John Gruber at [daring fireball][], displaying the raw markdown used to generate a post by appending `.text` to the URL. (eg, <http://daringfireball.net/2010/07/improved_regex_for_matching_urls.text>)
4
4
 
5
+ [daring fireball]: https://daringfireball.net/
6
+
5
7
  ## Usage
6
8
 
7
9
  Out of the box the extension expects `layout/layout.text.erb` to be the layout for plaintext rendering of resources, and it also will ignore all resources.
@@ -23,6 +25,8 @@ A slightly more real-world example overrides the template name, and only "plaint
23
25
  end
24
26
  end
25
27
 
28
+ You can also change the output filename with the `filename` option. Defaults to `index.text`.
29
+
26
30
  ## Helpful things to know
27
31
 
28
32
  * Current resource is `current_page` in the layout as usual
@@ -33,3 +37,13 @@ A slightly more real-world example overrides the template name, and only "plaint
33
37
  * Render the source file completely raw, without the frontmatter
34
38
 
35
39
  Middleman::FileRenderer.new(@app, current_page.file_descriptor[:full_path].to_s).template_data_for_file
40
+
41
+ ## Changelog
42
+
43
+ ### v0.8.1
44
+
45
+ * Turn output filename into an option, `filename`
46
+
47
+ ### v0.8.0
48
+
49
+ * Initial release. Generates index.text files based on handler with specified layout.
@@ -4,6 +4,7 @@ require "middleman-core"
4
4
  module Middleman
5
5
  class PlaintextExtension < Extension
6
6
 
7
+ option :filename, "index.text", "Name of file to output plaintext in"
7
8
  option :layout, "layout.text", "Layout to use for text file"
8
9
  option :handle_file, -> (resource) { false }, "block to decide whether to plaintext a resource"
9
10
 
@@ -23,7 +24,7 @@ module Middleman
23
24
  end
24
25
 
25
26
  def textify(resource)
26
- to = resource.destination_path.sub("/index.html", "/index.text")
27
+ to = resource.destination_path.sub("/index.html", "/#{options[:filename]}")
27
28
  source = resource.file_descriptor[:full_path].to_s
28
29
 
29
30
  ::Middleman::Sitemap::Resource.new(app.sitemap, to, source).tap do |r|
@@ -1,5 +1,5 @@
1
1
  module Middleman
2
2
  module Plaintext
3
- VERSION = "0.8.0"
3
+ VERSION = "0.8.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman-plaintext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Caius Durling
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-29 00:00:00.000000000 Z
11
+ date: 2016-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: middleman-core