= RelatonItu: retrieve ITU Standards for bibliographic use using the BibliographicItem model image:https://img.shields.io/gem/v/relaton-itu.svg["Gem Version", link="https://rubygems.org/gems/relaton-itu"] image:https://github.com/relaton/relaton-itu/workflows/macos/badge.svg["Build Status (macOS)", link="https://github.com/relaton/relaton-itu/actions?workflow=macos"] image:https://github.com/relaton/relaton-itu/workflows/windows/badge.svg["Build Status (Windows)", link="https://github.com/relaton/relaton-itu/actions?workflow=windows"] image:https://github.com/relaton/relaton-itu/workflows/ubuntu/badge.svg["Build Status (Ubuntu)", link="https://github.com/relaton/relaton-itu/actions?workflow=ubuntu"] image:https://codeclimate.com/github/relaton/relaton-itu/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/relaton/relaton-itu"] image:https://img.shields.io/github/issues-pr-raw/relaton/relaton-itu.svg["Pull Requests", link="https://github.com/relaton/relaton-itu/pulls"] image:https://img.shields.io/github/commits-since/relaton/relaton-itu/latest.svg["Commits since latest",link="https://github.com/relaton/relaton-itu/releases"] RelatonItu is a Ruby gem that implements the https://github.com/metanorma/metanorma-model-iso#iso-bibliographic-item[IsoBibliographicItem model]. == Installation Add this line to your application's Gemfile: [source,ruby] ---- gem 'relaton-bib' ---- And then execute: $ bundle Or install it yourself as: $ gem install relaton-bib == Usage === Search for a standard using keywords [source,ruby] ---- require 'relaton_itu' => true hit_collection = RelatonItu::ItuBibliography.search("ITU-T L.163") => item = hit_collection[1].fetch => # " 2022-12-05 ITU-T L.1470 ... " ---- With `bibdata: true` option XML output is wrapped with `bibdata` element and `ext` element added. [source,ruby] ---- item.to_xml bibdata: true => " 2022-12-05 ITU-T L.1470 ... recommendation ... " ---- === Get code, and year [source,ruby] ---- RelatonItu::ItuBibliography.get("ITU-T L.163", "2018", {}) [relaton-itu] ("ITU-T L.163") fetching... [relaton-itu] ("ITU-T L.163") found ITU-T L.163 => # # # # [#, @type="src">, #, @type="obp">] ---- === Create bibliographic item from YAML [source,ruby] ---- hash = YAML.load_file 'spec/examples/itu_bib_item.yml' => {"id"=>"ITU-T L.163 (11/2018)", ... RelatonItu::ItuBibliographicItem.from_hash hash => #