unfoldingWord / gateway-edit

Book Package harmonized view.
https://gatewayedit.com
MIT License
1 stars 4 forks source link

SPIKE: What is needed to add OBS to gE? #497

Open birchamp opened 1 year ago

birchamp commented 1 year ago

Teams want to have an OBS mode of gE.

Can this be accomplished by giving the user OBS as an option in the list of books available in the BCV drop-down? What components need to change? What components will/should work as is? Why can't we close cards? Is there a reason it's only minimize? Cards will be: OBS, OBS-TN (TSV7), OBS-TWL(TSV7), TW, TA. Is there a way we can do this with as little impact on the components as possible?

Details

We believe the simplest initial solution is to minimize the scripture cards and restore the OBS card when switching to OBS. Then switching to scripture is the opposite.

elsylambert commented 1 year ago

@abelpz 's work on OBS review can be used as reference for this.

birchamp commented 1 year ago

@abelpz is needed for the first steps on this. Others may take this on as it matures

abelpz commented 1 year ago

Discoveries:

Steps:

1) pass the addOBS boolean value as a param to the useBibleReference() hook call in D:\GitHub\gateway-edit\src\components\BibleReference.js

2) check obs repo is present in user's org and add it to the bibles array in D:\GitHub\gateway-edit\src\utils\resources.js

3) define a new array of workspace cards for when obs is selected in D:\GitHub\gateway-edit\src\components\WorkspaceContainer.js

4) it seems like everything is prepared to fetch and handle obs related resources but not the obs itself, for that, a modification to the useContent hook (from translation-helps-rcl) may be needed, or creating a new hook that parses obs splitting them by story (chapter) and frames (verses).

@birchamp

birchamp commented 1 year ago

Looking at # 3 above "define a new array of workspace cards for when OBS is selected" reminds me of the original design of gE. We had envisioned a "resource gallery" and a "templates gallery".

Menu CleanShot 2023-07-27 at 16.43.37.png

Template Gallery: CleanShot 2023-07-27 at 16.51.14.png

birchamp commented 9 months ago

@elsylambert issues from this should be worked on during the last week of the year.

PhotoNomad0 commented 9 months ago

@birchamp @richmahn @elsylambert A few questions on OBS support:

PhotoNomad0 commented 9 months ago

@birchamp @richmahn @elsylambert @Joel-C-Johnson Some additional questions on OBS support:

richmahn commented 9 months ago

@birchamp @richmahn @elsylambert A few questions on OBS support:

  • do we have a spec for the OBS file format?

    • There does not seem to be any verse markers in the obs markdown file, and yet in the obs twl and tn files there are verse numbers. How do we identify where the verse does begin?

    • What tool was used to create the OBS text in the first place?

    • I suspect it was ts-desktop and then refined in tc-create. And then translations were done with tc-create

    • What tool was used to create the OBS tn?

    • I suspect tc-create

The OBS markdown format is 2 lines (with blank lines) for each frame, one line with the frame's image reference, one line with the frame's text:

# Header

[Markdown Image Link for Frame 1]

[Markdown Text for Frame 1]

[Markdown Image Link for Frame 2]

[Markdown Text for Frame 2]

etc...

[Last line: Markdown with Bible reference, optional]

So when the bibleReference changes its story or frame, in the onChange function I determine the frame by looking at the story's elements and multiple that by 2 (due to image and text being 2):

https://preview.door43.org/u/unfoldingWord/en_obs

Code: https://github.com/unfoldingWord/door43-preview-app/blob/7553dd53fdaf04c7f214be649e4381ee0879efad/src/components/RcOpenBibleStories.jsx#L34

richmahn commented 9 months ago

@PhotoNomad0 Also note, DCS serves OBS in 3 different repo metadata types:

PhotoNomad0 commented 9 months ago

Preliminary Notes:

From Investigation with theNerd247

Adding support for OBS resources

GWE App

Create an OBS resource card:

Translation helps Changes:

PhotoNomad0 commented 9 months ago

Also note, DCS serves OBS in 3 different repo metadata types:

  • tS: Format: each story a dir, each frame a text file, no markdown, no image (you have to derive the image URL from the story-frame ref)
  • RC Format: files in content dir, each markdown file a story, starts with header, then each frame an image line and text line, then the optional Bible reference line
  • SB: Format: same as RC, but in the ingredients dir.

I think we need to support the RC format.