Skip to content
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

Moving presentation content for block from renderers to Presentation XML #10

Open
opoudjis opened this issue Oct 30, 2024 · 12 comments
Open
Labels
enhancement New feature or request

Comments

@opoudjis
Copy link

In metanorma/isodoc#606 I am undertaking refactoring overdue by several years, moving content that is being inserted independently by the HTML, DOC, PDF renderers back to the Presentation XML. Where this impacts Firelight to date (which is most of them), I am also going to ask you to change the behaviour of Firelight, so that you are not independently adding that content there either.

This ticket is going to be long; I will advise when it is done.

@opoudjis opoudjis added the enhancement New feature or request label Oct 30, 2024
@opoudjis
Copy link
Author

Formulas until now expect HTML and PDF independently to insert the parentheses around their label:

<formula id="A">
<name>4</name>
<stem>
<math/>
</stem>
</formula>

I am going to be doing that inserting of parentheses in Presentation XML now: it is a Presentation XML concern. However, I am going to leave <name> alone, and I will not be dealing with the tab and the name following the stem expression:

<formula id="A">
<name>(4)</name>
<stem>
<math/>
</stem>
</formula>

@strogonoff strogonoff removed their assignment Oct 30, 2024
@strogonoff
Copy link
Contributor

Thanks for the heads-up. Issue will be assigned when someone works on it.

@opoudjis
Copy link
Author

The term domain is injected at the start of the term definition, as "<#{domain}>". This is being done in HTML, as legacy that I never got around to undoing: it is of course necessarily a Presentation XML concern.

There will be no need for HTML and PDF to inject the domain into the term definition and wrap it in angle brackets: that will be done in Presentation XML.

So:

Semantic XML:

<term><preferred>natural</preferred>
<domain>mathematics</domain>
<definition><p>sequence of integers</p></definition>
</term>

currently HTML and PDF inject "<mathematics>" at the start of the first definition paragraph. That will now be done in Presentation XML:

<term><preferred>natural</preferred>
<definition><p>&lt;<domain>mathematics</term>&gt; sequence of integers</p></definition>
</term>

And I'm leaving the "domain" tag in, anticipating metanorma/isodoc#610: Presentation XML will preserve Semantic XML markup. PDF and HTML will just ignore the tag and render its contents.

@opoudjis
Copy link
Author

Complication: in IEC, IEV documents suppress display of domain. We will set @hidden=true on domain in that context.

@opoudjis
Copy link
Author

As it turns out (perplexingly), this was already done in ISO, and in fact the ISO change was preventing the IEC suppression of domains from happening.

@opoudjis opoudjis changed the title Moving content from renderers to Presentation XML Moving presentation content for block from renderers to Presentation XML Oct 31, 2024
@opoudjis
Copy link
Author

opoudjis commented Nov 3, 2024

IEEE and ITU defined in HTML code the delimiter between the note label (NOTE, NOTE 1) and the note contents. That's an antipattern: this was supposed to be resolved in Presentation XML. The experiment around how to do so with OGC led to the unfortunate issue of metanorma/isodoc#609, and will instead lead to explicit markup of delimiters in Presentation XML in metanorma/isodoc#611

So in all of IEEE, ITU, OGC, we have currently:

Semantic XML:

<note id="note1">
        <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">First note.</p>
      </note>

Presentation XML:

<note id='note1'>
              <name>NOTE 1</name>
              <p id='_'>First note.</p>
            </note>

HTML:

 <div id='note1' class='Note'>
              <p><span class='note_label'>NOTE 1&#x2014;</span>First note.</p>
            </div>

Instead, we will have the Presentation XML be:

<note id='note1'>
              <name>NOTE 1&#x2014;</name>
              <p id='_'>First note.</p>
            </note>

Ultimately but not yet, that will be:

<note id='note1'>
              <name>NOTE <autonum>1</autonum><autonum-delim>&#x2014;</autonum-delim></name>
              <p id='_'>First note.</p>
            </note>

In the case of ITU, it is &#xa0;&#x2013;&#xa0;, but only if the note starts with a paragraph.

So PDF and HTML should not injecting the em-dash in those formats.

Moving the label inside the paragraph for notes is NOT currently being done in Presentation XML. I may do so in the future, but this iteration is for preventing content being added in HTML and PDF, not necessarily for rearranging content.

@opoudjis
Copy link
Author

opoudjis commented Nov 3, 2024

HTML used to add missing titles instead of letting Presentation XML do so. There are two instances where it still does: Symbols and Forewords.

These will be populated if missing in Presentation XML: there is no need for PDF or HTML to supply missing title text here.

@opoudjis
Copy link
Author

opoudjis commented Nov 3, 2024

As with notes, the insertion of the delimiter for term notes needs to be moved to Presentation XML. So you will now be receiving:

               <termnote id="_" keep-with-next="true" keep-lines-together="true">
                <name>Note 1 to entry:</name>
                 <p id="_">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p>
               </termnote>

And you do not need to insert the : yourself.

@ronaldtse
Copy link
Contributor

@opoudjis I find it a bit strange that "name" is mixed with "p" and assumed to flow as spans. The element name "name" probably works better with something like "content" or "description".

@ronaldtse
Copy link
Contributor

Also, by moving the colon inside "name", it is now conflating the "name of the note" with a delimiter. Cross references or an index that link to this note will not use the delimiter.

@opoudjis
Copy link
Author

opoudjis commented Nov 4, 2024

As I have repeated said to you, @ronaldtse, comments about what Presentation XML will look like later belong to the tickets discussing them, metanorma/isodoc#610 and metanorma/isodoc#611, and those tickets are not being worked on right now . They are disruptive and unwelcome in other tickets, and they are premature: I am busy enough trying to keep track of what I am refactoring now.

I am deleting them henceforth from tickets they do not apply to and moving them to the correct ticket.

@opoudjis
Copy link
Author

opoudjis commented Nov 8, 2024

If Firelight is inserting ")" after table footnote references, it needs to stop doing so, those are now being inserted in Presentation XML.

Refactoring of Presentation XML will continue over the next two months, and will be disruptive. Strongly advise you remain aware of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants