sillsdev / appbuilder-pwa

Progress Web App template for Scripture App Builder
https://software.sil.org/scriptureappbuilder
MIT License
8 stars 22 forks source link

Picture Story Books #578

Open chrisvire opened 1 month ago

chrisvire commented 1 month ago

I have found out at EMDC that Picture Story Books are more important than I first thought. I lot of extra material are created using them, and they don't necessarily have to have pictures at the top.

The issue with Picture Story Books is that they use non-standard SFM tags. See the documentation for Building Apps either from the help menu or from the website, section 20. Hopefully, we can use the USFM milestone for most of the tags.

A USFM milestone is a mechanism to add your own character-level markup elements. All milestones start with the "z" character followed by a word and either a -s or -e for start or end milestone. I will agree, it is a strange syntax! Here is an example from the documentation:

\qt-s |sid="qt_123" who="Pilate"\*“Are you the king of the Jews?”\qt-e |eid="qt_123"\*

As you can see, they also can have a sid (start id) and eid (end id) if they span over other elements (or even overlap with another element of the same type.

USFM also declares a standalone milestore (e.g. \zms\*) without the -s and -e and not spanning other content, but Proskomma doesn't support parsing that yet. Here is the issue.

Here is an example of how we are currently using milestones to implement an SAB non-standard SFM tag. SAB uses \video ID to insert video into content. We convert this to:

\zvideo-s id="ID"\*\zvideo-e\*

For Picture Story Books, there are quite a few markers that are included.

\page

The \page marker is similar to \c marker in that it breaks the content of the book into separate pages in the mobile app.

\img

The \img marker is similar to the \fig but the image is fixed at the top of the page and the rest of the content scrolls under it.