asciidoctor-html5ruby 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/asciidoctor-html5ruby/extension.rb +13 -4
- metadata +2 -2
@@ -4,12 +4,21 @@ require 'asciidoctor/extensions'
|
|
4
4
|
include ::Asciidoctor
|
5
5
|
|
6
6
|
class HTML5RubyMacro < Extensions::InlineMacroProcessor
|
7
|
-
option :pos_attrs, ['rt']
|
7
|
+
option :pos_attrs, ['rpbegin', 'rt', 'rpend']
|
8
8
|
|
9
9
|
def process parent, target, attributes
|
10
|
-
|
11
|
-
|
10
|
+
if attributes.size == 2 and attributes.key?(1) and attributes.key?("rpbegin")
|
11
|
+
# for example, html5ruby:楽聖少女[がくせいしょうじょ]
|
12
|
+
rt = attributes[1]
|
13
|
+
rt ||= ""
|
14
|
+
rpbegin = '('
|
15
|
+
rpend = ')'
|
16
|
+
else
|
17
|
+
rpbegin = attributes['rpbegin']
|
18
|
+
rt = attributes['rt']
|
19
|
+
rpend = attributes['rpend']
|
20
|
+
end
|
12
21
|
|
13
|
-
%(<ruby>#{target}<rt>#{rt}</rt></ruby>)
|
22
|
+
%(<ruby>#{target}<rp>#{rpbegin}</rp><rt>#{rt}</rt><rp>#{rpend}</rp></ruby>)
|
14
23
|
end
|
15
24
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asciidoctor-html5ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-03-
|
12
|
+
date: 2014-03-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: asciidoctor
|