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

Refactor footnotes to have autonumber markup #623

Open
opoudjis opened this issue Nov 30, 2024 · 0 comments
Open

Refactor footnotes to have autonumber markup #623

opoudjis opened this issue Nov 30, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@opoudjis
Copy link
Contributor

Child of #610:

We will replace the body of fn with fmt-fn-body, which will contain the footnote body with autonumbering of footnotes, instead of expecting HTML and PDF to insert that autonumbering in the footnote body. This is to deal with the fact that JIS inserts the word "footnote" before footnote text.

So currently inside a table:

 <td align="center">
    Balilla
    <fn reference="a)">
      <p id="_">Parboiled rice.</p>
    </fn>
</td>

Renders in JIS as:

<td scope="col">
                   Balilla
                   <a href="#tableD-1a)" class="TableFootnoteRef">a)</a>
                 </td>

in the table, and

<div class="TableFootnote">
                     <div id="fn:tableD-1a)">
                       <p id="_" class="TableFootnote">
                         <span>
                           Footnote
                           <span id="tableD-1a)" class="TableFootnoteRef">a)</span>
                            <tab/>
                         </span>
                         Parboiled rice.
                       </p>
                     </div>
                   </div>

It is not HTML and PDF's job to insert the word "Footnote" before the "a)" and a tab after it in the footnote body, it is Presentation XML's. So the Presentation XML will change to:

 <td align="center">
    Balilla
    <fn reference="a)" id="{ADDED ID}">
      <p id="_">Parboiled rice.</p> 
      <!-- ignore all content of fn but fmt-fn-body -->
      <fmt-fn-body>
        <p id="{new GUID}">
          <span class="fmt-caption-label">
           <!-- most flavours do not add "Footnote" -->
            <span class="fmt-element-name">Footnote</span>
             <semx element="autonum" source="{ADDED ID}">a</semx>
            <span class="fmt-autonum-delim">)</span>
          </span>
          <span class-"fmt-caption-delim"><tab/></span>
          Parboiled rice.
        </p>
      </fmt-fn-body>
    </fn>
</td>

Added bonus: the ADDED ID GUID allows more straightforward implementation of backlinks from footnote text.

@opoudjis opoudjis added the enhancement New feature or request label Nov 30, 2024
@opoudjis opoudjis self-assigned this Nov 30, 2024
@github-project-automation github-project-automation bot moved this to 🆕 New in Metanorma Nov 30, 2024
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
Status: 🆕 New
Development

No branches or pull requests

1 participant