middleman-utf8-partial 0.0.1
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.
- data/.gitignore +17 -0
- data/.rvmrc +1 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +44 -0
- data/Rakefile +2 -0
- data/lib/middleman-utf8-partial.rb +3 -0
- data/lib/middleman-utf8-partial/utf8_partial.rb +15 -0
- data/lib/middleman-utf8-partial/version.rb +7 -0
- data/lib/middleman_init.rb +2 -0
- data/middleman-utf8-partial.gemspec +17 -0
- metadata +56 -0
data/.gitignore
ADDED
data/.rvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm use 1.9.2@middleman-utf8-partial
|
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 Matthieu Sadouni
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
# Middleman::Utf8::Partial
|
2
|
+
|
3
|
+
Allows the usage of utf-8 encoded Markdown partials.
|
4
|
+
|
5
|
+
## Why
|
6
|
+
|
7
|
+
[An issue in Tilt](https://github.com/rtomayko/tilt/issues/75) prevents the usage of Markdown partials encoded in utf-8.
|
8
|
+
|
9
|
+
[This Stackoverflow thread](http://stackoverflow.com/questions/10341550/incompatible-character-encoding-in-simple-sinatra-app) provides a workaround by force-encoding the output of the partial.
|
10
|
+
|
11
|
+
This gem overrides the `partial` helper method in Middleman to force-encode the result in utf-8, allowing to call it as if it worked out of the box :
|
12
|
+
|
13
|
+
.article= partial 'article'
|
14
|
+
|
15
|
+
where `source/_article.md` is an utf-8 encoded Markdown file.
|
16
|
+
|
17
|
+
## Installation
|
18
|
+
|
19
|
+
Add this line to your application's Gemfile:
|
20
|
+
|
21
|
+
gem 'middleman-utf8-partial'
|
22
|
+
|
23
|
+
And then execute:
|
24
|
+
|
25
|
+
$ bundle
|
26
|
+
|
27
|
+
Or install it yourself as:
|
28
|
+
|
29
|
+
$ gem install middleman-utf8-partial
|
30
|
+
|
31
|
+
## Usage
|
32
|
+
|
33
|
+
Activate the gem in `config.rb` :
|
34
|
+
|
35
|
+
activate :utf8_partial
|
36
|
+
|
37
|
+
## Contributing
|
38
|
+
|
39
|
+
1. Fork it
|
40
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
41
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
42
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
43
|
+
5. Create new Pull Request
|
44
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
module Middleman::Features::Utf8Partial
|
2
|
+
class << self
|
3
|
+
def registered(app)
|
4
|
+
app.helpers HelperMethods
|
5
|
+
end
|
6
|
+
alias :included :registered
|
7
|
+
end
|
8
|
+
|
9
|
+
module HelperMethods
|
10
|
+
def partial(template, options = {})
|
11
|
+
super(template, options).force_encoding('utf-8')
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/middleman-utf8-partial/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.authors = ["Matthieu Sadouni"]
|
6
|
+
gem.email = ["matthieusadouni@gmail.com"]
|
7
|
+
gem.description = %q{Middleman gem to allow the usage of markdown partials in utf-8}
|
8
|
+
gem.summary = %q{}
|
9
|
+
gem.homepage = ""
|
10
|
+
|
11
|
+
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
12
|
+
gem.files = `git ls-files`.split("\n")
|
13
|
+
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
14
|
+
gem.name = "middleman-utf8-partial"
|
15
|
+
gem.require_paths = ["lib"]
|
16
|
+
gem.version = Middleman::Utf8::Partial::VERSION
|
17
|
+
end
|
metadata
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: middleman-utf8-partial
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Matthieu Sadouni
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-05-16 00:00:00.000000000Z
|
13
|
+
dependencies: []
|
14
|
+
description: Middleman gem to allow the usage of markdown partials in utf-8
|
15
|
+
email:
|
16
|
+
- matthieusadouni@gmail.com
|
17
|
+
executables: []
|
18
|
+
extensions: []
|
19
|
+
extra_rdoc_files: []
|
20
|
+
files:
|
21
|
+
- .gitignore
|
22
|
+
- .rvmrc
|
23
|
+
- Gemfile
|
24
|
+
- LICENSE
|
25
|
+
- README.md
|
26
|
+
- Rakefile
|
27
|
+
- lib/middleman-utf8-partial.rb
|
28
|
+
- lib/middleman-utf8-partial/utf8_partial.rb
|
29
|
+
- lib/middleman-utf8-partial/version.rb
|
30
|
+
- lib/middleman_init.rb
|
31
|
+
- middleman-utf8-partial.gemspec
|
32
|
+
homepage: ''
|
33
|
+
licenses: []
|
34
|
+
post_install_message:
|
35
|
+
rdoc_options: []
|
36
|
+
require_paths:
|
37
|
+
- lib
|
38
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
44
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
45
|
+
none: false
|
46
|
+
requirements:
|
47
|
+
- - ! '>='
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '0'
|
50
|
+
requirements: []
|
51
|
+
rubyforge_project:
|
52
|
+
rubygems_version: 1.8.17
|
53
|
+
signing_key:
|
54
|
+
specification_version: 3
|
55
|
+
summary: ''
|
56
|
+
test_files: []
|