elifesciences / lens

A novel way of viewing eLife articles.
http://lens.elifesciences.org
Other
375 stars 75 forks source link

Displaying footnotes #226

Open Kyrklund83 opened 2 years ago

Kyrklund83 commented 2 years ago

Hi!

I'm very new to XML and have only just started to use this wonderful solution for displaying them on the web. I'm using the integrated OJS version. Everything works very well, except the footnotes of our articles will not display in any way.

I wonder if the problem is in our XML-coding or if maybe footnotes are not a feature of this solution? If so, can it be implemented in some way?

I apologize if this is not the forum for these kinds of questions.

gnott commented 2 years ago

It's likely Lens does not display footnotes, and some enhancements would be required to do so. You add an example of some footnote XML you have, if you are able, to this issue for others to see.

Kyrklund83 commented 2 years ago

Thank you for your quick reply! The footnotes looks like this in the xml-files we received from our supplier:

Markup in the paragraphs looks like this:

Eva Ström, Ina Thörngren, Kristina Lugn, Marie Louise Ramnefalk, Margareta Renberg och Tua Forsström var poeter som omnämndes i sammanhanget.
<xref ref-type="bibr" rid="B1">1</xref>
En vid den här tiden övervägande manlig kritikerkår 

And the footnote content, at the bottom of the file, looks like this:

<back>
<ref-list>
<title>Noter</title>
<ref id="B1">
<label>1</label>
<mixed-citation publication-type="journal">
<collab>
Tack till de anonyma granskarna för välriktad kritik och kommentarer
</collab>
.
<string-name>
<given-names>Se Eva</given-names>
<surname>Bruno</surname>
</string-name>
,
<article-title>
”Den berömda verkligheten” och Anders Olsson ”Före orden, för-orden”
</article-title>
, i
<source>Bonniers litterära magasin</source>
, nr
<issue>5</issue>
(
<year>1978</year>
):
<fpage>283</fpage>
–
<lpage>285</lpage>
och 287–289. Framförallt Olssons text, som ingick i en enkät där
<italic>Bonniers litterära magasin</italic>
försökte skapa en överblicksbild över den samtida poesin genom att bland annat be fyra kritiker reflektera över den, refererades ofta till i litteraturkritiken vid den här tiden.
</mixed-citation>
</ref>
gnott commented 2 years ago

I think perhaps in the case above, the converter logic does not currently support parsing the <mixed-citation> tags. It would reach these lines of code https://github.com/elifesciences/lens/blob/develop/converter/lens_converter.js#L2183-L2185 Only <element-citation> tags are currently parsed and shown.

gnott commented 2 years ago

Though, in addition to the above, lines https://github.com/elifesciences/lens/blob/develop/converter/lens_converter.js#L2106-L2111 indicates if there is a <person-group> tag inside the <mixed-citation> then some of the data may be extracted. You could test by editing the XML to be <person-group><collab>...</collab></person-group> and maybe it would display more citation data.

Kyrklund83 commented 2 years ago

Again, thank you for replying! Am I correct though, in understanding as the tag that gives the reference function? And that I may be able to 'hack' what is displayed by that function by using the tag?

Or is this a separate tag that may create footnotes?

gnott commented 2 years ago

I think what you would see is in the left-side content panel, the 1 of the <xref ref-type="bibr" rid="B1">1</xref> will appear as an underlined link. Clicking on it will cause the right-side panel to focus on the "References" tab and to highlight the B1 reference / citation.

As described in comment https://github.com/elifesciences/lens/issues/226#issuecomment-995316355 above the XML tagging inside the <ref> tag may need some changes for the Lens parser to extract the data from it, since <mixed-citation> is not as well supported by the parsing logic.

Tiago-Manzato commented 2 years ago

Hi folks! How's y'all doing? My issue isn't exactly the same as stated in the comments above but since this issue is open and with the subject that matches my problem I'll post here.

So, the citation references for my XMLs works just fine, however, the cross references such as author/foot notes doesn't. Let me elaborate a little further.

The tagging on the XMLs are as shown below:

<body>
    <sec sec-type="intro">
        <title>Introduction</title>
            <p>...<xref ref-type="fn" rid="fn1"><sup>1</sup></xref></p>
            <p>...<xref ref-type="fn" rid="fn2"><sup>2</sup></xref></p>
    </sec>
</body> 
<back>
    <ref-list>
    ...
    </ref-list>
    <fn-group>
        <fn id="fn1">
            <label><sup>1</sup></label>
            <p>generic foot note text 1</p>
        </fn>
        <fn id="fn2">
            <label><sup>2</sup></label>
            <p>generic foot note text 2</p>
        </fn>
    </fn-group>
</back>

I'm using stand-alone Lens Viewer on my localhost webserver (by the way, it's an amazing feature, very appreciated!!) so the URL I get in the navigator address bar when I launch Lens is something like "http://localhost/lensreader/#toc" and one thing that I noticed is that when I click on a citation reference the URL points to http://localhost/lensreader/#content/citation_reference_1 and the citation reference gets highlighted perfectly, but when I click on a foot note cross reference the URL points to http://localhost/lensreader/#content/cross_reference_1 which displays nothing. By inspecting these cross reference elements on Chrome I could see that a citation reference: citation div

links the citation to it's reference inside "div resources/panel citations resource-view":

reference div

while a footnote cross reference :

crossref citation div

doesn't have a panel at all:

div resources

So unless a footnote is intended to be displayed under the "div panel citations resource-view" the cross reference is not being recognized from it's XML tag or Lens is failing to create the proper container "cross_reference_1" for footnotes.

I'm no programmer myself but I hope this information I gathered makes any sense to actual developers to figure out how to solve this issue/bug.

Thanks in advance

gnott commented 2 years ago

Thanks for your examples @Tiago-Manzato and adding to the discussion.