= 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 Reference can be specified with or without an edition. References without an edition will return the latest edition of the standard. References with an edition will return the standard with the specified edition. [source,ruby] ---- require 'relaton_iho' => true # Search for a standard using a reference without an edition item = RelatonIho::IhoBibliography.search("IHO B-11") [relaton-iho] (IHO B-11) Fetching from Relaton repository ... [relaton-iho] (IHO B-11) Found: `B-11` => # # " 2022-12-04 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 outputs XML wrapped by `bibdata` element and adds flavor `ext` element. [source,ruby] ---- item.to_xml bibdata: true => " 2022-12-04 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 ... " ---- === Get code [source,ruby] ---- RelatonIho::IhoBibliography.get "IHO B-11" [relaton-iho] (IHO B-11) Fetching from Relaton repository ... [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 => #