metanorma / mn-samples-ogc

Metanorma for OGC sample documents
1 stars 2 forks source link

Use AsciiBib for example #67

Closed ronaldtse closed 3 years ago

ronaldtse commented 4 years ago

In a document examples with a number of non-auto-fetched references, we should convert some of them into AsciiBib format as examples.

That said, I think we should have some examples that use the AsciiBib format for rendering (see https://www.metanorma.com/author/ietf/topics/references/ , I wonder why this section is only in MN-IETF...).

Originally posted by @ronaldtse in https://github.com/metanorma/mn-samples-ogc/issues/61#issuecomment-597403752

ronaldtse commented 4 years ago

Spec fo AsciiBib: https://www.relaton.com/specs/asciibib-path/

@manuel489 do you have time to convert one document's references into AsciiBib?

We got a report that AsciiBib isn't working. Thanks!

manuelfuenmayor commented 4 years ago

Ok, @ronaldtse

manuelfuenmayor commented 4 years ago

Ping @ronaldtse Ok, I did a test using the following sample:

* [[[ogc14-005r5, OGC 14-005r5]]], http://docs.opengeospatial.org/is/14-005r5/14-005r5.html[OGC: OGC 14-005r5, OGC Indoor Geography Markup Language (IndoorGML) - with Corrigendum 1.0.3 (2018)]

In AsciiBib:

[[OGC-14-005r5]]
[%bibitem]
=== OGC Indoor Geography Markup Language (IndoorGML)
id:: 14-005r5
docid::
  type::: OGC
  id::: OGC 14-005r5
link:: http://docs.opengeospatial.org/is/14-005r5/14-005r5.html
date::
  type::: published
  value::: 2018

And, it didn't compile at first. Apparently, there is an error related with the link (link:: http://docs.opengeospatial.org/is/14-005r5/14-005r5.html)

Error log:

$ bundle exec metanorma -t ogc -x html sources/19-004/document.adoc
NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01.
Gem::Specification#rubyforge_project= called from C:/tools/ruby25/lib/ruby/gems/2.5.0/specifications/sterile-1.0.14.gemspec:15.
asciidoctor: ERROR: sources/19-004/sections/03-references.adoc: line 34: bibliography sections do not support nested sections
C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/relaton-bib-0.8.1/lib/relaton_bib/bibliographic_item.rb:507:in `block (2 levels) in render_xml': undefined method `to_xml' for "http://docs.opengeospatial.org/is/14-005r5/14-005r5.html":String (NoMethodError)
Did you mean?  to_yaml
        from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/relaton-bib-0.8.1/lib/relaton_bib/bibliographic_item.rb:507:in `each'
        from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/relaton-bib-0.8.1/lib/relaton_bib/bibliographic_item.rb:507:in `block in render_xml'
        from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.9-x64-mingw32/lib/nokogiri/xml/builder.rb:394:in `insert'
        from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.9-x64-mingw32/lib/nokogiri/xml/builder.rb:377:in `method_missing'
        from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/relaton-bib-0.8.1/lib/relaton_bib/bibliographic_item.rb:503:in `render_xml'
        from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/relaton-bib-0.8.1/lib/relaton_bib/bibliographic_item.rb:277:in `block in to_xml'
        from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.9-x64-mingw32/lib/nokogiri/xml/builder.rb:295:in `initialize'
        from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/relaton-bib-0.8.1/lib/relaton_bib/bibliographic_item.rb:276:in `new'
        from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/relaton-bib-0.8.1/lib/relaton_bib/bibliographic_item.rb:276:in `to_xml'
        from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/metanorma-standoc-1.3.21/lib/asciidoctor/standoc/cleanup_ref.rb:121:in `block in ref_dl_cleanup'
        from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.9-x64-mingw32/lib/nokogiri/xml/node_set.rb:238:in `block in each'
        from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.9-x64-mingw32/lib/nokogiri/xml/node_set.rb:237:in `upto'
        from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.9-x64-mingw32/lib/nokogiri/xml/node_set.rb:237:in `each'
        from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/metanorma-standoc-1.3.21/lib/asciidoctor/standoc/cleanup_ref.rb:118:in `ref_dl_cleanup'
        from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/metanorma-standoc-1.3.21/lib/asciidoctor/standoc/cleanup.rb:42:in `cleanup'
        from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/metanorma-ogc-1.0.3/lib/asciidoctor/ogc/converter.rb:124:in `cleanup'
        from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/metanorma-standoc-1.3.21/lib/asciidoctor/standoc/base.rb:178:in `makexml'
        from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/metanorma-ogc-1.0.3/lib/asciidoctor/ogc/converter.rb:24:in `makexml'
        from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/metanorma-ogc-1.0.3/lib/asciidoctor/ogc/converter.rb:55:in `document'
        from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/metanorma-standoc-1.3.21/lib/asciidoctor/standoc/utils.rb:116:in `convert'
        from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/asciidoctor-2.0.10/lib/asciidoctor/document.rb:951:in `convert'
        from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/asciidoctor-2.0.10/lib/asciidoctor/convert.rb:120:in `convert'
        from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/metanorma-1.0.0/lib/metanorma/input/asciidoc.rb:10:in `process'
        from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/metanorma-ogc-1.0.3/lib/metanorma/ogc/processor.rb:26:in `input_to_isodoc'
        from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/metanorma-1.0.0/lib/metanorma/compile.rb:112:in `process_input'
        from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/metanorma-1.0.0/lib/metanorma/compile.rb:17:in `compile'
        from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/metanorma-cli-1.2.10.2/lib/metanorma/cli/compiler.rb:41:in `compile_file'
        from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/metanorma-cli-1.2.10.2/lib/metanorma/cli/compiler.rb:29:in `compile'
        from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/metanorma-cli-1.2.10.2/lib/metanorma/cli/compiler.rb:33:in `compile'
        from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/metanorma-cli-1.2.10.2/lib/metanorma/cli/command.rb:35:in `compile'
        from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
        from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
        from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
        from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
        from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/metanorma-cli-1.2.10.2/lib/metanorma/cli.rb:60:in `start'
        from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/metanorma-cli-1.2.10.2/exe/metanorma:20:in `<top (required)>'
        from C:/tools/ruby25/bin/metanorma:23:in `load'
        from C:/tools/ruby25/bin/metanorma:23:in `<main>'

So, after removing that line, I was able to compile and got this output: HTML output: ref-output-cap

ronaldtse commented 4 years ago

This is clearly a bug in relaton-bib. Can you please file it in https://github.com/relaton/relaton-bib for @andrew2net ? Thanks.

ronaldtse commented 4 years ago

@manuel489 , before you convert other references, I don't think we need to convert the auto-fetched references -- only the non-auto-fetched references will benefit from this syntax.

However, having 1 or 2 auto-fetched documents in this syntax would still be good. It was great to discover the bug as you have!

manuelfuenmayor commented 4 years ago

Ok @ronaldtse , understood.

manuelfuenmayor commented 4 years ago

@ronaldtse , I have opened the ticket (https://github.com/relaton/relaton-bib/issues/22). But I think I don't have enough privileges to set assignees or labels. Thanks!

ronaldtse commented 4 years ago

@manuel489 can you try this file again after running bundle update? @andrew2net has fixed this issue. Thanks!

andrew2net commented 4 years ago

@ronaldtse we have to wait until Nick will release new metanorma. Hi is going to it on Friday.

ronaldtse commented 4 years ago

Got it, we will need to remember regenerating this document after the release.

manuelfuenmayor commented 4 years ago

@manuel489 can you try this file again after running bundle update? @andrew2net has fixed this issue. Thanks!

The bug is fixed now. I'm working on the AsciiBib examples...

manuelfuenmayor commented 4 years ago

This issue is on hold until https://github.com/metanorma/metanorma-ogc/issues/147 gets solved.

manuelfuenmayor commented 4 years ago

PR added in https://github.com/metanorma/mn-samples-ogc/pull/107

ronaldtse commented 4 years ago

@manuel489 Thanks! Some feedback in the PR.

manuelfuenmayor commented 3 years ago

Task is merged. Closing.