Inaho 🌾
A gem to easily build XML Files to create Dictionaries for Apple's Dictionary.app.
Requirements
- Ruby >= 2.0
- Dictionary Development Kit
Installation
Add this to your gemfile
gem 'inaho'
and
bundle
Usage
Create a Dictionary.
dictionary = Inaho::Dictionary.new
Add Entries to your Dictionary.
entry = Inaho::Entry.new(id: 1, title: "稲穂", yomi: "いなほ")
entry.add_index("稲穂")
entry.add_index("いなほ")
entry.add_index("inaho")
entry.add_index("ear (head) of rice")
entry.body = "<h3>稲穂 (いなほ)</h3> <ul><li>ear (head) of rice</li></ul>"
dictionary << entry
Build your Dictionary XML File
xml = dictionary.to_xml
File.write('./dictionary.xml', xml)
Create your Dictionary with Apple's Dictionary Development Kit.
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request