-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Presentation XML caption refactoring #770
Comments
Note that work is being done in PR branch feature/presxml-autonum. This is the Gemfile.devel for metanorma-iso:
|
I will now be inserting any tabs between the note label and note content in presentation XML, so you won't need to: Before, ISO:
After, ISO:
Before, IEEE:
After, ISO:
|
I think the best way is to do these actions in the the templates
|
I have to comment
will be rendered so: and will review the solution for issue metanorma/metanorma-iso#852. |
Yes, that is what I was afraid of. That's why I noted that there's going to be much more mixed content now than before. |
author Alexander Dyuzhev <[email protected]> 1732308339 +0300 committer Alexander Dyuzhev <[email protected]> 1732378925 +0300 common.xsl updated for new title and name format, #770
ISO XSLT updated in #773. @opoudjis I've generated the Presentation XML for https://github.com/metanorma/mn-samples-ieee/tree/main/sources/p987.6, and found a bug -
Therefore it renders as long/double dash (first from My
|
Thank you for finding that @Intelligent2013! But I am still not done with testing and therefore debugging metanorma-ieee; in fact, I am repeatedly going back and doing refactoring on isodoc as I find issues and redundancies downstream. With luck I may get through the rest of metanorma-ieee tonight. |
metanorma-ieee done |
metanorma-itu done |
In metanorma/metanorma-standoc#312, I had added an xref attribute to annex/title at your request @Intelligent2013 , as a processing hint for PDF:
This information is now available as /annex/fmt-xref-label (and I will do some refactoring to also make it retrievable from /annex/fmt-name/ ). I request that I get rid of the xref attribute. |
metanorma-nist done |
IEEE XSLT updated in #773. |
ITU XSLT updated in #773. |
@opoudjis issue found - in the Index there are both references to the <clause id="_appendix_3_the_base_unitsbase_units_of_the_si" obligation="normative" unnumbered="true">
<title id="_18cc76a6-96da-4886-9d62-248e129a14fb">Appendix 3. The base units<bookmark id="_a17d01cc-8089-4eb9-88be-33ff27fad132"/> of the SI</title>
<fmt-title depth="5">
<semx element="title" source="_18cc76a6-96da-4886-9d62-248e129a14fb">Appendix 3. The base units<bookmark id="_a3cbeb24-fde5-40cc-bd17-ea2081c8bcd4"/> of the SI</semx>
</fmt-title> <indexsect id="_17dde3a6-ae02-4a2c-b121-c963cdd0f029" displayorder="15">
...
<li>base unit(s), ...
<xref target="_a17d01cc-8089-4eb9-88be-33ff27fad132" pagenumber="true">"<semx element="title" source="_appendix_3_the_base_unitsbase_units_of_the_si">Appendix 3. The base unitsbase unit(s) of the SI</semx>"</xref>,
<xref target="_a3cbeb24-fde5-40cc-bd17-ea2081c8bcd4" pagenumber="true">"<semx element="title" source="_appendix_3_the_base_unitsbase_units_of_the_si">Appendix 3. The base unitsbase unit(s) of the SI</semx>"</xref>,
...
</li> As the element And in PDF log there are messages:
|
That's an issue I knew was coming, but I hoped had not spread yet—that IDs are being replicated between title and fmt-title. I am dodging it in floating-title, by reassigning |
In addition, I can't leave |
Fixed, try it out now. The |
Plateau XSLT updated in #773. Now, I'll test the BIPM. |
@opoudjis still there are references between <clause id="cgpm12th1964r7" unnumbered="true" obligation="normative">
<title type="quoted"><blacksquare/><strong>Curie</strong> (<link target="https://www.bipm.org/en/committees/cg/cgpm/12-1964/resolution-7">CGPM RES 7 (1964, E)</link>)<bookmark id="_1d07cd96-a110-4d66-9d02-cb7fc1eede83"/></title><fmt-title type="quoted" depth="3"><blacksquare/><strong>Curie</strong> (<link target="https://www.bipm.org/en/committees/cg/cgpm/12-1964/resolution-7">CGPM RES 7 (1964, E)</link>)<bookmark id="_f6184b8a-e919-4531-be6f-28712e0ee20f"/></fmt-title> <indexsect
<xref target="_1d07cd96-a110-4d66-9d02-cb7fc1eede83" pagenumber="true">"<semx element="title" source="cgpm12th1964r7">[cgpm12th1964r7]</semx>"</xref> |
Hm, ok. This is all BIPM Brochure, I just was reluctant to compile the whole thing, but clearly I'll need to... |
I was catching all title/fmt-title duplications, but the one specific to BIPM with quoted titles. I am now testing the Brochure outputs to ensure no further unresolved ids (those are xrefs pointing to title or name, which are now excluded from rendering, instead of their duplicates in fmt-title and fmt-name.) |
So compiling the English-language BIPM brochure, there are 1327 index entries. Of these, 88 are under title, and thus will go missing on rendering, since rendering uses fmt-title instead (which duplicates those titles); that is what you also found, and they should be the quoted titles I had missed last time—so we've clearly been looking at the same document. Recompiling with the bug fix, the ancestors of index links are now
There were a couple of surprises in there (there are index entries pointing to footnotes and to cross-reference text), but i think this means we are now good to go. |
BIPM and JCGM XSLT updated in #773. @opoudjis I've just found the double Old Presentation XML: <termnote id="_49888e25-31af-6205-b3e3-269d2cc55cfb"><name>Note 1 to entry:: </name> New Presentation XML: <fmt-name><span class="fmt-caption-label">Note <semx element="autonum" source="_49888e25-31af-6205-b3e3-269d2cc55cfb">1</semx> to entry:</span><span class="fmt-label-delim">: </span></fmt-name> |
So, at this moment all XSLT updated for new Presentation XML in:
Found issues in:
|
BSI fixed. References in BIPM from index to title/bookmark should all have been fixed yesterday, I found no remaining instances. Removed redundant colon in BIPM termnotes. |
Please confirm all is ready, intend to release Monday. |
Confirmed. Thank you! |
Confirmed. I'll merge the XSLT PRs today. |
common.xsl updated for new title and name format, #770
XSLTs merged into the |
This comes out of metanorma/isodoc#617
The refactoring of captions in Presentation XML is extremely slow for me: it has taken me three weeks of effort just to get through metanorma-iso, and I will likely be refactoring isodoc as I go with other flavours. The intention is to do a release in two weeks time, and I already do not think I will make that for all of Metanorma.
For that reason, it is very important to keep all work in a separate branch until all flavours of Metanorma are done. Even more critical, this refactor is now breaking STS (metanorma/mnconvert#418), so we may need to delay release until STS is addressed as well. And IEEE XML.
I will be updating you with each flavour as I finish it. Right now, ISO is the only flavour switched across.
This is the largest task because it impacts the most elements, but I am hoping it is much less work for you to do: it is adding semantic markup which you should be able to ignore, and moving captions and titles to a Presentation XML-specific element, which you will be using instead of /title and /name.
The updates are:
fmt-name
.name
if present is the Semantic XML element, consisting of just the user-supplied caption, and it is to be ignored.fmt-name
will contain the autonumber and the block type.fmt-title
.title
if present is the Semantic XML element, consisting of just the user-supplied title, and it is to be ignored.fmt-title
will contain the autonumber and the block type.fmt-*
tags will be a design pattern in the new Presentation XML, of Presentation XML elements being marked up alongside the source Semantic XML elements, rather than overwriting them. In the refactoring, I will be introducing a lot more of these. Either thefmt-*
elements or their childfmt-*
elements hyperlink to the Semantic XML tags they are derived from through theirsource
attribute.fmt-title
andfmt-name
will be accompanied by afmt-xref-label
element, indicating what label to use for cross-references to this block or clause. You are to ignore this element.span
elements introduced inline, semantically annotating various kinds of delimiter in captions and cross-references to captions. Theirclass
attribute will befmt-*
. Just render their contents.semx
element, which hyperlinks the autonumbering information to the element it is numbering. As withspan
, you need only render its contents.element
attribute gives the name of the Semantic XML element that thesemx
element derives its value from. Thesource
element gives the GUID of the Semantic XML element that thesemx
element derives its value from.autonum
attribute giving the autonumber value.semx
values, one for each block being referenced in the hierarchy. So figure 1-3 will be marked up as<semx source={GUID for Figure 1}>1</semx> - <semx source={GUID for Subfigure 3}>3</semx>
.Example, Presentation XML before:
Example, Presentation XML after (GUIDs stripped for test use):
As noted: ignore
title
andname
and usefmt-title
andfmt-name
instead. Ignorefmt-xref-label
. Render the contents of anysemx
andspan
elements.This mass introduction of
semx
andspan
into markup means that we will have a lot more mixed content in our XML than we used to: all titles, block captions, and xrefs will contain tags. Given what has been happening with docidentifier containing tags in PDF, that means you will need to ensure that rendering copes with all that.The text was updated successfully, but these errors were encountered: