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

Problem displaying psalms titles #1173

Closed
LAfricain opened this issue Sep 4, 2024 · 11 comments
Closed

Problem displaying psalms titles #1173

LAfricain opened this issue Sep 4, 2024 · 11 comments

Comments

@LAfricain
Copy link
Contributor

The rendering of the psalm title, is strange. The verse number is followed by a line break, which shouldn't be the case:

  1 
Pour la fin, psaume de David. *n1

It should be like this:

  1 Pour la fin, psaume de David. *n1
@karlkleinpaste
Copy link
Contributor

That's a function of module markup, not Xiphos. Xiphos has no opinion on where line breaks go, except when enabling verse-per-line as a module option. Xiphos just prepares a verse marker, then asks the Sword engine, "Give me ThisVerse," and stuffs the returned text into the widget after the verse marker.

You didn't mention what module this is, or which Psalm; I went through all the French modules I have installed for Ps.1.1 and none rendered that way.

Offhand, I suggest mod2imp YourModule | less to find your instance and see the underlying markup.

@karlkleinpaste
Copy link
Contributor

For that matter, ask diatheke to show you exactly how rendering works, using XHTML (as Xiphos does), and using your module and verse:

diatheke -b KJV -f xhtml -o fmhlswi -k ps1.1

@LAfricain
Copy link
Contributor Author

The module is not yet published, it's an experimental module of FreVulgGlaire. We just implemented this tag psalm_title.

diatheke -b FreVulgGlaireX -f xhtml -o fmhlswi -k ps3.1
<html><head><meta http-equiv="content-type" content="text/html" charset="UTF-8" lang="en" xml:lang="en"/>
<style type="text/css">		.divineName { font-variant: small-caps; }
		.wordsOfJesus { color: red; }
		.transChange { font-style: italic; }
		.transChange.transChange-supplied { font-style: italic; }
		.transChange.transChange-added { font-style: italic; }
		.transChange.transChange-tenseChange::before { content: '*'; }
		.transChange.transChange-tenseChange { font-style: normal; }
		.transChange:lang(zh) { font-style: normal; text-decoration: dotted underline; }
		.overline { text-decoration: overline; }
		.indent1 { margin-left: 1em; }
		.indent2 { margin-left: 2em; }
		.indent3 { margin-left: 3em; }
		.indent4 { margin-left: 4em; }
		abbr { &:hover{ &:before{ content: attr(title); } } }
		.small-caps { font-variant: small-caps; }
		.otPassage { font-variant: small-caps; }
		.selah { text-align: right; width: 50%; margin: 0; padding: 0; }
		.acrostic { text-align: center; }
		.colophon {font-style: italic; font-size: small; display: block; }
		.rdg { font-style: italic; }
		.inscription {font-variant: small-caps; }
		.catchWord {font-style: bold; }
		.x-p-indent {text-indent: 1em; }
	</style></head><body>Psalms 3:1: <span style="font:Gentium;" lang="fr"></span><br />
(FreVulgGlaireX)
</body></html>

Content of the osis:

<chapter sID="Ps.3-aka-3" osisID="Ps.3" n="3"/>
      </p>
      <div type="introduction">David se soutient contre la crainte qu’on veut lui donner de ses ennemis, par le souvenir des secours qu’il a reçus de Dieu, et par l’espérance qu’il a d’en recevoir de nouveaux de sa bonté.</div>
      <verse sID="Ps.3.1" osisID="Ps.3.1" n="1"/>
      <title type="psalm" canonical="true">Psaume de David, lorsqu’il fuyait devant Absalom son fils.
        <note>Ps. 3,1 : 
          <q>Lorsqu’il fuyait</q>, etc. Cette fuite de David est racontée dans 
          <reference osisRef="2Sam.15.15">2 Rois, 15, verset</reference> 14 et suivants.</note>
        <verse eID="Ps.3.1"/>
        <verse sID="Ps.3.2" osisID="Ps.3.2" n="2"/>
      </title>
      <p>Seigneur, pourquoi se sont-ils multipliés, ceux qui me persécutent ? Ils sont bien nombreux, ceux qui s’élèvent contre moi.
        <note>Ps. 3,2-3 : * Multitude des ennemis de David.</note>
        <verse eID="Ps.3.2"/>

As you can see, Xiphos displayed nothing:
Ps 3 1FreVulgGlaireX

This is probably due to the wrong location of a tag. @UnasZole is working on it.
But When the tag is well formed it looks like this (I don't know if it's a Xiphos issue or a sword issue)

       <chapter sID="Ps.12-aka-12" osisID="Ps.12" n="12"/>
      </p>
      <div type="introduction">David prie le Seigneur de ne pas le laisser tomber dans la mort que son ennemi veut lui donner, et il fait cette prière avec une ferveur et une confiance qui peuvent servir de modèle à tous ceux qui veulent recourir à Dieu.</div>
      <verse sID="Ps.12.1" osisID="Ps.12.1" n="1"/>
      <title type="psalm" canonical="true">Pour la fin, psaume de David. </title>
      <p>Jusques à quand, Seigneur, m’oublierez-vous pour toujours ?  Jusques à quand détournerez-vous de moi votre visage ?
        <note>Ps. 12,1 : Pour toujours. Il faut nécessairement suppléer devant ces mots : sera-ce, ou bien les traduire par entièrement, absolument ; sens dont ils sont susceptibles en hébreu.</note>
        <note>Ps. 12,1-3 : Plainte à Dieu qui abandonne le Psalmiste.</note>
        <verse eID="Ps.12.1"/>
diatheke -b FreVulgGlaireX -f xhtml -o fmhlswi -k ps12.1
<html><head><meta http-equiv="content-type" content="text/html" charset="UTF-8" lang="en" xml:lang="en"/>
<style type="text/css">		.divineName { font-variant: small-caps; }
		.wordsOfJesus { color: red; }
		.transChange { font-style: italic; }
		.transChange.transChange-supplied { font-style: italic; }
		.transChange.transChange-added { font-style: italic; }
		.transChange.transChange-tenseChange::before { content: '*'; }
		.transChange.transChange-tenseChange { font-style: normal; }
		.transChange:lang(zh) { font-style: normal; text-decoration: dotted underline; }
		.overline { text-decoration: overline; }
		.indent1 { margin-left: 1em; }
		.indent2 { margin-left: 2em; }
		.indent3 { margin-left: 3em; }
		.indent4 { margin-left: 4em; }
		abbr { &:hover{ &:before{ content: attr(title); } } }
		.small-caps { font-variant: small-caps; }
		.otPassage { font-variant: small-caps; }
		.selah { text-align: right; width: 50%; margin: 0; padding: 0; }
		.acrostic { text-align: center; }
		.colophon {font-style: italic; font-size: small; display: block; }
		.rdg { font-style: italic; }
		.inscription {font-variant: small-caps; }
		.catchWord {font-style: bold; }
		.x-p-indent {text-indent: 1em; }
	</style></head><body>Psalms 12:1: <span style="font:Gentium;" lang="fr"><h3 class="title psalm canonical">Pour la fin, psaume de David. </h3>

<br />
Jusques à quand, Seigneur, m’oublierez-vous pour toujours ? Jusques à quand détournerez-vous de moi votre visage ? <a class="noteMarker" href="passagestudy.jsp?action=showNote&type=n&value=1&module=FreVulgGlaireX&passage=Psalms+12%3A1"><small><sup class="n">*n</sup></small></a> <a class="noteMarker" href="passagestudy.jsp?action=showNote&type=n&value=2&module=FreVulgGlaireX&passage=Psalms+12%3A1"><small><sup class="n">*n</sup></small></a></span><br />
(FreVulgGlaireX)
</body></html>

Ps12FreVulgGlaireX

@karlkleinpaste
Copy link
Contributor

I suggest you compare against KJV for the same verse, where the superscription appears normally, with a few newlines inserted for readability.

