README.markdown in xbel-0.2.4 vs README.markdown in xbel-0.2.5
- old
+ new
@@ -1,9 +1,14 @@
# xbel
Introduces XBEL decorations for Nokogiri.
+## Features
+
+ * generates IDs for bookmarks and folders
+ * decorates a Nokogiri::XML::Node, all Nokogiri methods are available
+
## Installation
gem install xbel
## Using
@@ -11,19 +16,21 @@
require 'rubygems'
require 'xbel'
### Reading
- XBEL.open('test/wikipedia.xbel')[:f0].bookmarks.
+ XBEL.open('test/wikipedia.xbel')[:test_1_1].bookmarks.
map do |bookmark|
link_to bookmark.title, bookmark.href
end
### Writing
xbel = XBEL.new
xbel.build_folder 'XBEL' do |folder|
- folder.build_bookmark "boof's xbel", 'http://github.com/boof/xbel'
+ bm = folder.build_bookmark "boof's xbel", 'http://github.com/boof/xbel'
+ # nodes receive IDs and can be accessed via the :[] method
+ bm == xbel[bm.id]
end
File.open('my.xbel', 'w') { |file| file << xbel }
_Note: You can use all Nokogiri::XML::Node methods._