AoBane 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/AoBane.gemspec CHANGED
@@ -18,6 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
+ spec.add_dependency "math_ml"
21
22
  spec.add_development_dependency "bundler", "~> 1.3"
22
23
  spec.add_development_dependency "rake"
23
24
  end
data/README.md CHANGED
@@ -9,6 +9,9 @@ The points of difference are
9
9
  * You can use font TAG like this-> `*[blablabla](color|font faces#font size)`
10
10
  * *e.g.,* `*[blablabla](red|Times,Arial#5) -expand-> <font color="red" face="Times,Arial" size="5">blablabla</font>`
11
11
  - And I know that font TAG was duplicated in HTML5...
12
+ * You can use MathML by to code LaTeX string surrounding `\{` and `\}`. Use firefox renderer because of MathML specification.
13
+ * like this. `\{x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}\} -expand-> <math xmlns='http://www.w3.org/1998/Math/MathML' display='inline'><mi>x</mi><mo>=</mo><mfrac><mrow><mo>-</mo><mi>b</mi><mo>&pm;</mo><msqrt><mrow><msup><mi>b</mi><mn>2</mn></msup><mo>-</mo><mn>4</mn><mi>a</mi><mi>c</mi></mrow></msqrt></mrow><mrow><mn>2</mn><mi>a</mi></mrow></mfrac></math>`
14
+
12
15
  * You can use HTML special character by simple way.
13
16
 
14
17
  like this
@@ -69,4 +72,5 @@ like this
69
72
  > (TM) &trade;
70
73
 
71
74
  ##How to Install
72
- Under costructing...wait a minutes
75
+ Just try
76
+ `sudo gem install AoBane`
@@ -1,3 +1,3 @@
1
1
  module AoBane
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/lib/AoBane.rb CHANGED
@@ -38,7 +38,7 @@ require 'logger'
38
38
  require 'strscan'
39
39
  require 'stringio'
40
40
  require 'uri'
41
-
41
+ require "math_ml/string"
42
42
 
43
43
  module AoBane
44
44
  VERSION = '0.01'
@@ -520,6 +520,11 @@ module AoBane
520
520
  if $4.nil? then '' else $4.delete('#') end + '">' +
521
521
  $1 + '</font>'
522
522
  }
523
+
524
+ #Insert by set.minami 2013-04-01
525
+ text.gsub!(/\\{(.*?)\\}/){ |match|
526
+ if $1.nil? then '' else $1.to_mathml end
527
+ }
523
528
  #Insert by set.minami
524
529
 
525
530
  # Filter HTML if we're asked to do so
@@ -2188,4 +2193,4 @@ module AoBane
2188
2193
  end
2189
2194
 
2190
2195
  end
2191
- end
2196
+ end
data/test/Test.html CHANGED
@@ -8,5 +8,7 @@
8
8
 
9
9
  <h1 id="bfheader-0cbc6611f5540bd0809a388dc95a615b">Test</h1>
10
10
 
11
+ <math xmlns='http://www.w3.org/1998/Math/MathML' display='inline'><mi>x</mi><mo>=</mo><mfrac><mrow><mo>-</mo><mi>b</mi><mo>&pm;</mo><msqrt><mrow><msup><mi>b</mi><mn>2</mn></msup><mo>-</mo><mn>4</mn><mi>a</mi><mi>c</mi></mrow></msqrt></mrow><mrow><mn>2</mn><mi>a</mi></mrow></mfrac></math>
12
+
11
13
  </body>
12
14
  </html>
data/test/Test.md CHANGED
@@ -1,2 +1,3 @@
1
1
  Test
2
2
  ===
3
+ \{x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}\}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: AoBane
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,8 +9,24 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-31 00:00:00.000000000 Z
12
+ date: 2013-04-01 00:00:00.000000000 Z
13
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: math_ml
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
14
30
  - !ruby/object:Gem::Dependency
15
31
  name: bundler
16
32
  requirement: !ruby/object:Gem::Requirement