<div type="x-milestone" subType="x-preverse" sID="pv1"/>
<title canonical="true" type="psalm">
<w lemma="strong:H04210">A Psalm</w> 
<w lemma="strong:H01732">of David</w>, 
<w lemma="strong:H01272" morph="strongMorph:TH8800">when he fled</w> 
<w lemma="strong:H06440">from</w> <w lemma="strong:H053">Absalom</w> 
<w lemma="strong:H01121">his son</w>.
</title>
<div type="x-milestone" subType="x-preverse" eID="pv1"/>
<w lemma="strong:H03068"><divineName>Lord</divineName></w>, 
<w lemma="strong:H07231" morph="strongMorph:TH8804">how are they increased</w> 
<w lemma="strong:H06862">that trouble</w> <w lemma="strong:H07227">me! many</w> 
<transChange type="added">are</transChange> 
<w lemma="strong:H06965" morph="strongMorph:TH8801">they that rise up</w> against me.

diatheke output abbreviated to just the <body> content:

diatheke -b KJV -f xhtml -o fmhlswi -k ps3.1

<h3 class="title psalm canonical">A Psalm of David, when he fled
<small><em class="morph">
(<a class="morph" href="passagestudy.jsp?action=showMorph&type=strongMorph%3ATH8800&value=TH8800"
class="morph">8800</a>)</em></small> 
from Absalom his son.</h3>

Psalms 3:1: <span style="font:Gentium;" ><span class="divineName">Lord</span>, 
how are they increased<small><em class="morph">
(<a class="morph" href="passagestudy.jsp?action=showMorph&type=strongMorph%3ATH8804&value=TH8804"
class="morph">8804</a>)</em></small> 
that trouble me! many <span class="transChange transChange-added">are</span> they that rise up
<small><em class="morph">
(<a class="morph" href="passagestudy.jsp?action=showMorph&type=strongMorph%3ATH8801&value=TH8801"
class="morph">8801</a>)</em></small> 
\against me.</span><br />

@LAfricain
Copy link
Contributor Author

But the difference is in KJV the psalm title is not in the verse 1 as it is in all the catholic bibles.

@UnasZole
Copy link

UnasZole commented Sep 6, 2024

Hi @karlkleinpaste ,

If I may add some precisions :

  • I'm building a tool to convert bibles from various online sources into OSIS. @LAfricain is using my tool to build sword modules from a French catholic bible he maintains on Wikisource.
  • After studying the OSIS spec, the strategy I used in my tool is to use the normal form of elements for the tags which represent the semantic structure of the text (sections, titles, introductions, paragraphs...), and the milestoned form for the tags that only serve to identify portions of canonical text (chapter and verse).
  • I recently implemented the psalm title tag. In bibles where the psalm title is before verse 1 (typically considered verse "0" in protestant versifications like KJV), no problem. But in catholic bibles, the versification usually includes the psalm title, and in varying ways (eg. For psalm 3, the title is verse 1. For psalm 12, the title is only the first half of verse 1 - and the end of verse 1 is the actual beginning of the psalm. For others, the title spans both verses 1 and 2. Etc.)

It's in this context that you get the example @LAfricain presented : you can end up with verse end and start tags in the middle of the psalm title.

As far as I understand, it's perfectly valid in the OSIS spec, but apparently not handled in the rendering engine here, leading to the completely blank verses in his first screenshot.

So I suppose a significant change to the rendering engine would be needed to handle that properly.

@UnasZole
Copy link

UnasZole commented Sep 7, 2024

To be more accurate, I just checked and it seems the issue is in osis2mod itself, not really the rendering side.

In these cases where there are <verse /> markers in the middle of a title, then the <title> and </title> tags end up on different verses - and since each verse is formatted independently, each verse is considered invalid XML.
Osis2mod should have converted the <title></title> tags to milestoned form, like it does for all document structure tags such as <p>, <lg>, <l>, etc. A canonical title should just be treated as a special type of paragraph.

So the core problem here is in osis2mod - though it may likely still require some changes on the rendering side afterwards.

@karlkleinpaste
Copy link
Contributor

Being an osis2mod problem and, as I said originally, Xiphos having no opinion about line breaks, I'm closing this for now.

@LAfricain
Copy link
Contributor Author

Someone can open an issue on osis2mod tool tracker?

@karlkleinpaste
Copy link
Contributor

You should do that at this link.

@LAfricain
Copy link
Contributor Author

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

No branches or pull requests

3 participants