README.adoc in relaton-iso-bib-1.18.2 vs README.adoc in relaton-iso-bib-1.19.0

- old
+ new

@@ -25,38 +25,27 @@ $ gem install relaton-iso-bib == Usage -=== Configuration +=== Create ISO bibliographic item -Configuration is optional. The available option is `logger` which is a `Logger` instance. By default, the logger is `Logger.new($stderr)` with `Logger::WARN` level. To change the logger level, use `RelatonIsoBib.configure` block. - [source,ruby] ---- require 'relaton_iso_bib' => true -RelatonIsoBib.configure do |config| - config.logger.level = Logger::DEBUG -end ----- - -=== Create ISO bibliographic item - -[source,ruby] ----- hash = YAML.load_file "spec/examples/iso_bib_item.yml" => { - "schema-version"=>"v1.0.0", + "schema-version"=>"v1.0.3", "id"=>"ISO/TC211", "title"=>[ {"type"=>"title-intro", "content"=>"Geographic information", "language"=>"en", "script"=>"Latn", "format"=>"text/plain"}, ... bib_hash = RelatonIsoBib::HashConverter.hash_to_bib hash -=> {:"schema-version"=>"v1.0.0", +=> {:"schema-version"=>"v1.0.3", :id=>"ISO/TC211", :fetched=>"2011-06-22", :title=> #<RelatonBib::TypedTitleStringCollection:0x00007ff73e922ab0 @array= @@ -186,23 +175,23 @@ item.date => [#<RelatonBib::BibliographicDate:0x00007ff77f894f08 @from=nil, @on="2014", @to=nil, @type="issued">, #<RelatonBib::BibliographicDate:0x00007ff76f161f70 @from=nil, @on="2014-04", @to=nil, @type="published">, #<RelatonBib::BibliographicDate:0x00007ff76f1605f8 @from=nil, @on="2015-05-20", @to=nil, @type="accessed">] -item.date.filter(type: "published").first.on +item.date(type: "published").first.on => "2014-04" -item.date.filter(type: "published").first.on :year +item.date(type: "published").first.on :year => 2014 -item.date.filter(type: "published").first.on :month +item.date(type: "published").first.on :month => 4 -item.date.filter(type: "published").first.on :day +item.date(type: "published").first.on :day => nil -item.date.filter(type: "published").first.on :date +item.date(type: "published").first.on :date => #<Date: 2014-04-01 ((2456749j,0s,0n),+0s,2299161j)> ---- === IsoBibliographicItem DocumentStatus @@ -371,11 +360,11 @@ <title type="title-intro" format="text/plain" language="fr" script="Latn">Information géographique</title> <title type="title-main" format="text/plain" language="fr" script="Latn">Métadonnées</title> <title type="title-part" format="text/plain" language="fr" script="Latn">Information géographique</title> <title type="main" format="text/plain" language="fr" script="Latn">Information géographique – Métadonnées – Information géographique</title> ... - <ext schema-version="v1.0.0"> + <ext schema-version="v1.0.3"> <doctype>international-standard</doctype> ... </ext> </bibdata>" @@ -436,22 +425,26 @@ === Create bibliographic item from YAML [source,ruby] ---- hash = YAML.load_file 'spec/examples/iso_bib_item.yml' -=> {"schema-version"=>"v1.0.0", +=> {"schema-version"=>"v1.0.3", "id"=>"ISO/TC211", ... bib_hash = RelatonIsoBib::HashConverter.hash_to_bib hash -=> {:"schema-version"=>"v1.0.0", +=> {:"schema-version"=>"v1.0.3", :id=>"ISO/TC211", ... RelatonIsoBib::IsoBibliographicItem.new **bib_hash => #<RelatonIsoBib::IsoBibliographicItem:0x007fdb95ba98e8 ... ---- + +=== Logging + +RelatonIsoBib uses the relaton-logger gem for logging. By default, it logs to STDOUT. To change the log levels and add other loggers, read the https://github.com/relaton/relaton-logger#usage[relaton-logger] documentation. == BibliographicItem The ISO standards use a subset of the generic bibliographic fields specified in the https://github.com/metanorma/metanorma-model-iso#iso-bibliographic-item[IsoBibliographicItem model]: