AoBane 0.1.12 → 0.1.13
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/README.md +1 -164
- data/lib/AoBane/utilities.rb +14 -1
- data/lib/AoBane/version.rb +1 -1
- data/lib/AoBane.rb +4 -3
- metadata +2 -2
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
|
-
|
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>±</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
|
-
<div style="border:2px solid gray ; width:300px;border-radius:10px;">
|
40
|
-
<h3 id="xxx">foo</h3>
|
41
|
-
bar
|
42
|
-
</div>
|
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
|
-
> -- —
|
54
|
-
|
55
|
-
> <=> ⇔
|
56
|
-
|
57
|
-
> => ⇒
|
58
|
-
|
59
|
-
> <= ⇐
|
60
|
-
|
61
|
-
> ||^ ⇑
|
62
|
-
|
63
|
-
> ||/ ⇓
|
64
|
-
|
65
|
-
> <-> ↔
|
66
|
-
|
67
|
-
> -> →
|
68
|
-
|
69
|
-
> <- ←
|
70
|
-
|
71
|
-
> |^ ↑
|
72
|
-
|
73
|
-
> |/ ↓
|
74
|
-
|
75
|
-
> `>> »`
|
76
|
-
|
77
|
-
> `<< «`
|
78
|
-
|
79
|
-
> +_ ±
|
80
|
-
|
81
|
-
> != ≠
|
82
|
-
|
83
|
-
> ~~ ≈
|
84
|
-
|
85
|
-
> ~= ≅
|
86
|
-
|
87
|
-
> <_ ≤
|
88
|
-
|
89
|
-
> `>_` ≥
|
90
|
-
|
91
|
-
> |FA ∀
|
92
|
-
|
93
|
-
> |EX ∃
|
94
|
-
|
95
|
-
> (+) ⊕
|
96
|
-
|
97
|
-
> (x) ⊗
|
98
|
-
|
99
|
-
> (c) ©
|
100
|
-
|
101
|
-
> (R) ®
|
102
|
-
|
103
|
-
> (SS) §
|
104
|
-
|
105
|
-
> (TM) ™
|
106
|
-
|
107
|
-
> !in ∉
|
108
|
-
|
109
|
-
<h2> 2.6 Table Caption</h2>
|
110
|
-
Do you want to insert a caption to <table>? 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
|
-
<table id="#bar">
|
122
|
-
<caption>foo</caption>
|
123
|
-
<thead><tr>
|
124
|
-
<th>fruits</th>
|
125
|
-
<th>price</th>
|
126
|
-
</tr></thead>
|
127
|
-
<tbody>
|
128
|
-
<tr>
|
129
|
-
<td>Apple</td>
|
130
|
-
<td>$0.5</td>
|
131
|
-
</tr>
|
132
|
-
<tr>
|
133
|
-
<td>Orange</td>
|
134
|
-
<td>$0.3</td>
|
135
|
-
</tr>
|
136
|
-
</tbody>
|
137
|
-
</table>
|
138
|
-
</code></pre>
|
139
|
-
The "#bar" is adapted to table id, and "foo" is surrounded by <captin> and </caption> 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—you can name as you like—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
|
data/lib/AoBane/utilities.rb
CHANGED
@@ -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
|
data/lib/AoBane/version.rb
CHANGED
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.
|
55
|
-
VERSION_NUMBER = 0.
|
56
|
-
RELEASE_DATE = '2013-04-
|
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
|
"\-\-" => "—",
|
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.
|
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-
|
12
|
+
date: 2013-04-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: math_ml
|