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

Table crash in 002 #34

Closed opoudjis closed 3 months ago

opoudjis commented 3 months ago
    from /Users/nickn/.rbenv/versions/3.3.3/lib/ruby/gems/3.3.0/gems/metanorma-jis-0.2.10/lib/isodoc/jis/presentation_xml_convert.rb:115:in `table_cols_count'
    from /Users/nickn/.rbenv/versions/3.3.3/lib/ruby/gems/3.3.0/gems/metanorma-jis-0.2.10/lib/isodoc/jis/presentation_xml_convert.rb:101:in `table1'
    from /Users/nickn/.rbenv/versions/3.3.3/lib/ruby/gems/3.3.0/bundler/gems/isodoc-f49d5133cfd0/lib/isodoc/presentation_function/block.rb:93:in `block in table'

Function from metanorma-jis, counting table cells to work out column alignment.

opoudjis commented 3 months ago
<table id="_e68ba8e4-92a1-1529-bb97-f49663956629">
<name>表 5-14 — 拡張製品仕様書でのオプション文字列の追加例</name>
</table>

... how did a table like this turn up in Metanorma XML?!

opoudjis commented 3 months ago
.拡張製品仕様書でのオプション文字列の追加例
|===

|===

Exactly why is a table like this being introduced into markup?!

This is an error in markup. I will validate for these and crash in standoc, they are indefensible as markup.

ronaldtse commented 3 months ago

It's more like this being a "hack" of the user.

The original looked like this:

Screenshot 2024-06-24 at 5 33 38 PM

It's actually a "table caption" ("表 5-12" means "Table 5-12"), but an image after:

.拡張製品仕様書でのオプション文字列の追加例
|===

|===

image::images/032.webp.png[]

Basically they were trying to use the "Table"-type caption with an image (the image is a sample table), so they made an empty table with a caption, and then added the image after.

Incredibly creative. But we don't support this.

Instead, this works:

.拡張製品仕様書でのオプション文字列の追加例
[cols="a"]
|===
|
image::images/032.webp.png[]
|===

Which is to put the image inside a single cell table.

ReesePlews commented 3 months ago

it looks incomplete to me. i will ask about this...

ReesePlews commented 3 months ago

@opoudjis a bit more clarification on this.

this is an example of how a table in another document (a data specification document) would look like... this document (where this example came from) is instructing the readers in the creation of their own "data specification documents" with these "types of tables" and this was to show an example. that is why it was an image of a table.

i am not sure if that changes our interpretation of this issue or not. we should not create an asciidoc table to replace the image, my earlier comment and understanding was incorrect. it is only a figure of an "example table". i think it can stay as a figure and any references are only to the figure (not the internal table title, which would not be any active reference)

opoudjis commented 3 months ago

Yeah, if it's an illustration, it needs to be marked up as an illustration; but empty tables really are going to be cause untold misery downstream. We have had that kind of shenanigans with tutorial documents before.

ReesePlews commented 3 months ago

i guess the issue is calling the figure a "table" it really should be "figure x" .... depicts a table should be clear in the text. i think that would solve the issue of an "empty table you mention"