= Relaton for IHO documents image:https://img.shields.io/gem/v/relaton-iho.svg["Gem Version", link="https://rubygems.org/gems/relaton-iho"] image:https://github.com/relaton/relaton-iho/workflows/macos/badge.svg["Build Status (macOS)", link="https://github.com/relaton/relaton-iho/actions?workflow=macos"] image:https://github.com/relaton/relaton-iho/workflows/windows/badge.svg["Build Status (Windows)", link="https://github.com/relaton/relaton-iho/actions?workflow=windows"] image:https://github.com/relaton/relaton-iho/workflows/ubuntu/badge.svg["Build Status (Ubuntu)", link="https://github.com/relaton/relaton-iho/actions?workflow=ubuntu"] image:https://codeclimate.com/github/relaton/relaton-iho/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/relaton/relaton-iho"] image:https://img.shields.io/github/issues-pr-raw/relaton/relaton-iho.svg["Pull Requests", link="https://github.com/relaton/relaton-iho/pulls"] image:https://img.shields.io/github/commits-since/relaton/relaton-iho/latest.svg["Commits since latest",link="https://github.com/relaton/relaton-iho/releases"] RelatonIho is a Ruby gem that implements the https://github.com/metanorma/metanorma-model-iso#iso-bibliographic-item[IsoBibliographicItem model]. It currently retrieves metadata of IHO Standards from https://github.com/relaton/relaton-data-iho. == Installation Add this line to your application's Gemfile: [source,ruby] ---- gem 'relaton-iho' ---- And then execute: [source,sh] ---- $ bundle ---- Or install it yourself as: [source,sh] ---- $ gem install relaton-iho ---- == Usage === Search for a standard using keywords [source,ruby] ---- pry(main)> require 'relaton_iho' => true item = RelatonIho::IhoBibliography.search("B-11") [relaton-iho] ("B-11") fetching... [relaton-iho] ("B-11") found B-11 => # " 2020-03-29 IHO-IOC GEBCO Cook Book Livre de recettes GEBCO OHI-COI https://www.star.nesdis.noaa.gov/socd/lsa/GEBCO_Cookbook/documents/CookBook_20191031.pdf B-11 ... " ---- With argument `bibdata: true` it ouputs XML wrapped by `bibdata` element and adds flavour `ext` element. [source,ruby] ---- item.to_xml bibdata: true => " 2020-03-29 IHO-IOC GEBCO Cook Book Livre de recettes GEBCO OHI-COI https://www.star.nesdis.noaa.gov/socd/lsa/GEBCO_Cookbook/documents/CookBook_20191031.pdf B-11 ... Hydrographic Services and Standards Committee HSSC Inter-Regional Coordination Committee IRCC JOINT IHO-IOC GUIDING COMMITTEE FOR THE GENERAL BATHYMETRIC CHART OF THE OCEANS GEBCO " ---- === Get code [source,ruby] ---- RelatonIho::IhoBibliography.get "IHO B-11" [relaton-iho] ("IHO B-11") fetching... [relaton-iho] ("IHO B-11") found B-11 => # [#, @type="pdf">] ---- === Create bibliographic item from XML [source,ruby] ---- RelatonIho::XMLParser.from_xml File.read('spec/fixtures/iho.xml') => # {"id"=>"B-11", ... RelatonIho::IhoBibliographicItem.from_hash hash => #