AndBible / and-bible

AndBible: Bible Study
https://andbible.org
GNU General Public License v3.0
576 stars 193 forks source link

MyBible title and x-refs (stories) need improvement #2564

Open timbze opened 1 year ago

timbze commented 1 year ago

image

The title is stored in "stories" table like this: Der Sohn Gottes ist als Retter in die Welt gekommen

The cross references are also stored in "stories" table in 1 cell like this: <x>690 4:9-10</x>; <x>520 5:6-11</x>; <x>500 6:38-40</x>

The verse looks like this: <pb/><J>Und wie Mose in der Wüste die Schlange erhöhte, so muss der Sohn des Menschen erhöht werden,</J>

It's read from db here: https://github.com/AndBible/and-bible/blob/e0a280b6f5c16e3ab3f7cb4cdd7b30e8efca1b39/app/src/main/java/net/bible/service/sword/mybible/MyBibleBook.kt#L337-L343

Bug was found on AndBible version 684 but I think this just has not been implemented yet.

The module in screenshot is Schlachter 2000 MyBible.

(I tried solving this a bit myself but I'm a bit far disconnected with how OSIS is read etc. It's difficult to connect all the dots)

tuomas2 commented 1 year ago

MyBible verses contain some sort of XML fragments, not really OSIS. Some special tags are provided in app/bibleview-js/src/components/MyBible folder. readRawContents (->readBible) reads one verse fragment. Because "stories" (subtitles) are located in another table, it combines them in the quoted code.

JSword will put the content returned from readRawContent within verse tag. That's why verse number comes before the title.

One way is to move (possible) title tag in JS side to front of verse tag, i.e. in OsisSegment.vue (see osisToTemplateString function for example what kind of conversion we already do). Instead of simple regex conversion the moving would be easier to be done by reading content into DOM object and manipulating there, similar way as BWA (BibleViewAnchor) tags are added in addAnchors() (see OsisDocument.vue).

tuomas2 commented 1 year ago

MyBible xrefs should work already. They are <a> tags and they are intepreted in BibleJavascriptINterface:openExternalLink

tuomas2 commented 1 year ago

<x>690 4:9-10</x>; <x>520 5:6-11</x>; <x>500 6:38-40</x>

Okay these should be probably replaced in android/kt side with regex magic directly to <reference> tags (I probably wouldn't try to make <x> tag implementation that works directly from js side because of book number conversion.

We do some regex tricks for mysword documents in transformMySwordTags, perhaps that serves as an example.

tuomas2 commented 1 year ago

<pb/> tag is paragraph break. It also (probably) should be moved to front of verse (and title) tag.

tuomas2 commented 1 year ago

(I tried solving this a bit myself but I'm a bit far disconnected with how OSIS is read etc. It's difficult to connect all the dots)

Thanks for trying to solve! Hope I helped to connect some dots :-)