hierogloss 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +19 -0
- data/.travis.yml +3 -0
- data/GARDINER-LICENSE.txt +6 -0
- data/Gemfile +4 -0
- data/KRAMDOWN-LICENSE.txt +29 -0
- data/LICENSE.txt +15 -0
- data/README.md +72 -0
- data/Rakefile +8 -0
- data/UNICODE-DATA-LICENSE.txt +15 -0
- data/UNLICENSE.txt +30 -0
- data/assets/fonts/Gardiner.eot +0 -0
- data/assets/fonts/Gardiner.otf +0 -0
- data/assets/fonts/Gardiner.svg +13593 -0
- data/assets/fonts/Gardiner.ttf +0 -0
- data/assets/fonts/Gardiner.woff +0 -0
- data/bin/hierogloss +25 -0
- data/data/Unicode-MdC-Mapping-v1.utf8 +1001 -0
- data/data/hierogloss.html.erb +55 -0
- data/examples/disjunction.md +13 -0
- data/examples/disjunction.png +0 -0
- data/examples/liverpool.md +11 -0
- data/hierogloss.gemspec +26 -0
- data/lib/hierogloss/dictionary.rb +39 -0
- data/lib/hierogloss/gloss.rb +174 -0
- data/lib/hierogloss/version.rb +3 -0
- data/lib/hierogloss.rb +24 -0
- data/lib/kramdown/converter/bbcode.rb +113 -0
- data/lib/kramdown/converter/htlal.rb +34 -0
- data/lib/kramdown/parser/hierogloss.rb +37 -0
- data/src/Gardiner.ttf +0 -0
- data/test/minitest_helper.rb +4 -0
- data/test/test_dictionary.rb +50 -0
- data/test/test_gloss.rb +43 -0
- data/test/test_hierogloss.rb +7 -0
- data/test/test_kramdown_extensions.rb +72 -0
- metadata +157 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 95e96759e2925f55b6fbb05fe67628680de08e7a
|
4
|
+
data.tar.gz: 7ead6a34ffe4281f10ec7cebaa94a14bca713009
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 2f6d2686c6ba86ce7cc215652c8f6534fdaa3543a52adb6dee4eecdd32d3fb6b9d446d4ebd408e0bb7aad5faa61043059af9ecfbdc573068ad93cae0a22f74d4
|
7
|
+
data.tar.gz: 5fbf2d371331598c34df3b5786ef9ba954f5f769d43d54fed97e1dc6be8125a8b20ad4605a498ebcdd8fc5c363254820eb0c7851a97c85a75fc698ae27571844
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
kramdown - fast, pure-Ruby Markdown-superset converter
|
2
|
+
Copyright (C) 2009-2013 Thomas Leitner <t_leitner@gmx.at>
|
3
|
+
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a
|
5
|
+
copy of this software and associated documentation files (the
|
6
|
+
"Software"), to deal in the Software without restriction, including
|
7
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
8
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
9
|
+
permit persons to whom the Software is furnished to do so, subject to
|
10
|
+
the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included
|
13
|
+
in all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
16
|
+
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
18
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
19
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
20
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
21
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
|
+
|
23
|
+
|
24
|
+
Some test cases and the benchmark files are based on test cases from
|
25
|
+
the MDTest test suite:
|
26
|
+
|
27
|
+
MDTest
|
28
|
+
Copyright (c) 2007 Michel Fortin
|
29
|
+
<http://www.michelf.com/>
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
Copyright (c) 2014 Eric Kidd and other contributors
|
2
|
+
|
3
|
+
Almost all of the code in this gem is in the public domain. See
|
4
|
+
`UNLICENSE.txt` for details. However, there are several exceptions:
|
5
|
+
|
6
|
+
* `data/Unicode-MdC-Mapping-v1.utf8` is distributed under the Unicode
|
7
|
+
data file license. See `UNICODE-DATA-LICENSE.txt` for details.
|
8
|
+
* Parts of `data/hierogloss.html.erb` are from Kramdown, and they are
|
9
|
+
presumbly Copyright (C) 2009-2013 Thomas Leitner <t_leitner@gmx.at>.
|
10
|
+
There are also a few scattered lines here and there in the `lib/kramdown`
|
11
|
+
directory which I copied from Kramdown, but not much. See
|
12
|
+
`KRAMDOWN-LICENSE.txt` for details of how this code is licensed.
|
13
|
+
* `src/Gardiner.ttf` and the derviatives in `assets/fonts` were distributed
|
14
|
+
George Durus with a blanket permission grant, but not a real license.
|
15
|
+
See `GARDINER-LICENSE.txt` for details.
|
data/README.md
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
# Hierogloss
|
2
|
+
|
3
|
+
**WORK IN PROGRESS. Future releases may change how things work.**
|
4
|
+
|
5
|
+
Hierogloss allows you to mix glossed hieroglyphic texts with Markdown-style
|
6
|
+
formatting. For example, you can write:
|
7
|
+
|
8
|
+
# Disjunction in Middle Egyptian
|
9
|
+
|
10
|
+
This example is based on one in Allen's excellent [Middle Egyptian: An
|
11
|
+
Introduction to the Language and Culture of Hieroglyphs][allen].
|
12
|
+
|
13
|
+
H: 𓊃𓀀𓏤 | 𓊃𓏏𓁐 | 𓂋𓏤𓊪𓅱
|
14
|
+
L: s | s.t | r-pw
|
15
|
+
G: man | woman | whichever
|
16
|
+
T: either [a] man or [a] woman
|
17
|
+
|
18
|
+
You can emphasize an "or" by following the options with {r-pw}.
|
19
|
+
|
20
|
+
[allen]: http://www.amazon.com/Middle-Egyptian-Introduction-Language-Hieroglyphs/dp/0521741440
|
21
|
+
|
22
|
+
Note that the inline transliteration is marked with \{ and \}, and that all
|
23
|
+
transliterations are given in MdC format. This allows transliterations to
|
24
|
+
be presented in an appropriate font with Unicode characters.
|
25
|
+
|
26
|
+
You can render this as HTML by running:
|
27
|
+
|
28
|
+
hierogloss example.md > example.html
|
29
|
+
|
30
|
+
This will give you the following:
|
31
|
+
|
32
|
+
> ![](examples/disjunction.png)
|
33
|
+
|
34
|
+
If you wish to post your text on an online forum, you may have luck with
|
35
|
+
`bbcode` mode:
|
36
|
+
|
37
|
+
hierogloss -f bbcode example.md > example.bbcode
|
38
|
+
|
39
|
+
Note that `bbcode` does not support all the features of Markdown, although
|
40
|
+
I'm happy to implement more of them--or to accept patches!
|
41
|
+
|
42
|
+
## Installation
|
43
|
+
|
44
|
+
To install Hierogloss, make sure you have a working Ruby 2.0 setup, and
|
45
|
+
then run the following:
|
46
|
+
|
47
|
+
$ gem install hierogloss
|
48
|
+
|
49
|
+
## Using Hierogloss from a program
|
50
|
+
|
51
|
+
Add this line to your application's Gemfile:
|
52
|
+
|
53
|
+
gem 'hierogloss'
|
54
|
+
|
55
|
+
And then execute:
|
56
|
+
|
57
|
+
$ bundle
|
58
|
+
|
59
|
+
To convert Hierogloss-format text to HTML, use the regular Kramdown APIs,
|
60
|
+
but pass `input: 'hierogloss'` as an argument:
|
61
|
+
|
62
|
+
require 'kramdown'
|
63
|
+
require 'hierogloss'
|
64
|
+
Kramdown::Document.new(text, input: 'hierogloss').to_html
|
65
|
+
|
66
|
+
## Contributing
|
67
|
+
|
68
|
+
1. Fork it
|
69
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
70
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
71
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
72
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE
|
2
|
+
|
3
|
+
Unicode Data Files include all data files under the directories http://www.unicode.org/Public/, http://www.unicode.org/reports/, and http://www.unicode.org/cldr/data/. Unicode Data Files do not include PDF online code charts under the directory http://www.unicode.org/Public/. Software includes any source code published in the Unicode Standard or under the directories http://www.unicode.org/Public/, http://www.unicode.org/reports/, and http://www.unicode.org/cldr/data/.
|
4
|
+
|
5
|
+
NOTICE TO USER: Carefully read the following legal agreement. BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE.
|
6
|
+
|
7
|
+
COPYRIGHT AND PERMISSION NOTICE
|
8
|
+
|
9
|
+
Copyright © 1991-2013 Unicode, Inc. All rights reserved. Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
|
10
|
+
|
11
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of the Unicode data files and any associated documentation (the "Data Files") or Unicode software and any associated documentation (the "Software") to deal in the Data Files or Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Data Files or Software, and to permit persons to whom the Data Files or Software are furnished to do so, provided that (a) the above copyright notice(s) and this permission notice appear with all copies of the Data Files or Software, (b) both the above copyright notice(s) and this permission notice appear in associated documentation, and (c) there is clear notice in each modified Data File or in the Software as well as in the documentation associated with the Data File(s) or Software that the data or software has been modified.
|
12
|
+
|
13
|
+
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR SOFTWARE.
|
14
|
+
|
15
|
+
Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in these Data Files or Software without prior written authorization of the copyright holder.
|
data/UNLICENSE.txt
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
See LICENSE.txt for notes for a list of third-party code that falls
|
2
|
+
under other licenses. All the original code in this gem, however,
|
3
|
+
is in the public domain as described below.
|
4
|
+
|
5
|
+
---
|
6
|
+
|
7
|
+
This is free and unencumbered software released into the public domain.
|
8
|
+
|
9
|
+
Anyone is free to copy, modify, publish, use, compile, sell, or
|
10
|
+
distribute this software, either in source code form or as a compiled
|
11
|
+
binary, for any purpose, commercial or non-commercial, and by any
|
12
|
+
means.
|
13
|
+
|
14
|
+
In jurisdictions that recognize copyright laws, the author or authors
|
15
|
+
of this software dedicate any and all copyright interest in the
|
16
|
+
software to the public domain. We make this dedication for the benefit
|
17
|
+
of the public at large and to the detriment of our heirs and
|
18
|
+
successors. We intend this dedication to be an overt act of
|
19
|
+
relinquishment in perpetuity of all present and future rights to this
|
20
|
+
software under copyright law.
|
21
|
+
|
22
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
23
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
24
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
25
|
+
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
26
|
+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
27
|
+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
28
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
29
|
+
|
30
|
+
For more information, please refer to <http://unlicense.org/>
|
Binary file
|
Binary file
|