From 1929287f7380c09a089a142e0b3a88ed1664cd0b Mon Sep 17 00:00:00 2001 From: Nick Nicholas Date: Fri, 21 Nov 2025 00:06:52 +1100 Subject: [PATCH] print out datetime in HTML collection cover page: https://github.com/metanorma/metanorma-pdfa/issues/9 --- Gemfile | 1 + docs/README.adoc | 2 +- lib/relaton/cli/xml_to_html_renderer.rb | 2 +- spec/relaton/cli/relaton_file_spec.rb | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index ccfd993..136c7e5 100644 --- a/Gemfile +++ b/Gemfile @@ -14,3 +14,4 @@ gem "rspec-html", "~> 0.3.0" gem "simplecov" gem "vcr" gem "webmock" +gem "debug" diff --git a/docs/README.adoc b/docs/README.adoc index eb485d3..344fe02 100644 --- a/docs/README.adoc +++ b/docs/README.adoc @@ -2,7 +2,7 @@ image:https://img.shields.io/gem/v/relaton-cli.svg["Gem Version", link="https://rubygems.org/gems/relaton-cli"] image:https://github.com/relaton/relaton-cli/workflows/rake/badge.svg["Build Status", link="https://github.com/relaton/relaton-cli/actions?workflow=rake"] -image:https://codeclimate.com/github/metanorma/relaton-cli/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/metanorma/relaton-cli"] +// image:https://codeclimate.com/github/metanorma/relaton-cli/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/metanorma/relaton-cli"] Documentation in development. diff --git a/lib/relaton/cli/xml_to_html_renderer.rb b/lib/relaton/cli/xml_to_html_renderer.rb index 6330c5e..4bf4445 100644 --- a/lib/relaton/cli/xml_to_html_renderer.rb +++ b/lib/relaton/cli/xml_to_html_renderer.rb @@ -55,7 +55,7 @@ def build_liquid_document(source) depth: 2, css: stylesheet, title: bibcollection.title, - date: Date.today.to_s, + date: DateTime.now.to_s, metanorma_v: mnv.lines.first&.strip, author: bibcollection.author, documents: document_items(bibcollection) diff --git a/spec/relaton/cli/relaton_file_spec.rb b/spec/relaton/cli/relaton_file_spec.rb index def916d..ad3c58d 100644 --- a/spec/relaton/cli/relaton_file_spec.rb +++ b/spec/relaton/cli/relaton_file_spec.rb @@ -84,6 +84,7 @@ expect(hashdoc["root"]["author"]).to be_nil items = hashdoc["root"]["items"] + #warn items expect(items[0]["docid"][0]["id"]).to eq("CC 18001") expect(items[1]["docid"][0]["id"]).to eq("CC 36000") expect(items[2]["xml"]).not_to eq("spec/fixtures/sample-collection")