AoBane 0.1.12 → 0.1.13

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -6,170 +6,7 @@ See also [AoBane Syntax](https://github.com/setminami/AoBane/wiki/Details-of-AoB
6
6
 
7
7
  ##What's This and What You Can...
8
8
  This codes are extended from BlueFeather.<br>
9
- The points of difference are
10
- * You can use font TAG like this-> `*[blablabla](color|font faces/font size)`
11
- * *e.g.,* `*[blablabla](red|Times,Arial/5) -expand-> <font color="red" face="Times,Arial" size="5">blablabla</font>`
12
- - And I know that font TAG was duplicated in HTML5...
13
- * You can use MathML by to code LaTeX string surrounding `\TeX{` and `\TeX}`. Use firefox renderer because of MathML specification.
14
- * like this. `\TeX{x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}\TeX} -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>`
15
-
16
- * You can use Auto Numbering Title by seaquential '%' anotation.
17
- * *e.g.*,like below
18
- <pre><code>
19
- {nrange:h2-h5} <- this means header number range is h2-h5.
20
- % foo1 -> <h2 id=xxx>1. foo1</h2>
21
- %% foo1.1 -> <h3 id=xxx>1.1. foo1.1</h3>
22
- %% foo1.2 -> <h3 id=xxx>1.2. foo1.2</h3>
23
- %%% foo1.2.1 -> <h4 id=xxx>1.2.1 foo1.2.1</h4>
24
- % foo2 -> <h2 id=xxx>2. foo2</h2>
25
- ......................
26
- </code></pre>
27
-
28
- * You can use <div> paling.
29
- * Write like below:
30
-
31
- <pre><code>
32
- |-:b=2 solid gray w=300 rad=10-----------------|
33
- |### foo |
34
- |bar |
35
- |----------------------------------------------|
36
- </code></pre>
37
- This syntax expand like below:
38
- <pre><code>
39
- &lt;div style="border:2px solid gray ; width:300px;border-radius:10px;"&gt;
40
- &lt;h3 id="xxx"&gt;foo&lt;/h3&gt;
41
- bar
42
- &lt;/div&gt;
43
- </code></pre>
44
- * You have to start with
45
- - first line |-: and b=[widthof borde line(px)] [Type of line] [Color of line] w=[width(px)] rad=[border radius ratio]--...|
46
- - second and later lines surround with | and spaces
47
- * And end with
48
- - last of border is to write |-...-|
49
- * Header elements in the box can be hashed and joined as one of Table of Contents
50
- * You can use HTML special character by simple way.
51
-
52
- like this
53
- > -- &mdash;
54
-
55
- > <=> &hArr;
56
-
57
- > => &rArr;
58
-
59
- > <= &lArr;
60
-
61
- > ||^ &uArr;
62
-
63
- > ||/ &dArr;
64
-
65
- > <-> &harr;
66
-
67
- > -> &rarr;
68
-
69
- > <- &larr;
70
-
71
- > |^ &uarr;
72
-
73
- > |/ &darr;
74
-
75
- > `>> &raquo;`
76
-
77
- > `<< &laquo;`
78
-
79
- > +_ &plusmn;
80
-
81
- > != &ne;
82
-
83
- > ~~ &asymp;
84
-
85
- > ~= &cong;
86
-
87
- > <_ &le;
88
-
89
- > `>_` &ge;
90
-
91
- > |FA &forall;
92
-
93
- > |EX &exist;
94
-
95
- > (+) &oplus;
96
-
97
- > (x) &otimes;
98
-
99
- > (c) &copy;
100
-
101
- > (R) &reg;
102
-
103
- > (SS) &sect;
104
-
105
- > (TM) &trade;
106
-
107
- > !in &notin;
108
-
109
- <h2> 2.6 Table Caption</h2>
110
- Do you want to insert a caption to &lt;table&gt;? You can insert in AoBane. <br>
111
- Like this:<br>
112
- <pre><code>
113
- [foo]{#bar}
114
- |fruits|price
115
- |------|-----
116
- |Apple|$0.5
117
- |Orange|$0.3
118
- </code></pre>
119
- the first line [foo]{#bar} and this table, expands HTML as below:<br>
120
- <pre><code>
121
- &lt;table id="#bar"&gt;
122
- &lt;caption&gt;foo&lt;/caption&gt;
123
- &lt;thead&gt;&lt;tr&gt;
124
- &lt;th&gt;fruits&lt;/th&gt;
125
- &lt;th&gt;price&lt;/th&gt;
126
- &lt;/tr&gt;&lt;/thead&gt;
127
- &lt;tbody&gt;
128
- &lt;tr&gt;
129
- &lt;td&gt;Apple&lt;/td&gt;
130
- &lt;td&gt;$0.5&lt;/td&gt;
131
- &lt;/tr&gt;
132
- &lt;tr&gt;
133
- &lt;td&gt;Orange&lt;/td&gt;
134
- &lt;td&gt;$0.3&lt;/td&gt;
135
- &lt;/tr&gt;
136
- &lt;/tbody&gt;
137
- &lt;/table&gt;
138
- </code></pre>
139
- The "#bar" is adapted to table id, and "foo" is surrounded by &lt;captin&gt; and &lt;/caption&gt; as elements in following table. When you put caption to a table, you should write `[Table 1](#Table1)` somewhere in your Markdown. So, you can jump to a table from the link. <br>
140
- Of course, you can omit this.
141
-
142
- <h2> 2.7 Abbreviation </h2>
143
- Especially for not ASCII languagers, I need to study some more, perhaps about morphorogical analysis. So, if you use this function, you have to be careful.
144
-
145
- This function is implementation of [Abbreviations](http://michelf.ca/projects/php-markdown/extra/#abbr) specifies in PHP Markdown Extra. And my some Idea which can make a UTF-8 textfile as other file definitions of abbreviation is implemented. In this case, Markdown is wrote like this:
146
- <pre><code>
147
- {abbrnote:./dicSample.txt}
148
- ......
149
- </code></pre>
150
- And dicSample.txt in same directory with Markdown&mdash;you can name as you like&mdash;is like below:
151
- <pre><code>
152
- *[foo1]:bar
153
- *[foo2]:barbar
154
- *[foo3]:barbarbar
155
- ......
156
- </code></pre>
157
- Because I set as this, you can create individual word set about your each Markdown files.And you may write like as:
158
- <pre><code>
159
- {abbrnote:../share/dicSample.txt}
160
- ......
161
- *[foo0]:foo
162
- </code></pre>
163
- And ../share/dicSample.txt is
164
- <pre><code>
165
- *[foo1]:bar
166
- *[foo2]:barbar
167
- *[foo3]:barbarbar
168
- ......
169
- </code></pre>
170
- If You created files like this, you can controll a word set. For instance, foo0 is adapted only the above Markdown file, and foo1, foo2, foo3,...is adopted all Markdown files which is wrote <code>{abbrnote:../share/dicSample.txt}</code>.
171
-
172
- Of course, you can use like PHP Markdown Extra. Incidentally,this function is not implemented on BlueFeather.
9
+ Please see [Wiki page](https://github.com/setminami/AoBane/wiki/Details-of-AoBane-Syntax)
173
10
 
174
11
  ##How to Install
175
12
  Just try
@@ -4,6 +4,7 @@
4
4
 
5
5
  require 'logger'
6
6
  require 'singleton'
7
+ require 'date'
7
8
 
8
9
  $S_SLOT = 0
9
10
  $N_SLOT = 1
@@ -14,6 +15,17 @@ module Utilities
14
15
  $MAX_H = 6
15
16
  @@log = Logger.new(STDOUT)
16
17
  @@log.level = Logger::WARN
18
+ ###Insert Timestamp#################################################################
19
+ def insertTimeStamp(text)
20
+ text.gsub!(/\$date/i){
21
+ getNowTime
22
+ }
23
+ end
24
+ ###get Now Timestamp#################################################################
25
+ def getNowTime
26
+ return Time.now.to_s
27
+ end
28
+
17
29
  ###Abbreviation proccessing##########################################################
18
30
  AbbrHashTable = Hash::new
19
31
  AbbrPattern = '\*\[(.+?)\]:(.*)\s*$'
@@ -22,7 +34,6 @@ def abbrPreProcess(text)
22
34
  if text.nil? then return '' end
23
35
  text.lines{ |line|
24
36
  if line =~ /\{abbrnote:(.+?)\}/i then #1
25
- p "*****"
26
37
  if $1.nil? then '' #1.5
27
38
  else
28
39
  File::open($1){|file| #2
@@ -174,6 +185,8 @@ end #def postPailing
174
185
  return h*times + number + str
175
186
  end #def
176
187
 
188
+ module_function :getNowTime
189
+ module_function :insertTimeStamp
177
190
  module_function :abbrPreProcess
178
191
  module_function :abbrPostProcess
179
192
  module_function :storeAbbr
@@ -1,3 +1,3 @@
1
1
  module AoBane
2
- VERSION = "0.1.12"
2
+ VERSION = "0.1.13"
3
3
  end
data/lib/AoBane.rb CHANGED
@@ -51,9 +51,9 @@ require 'AoBane/utilities'
51
51
  require 'math_ml/string'
52
52
 
53
53
  module AoBane
54
- VERSION = '0.1.12'
55
- VERSION_NUMBER = 0.0112
56
- RELEASE_DATE = '2013-04-21'
54
+ VERSION = '0.1.13'
55
+ VERSION_NUMBER = 0.0113
56
+ RELEASE_DATE = '2013-04-23'
57
57
  VERSION_LABEL = "#{VERSION} (#{RELEASE_DATE})"
58
58
 
59
59
  UTF8_BOM = "\xef\xbb\xbf"
@@ -661,6 +661,7 @@ module AoBane
661
661
  #Insert by set.minami 2013-04-21
662
662
  text = Utilities::abbrPostProcess(text)
663
663
  #Insert by set.minami 2013-03-30
664
+ text = Utilities::insertTimeStamp(text)
664
665
  #output = text.split("\n")
665
666
  specialChar = {
666
667
  "\-\-" => "&mdash;",
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.1.12
4
+ version: 0.1.13
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: 2013-04-21 00:00:00.000000000 Z
12
+ date: 2013-04-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: math_ml