metanorma / mn-samples-plateau

Project PLATEAU by MLIT: Japanese Ministry of Land, Infrastructure, Transport and Tourism (国土交通省)
https://www.mlit.go.jp/plateau/
1 stars 0 forks source link

Add index terms #156

Closed anermina closed 1 month ago

anermina commented 1 month ago

Closes https://github.com/metanorma/mn-samples-plateau/issues/91.

ronaldtse commented 1 month ago

@anermina can you please help rebase and fix the conflicts? Thanks.

ronaldtse commented 1 month ago

@opoudjis The addition of index terms leads to a crash in isodoc:

Style: (ID tocW_02): More than 1 ordered list in a numbered clause
gems/metanorma-iso-2.8.4/lib/isodoc/iso/index.rb:107:in `see_lbl'
gems/metanorma-iso-2.8.4/lib/isodoc/iso/index.rb:46:in `index_entries_opt'
gems/metanorma-iso-2.8.4/lib/isodoc/iso/index.rb:52:in `index_entries'
gems/metanorma-iso-2.8.4/lib/isodoc/iso/index.rb:28:in `block (2 levels) in index1'
gems/metanorma-iso-2.8.4/lib/isodoc/iso/index.rb:27:in `each'
gems/metanorma-iso-2.8.4/lib/isodoc/iso/index.rb:27:in `block in index1'
gems/metanorma-iso-2.8.4/lib/isodoc/iso/index.rb:23:in `each'
gems/metanorma-iso-2.8.4/lib/isodoc/iso/index.rb:23:in `index1'
gems/metanorma-iso-2.8.4/lib/isodoc/iso/index.rb:16:in `index'
bundler/gems/isodoc-2e24301f533c/lib/isodoc/presentation_xml_convert.rb:63:in `section'
bundler/gems/isodoc-2e24301f533c/lib/isodoc/presentation_xml_convert.rb:45:in `conversions'
bundler/gems/isodoc-2e24301f533c/lib/isodoc/presentation_xml_convert.rb:28:in `convert1'
ronaldtse commented 1 month ago

The error finally that appeared was:

undefined method `see' for an instance of IsoDoc::Plateau::I18n
opoudjis commented 1 month ago

The error finally that appeared was:

undefined method `see' for an instance of IsoDoc::Plateau::I18n

Yes, I fixed this in https://github.com/metanorma/metanorma-iso/commit/f8e687d83ae5116140e56176da9465234dd9212c

ronaldtse commented 1 month ago

@anermina is this still "work in progress" or is this done? We need to merge this ASAP.

ronaldtse commented 1 month ago

@opoudjis

The error finally that appeared was:

undefined method `see' for an instance of IsoDoc::Plateau::I18n

Yes, I fixed this in metanorma/metanorma-iso@f8e687d

There is another crash with indexes in isodoc, this is not fixed:

Style: (ID tocW_02): More than 1 ordered list in a numbered clause
gems/3.3.0/gems/metanorma-iso-2.8.4/lib/isodoc/iso/index.rb:107:in `see_lbl'
gems/3.3.0/gems/metanorma-iso-2.8.4/lib/isodoc/iso/index.rb:46:in `index_entries_opt'
gems/3.3.0/gems/metanorma-iso-2.8.4/lib/isodoc/iso/index.rb:52:in `index_entries'
gems/3.3.0/gems/metanorma-iso-2.8.4/lib/isodoc/iso/index.rb:28:in `block (2 levels) in index1'
gems/3.3.0/gems/metanorma-iso-2.8.4/lib/isodoc/iso/index.rb:27:in `each'
gems/3.3.0/gems/metanorma-iso-2.8.4/lib/isodoc/iso/index.rb:27:in `block in index1'

Actually, the final message is the same:

undefined method `see' for an instance of IsoDoc::Plateau::I18n
ronaldtse commented 1 month ago

@opoudjis I have updated isodoc and metanorma-plateau, but still failing. Have you tried this PR?

ronaldtse commented 1 month ago

@opoudjis it now works after also updating metanorma-iso in the Gemfile.

anermina commented 1 month ago

This is no longer in progress.

It isn't quite clear from the HTML (the only file where the Index section is visible) where the index terms should be used and where they should not be, because HTML uses page numbers and does not include hyperlinks. I was able to determine that terms should not be listed in the Index section if they are used in the appendices. However, the term "建築物の高さ" appears only in Appendix C, and I made an exception for this case by encoding it as an index term, even though it is used in an appendix.

In today's commits, the encoding was changed to avoid referencing notes, lists, tables, and similar elements.

ronaldtse commented 1 month ago

@anermina

  1. Index terms should not differentiate appendix vs main content, if a term is in the appendix it should still be shown.
  2. Could you please file the bugs for the index not showing up in PDF? (Ping @Intelligent2013 )
  3. Could you file the bug that an index term in HTML is not linked back to the term usage?

Once 1 is done please help merge this. Thanks!

ronaldtse commented 1 month ago

Merging!

anermina commented 1 month ago

@ronaldtse My previous comment wasn’t clear enough - it was about the reference documents. The original HTML file is the only one that contains the index terms for this document, and it uses non-hyperlinked page numbers. I was checking this file to determine where to use the index terms.

Our HTML and PDF seem fine.