Skip to content

Commit

Permalink
remove remove-supplementary-materials.xsl (#159)
Browse files Browse the repository at this point in the history
  • Loading branch information
fred-atherden authored Jan 17, 2025
1 parent e9e1190 commit 013839e
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 846 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ Encoda is currently unable to handle to handke files with mutliple reference lis

Changes are required to encoda so as to decode and encode appendices, and then possible changes are required in EPP depending on how this is representated in the JSON.

### [/src/remove-supplementary-materials.xsl](/src/remove-supplementary-materials.xsl)

This stylesheet is transforming an XML document by removing any "sec" element with a "sec-type" attribute value of "supplementary-material". These supplementary material sections are only partially retained by encoda - the files themselves need representation as downloadable files in the JSON. As it stands the labels and filepaths are decoded and re-encoded as paragraphs. The work to fix this is captured in https://github.com/elifesciences/enhanced-preprints-issues/issues/116. The current rendering on EPP as a result is less than ideal, where labels and filepaths are rendered in a series of paragraphs. The purpose of this xsl is to remove these sections until encoda and EPP can be updated to render downloadable supplementary files on the page.

### [/src/handle-content-alternatives.xsl](/src/handle-content-alternatives.xsl)

Currently EPP client has no support for HTML tables, and no support for either mathML or latex representations of maths. Encoda will always use the machine readable version of content when available, i.e. the representation that is not an image. Therefore, when XML which has both machine readable and image representations of the same content, the image representation is stripped making the content unavailable in EPP. This xsl removes the machine readable representation of content when an image representation is available (both will be captured in an `<alternatives>` tag), so that the image version is at least rendered by EPP.
Expand Down
20 changes: 0 additions & 20 deletions src/remove-supplementary-materials.xsl

This file was deleted.

29 changes: 29 additions & 0 deletions test/all/kitchen-sink.xml
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,35 @@ return :shrug:
<p><bold>Table S3.</bold> List of peptides represented on the chord plot. Related to 4I.</p>
<p>This is a display quote that should be retained.</p>
</sec>
<sec sec-type="supplementary-material">
<title>Supporting information</title>
<supplementary-material>
<label>Supp file 1</label>
<caption><title><bold>Supp file 1</bold></title></caption>
<media xlink:href="supplements/468444_file02.pdf"/>
</supplementary-material>
<supplementary-material>
<label>Supp file 2</label>
<caption><title><bold>Supp file 2. </bold></title><p>This is a para.</p></caption>
<media xlink:href="supplements/468444_file03.pdf"/>
</supplementary-material>
<supplementary-material>
<label>Supp file 3</label>
<caption><title><bold>Supp file 3. </bold>This is a title</title>
<p>This is a para.</p>
</caption>
<media xlink:href="supplements/468444_file03.pdf"/>
</supplementary-material>
<supplementary-material>
<label>Supp file 4.</label>
<caption><title><bold>Supp file 4. </bold>This is a title</title>
</caption>
<media xlink:href="supplements/468444_file03.pdf"/>
</supplementary-material>
<supplementary-material>
<media xlink:href="supplements/468444_file03.pdf"/>
</supplementary-material>
</sec>
</body>
<back>
<ref-list>
Expand Down
Loading

0 comments on commit 013839e

Please sign in to comment.