Hello Chris
You wrote this some time ago regarding DOCX files. It helped me understand a bit more of the “logic” … (see my comments … NOTE J:)
Just for you to know, DOCX files are converted to SFM files (the native format used by SAB). You have the most control if your source files are SFM. Styles are based on SFM markers (see the Styles tab in SAB).
From looking at the code, it appears that the following is done with regards to styles:
1 Some default styles are converted to SFM styles (e.g. Heading1 => s1, Heading2 => s2, Heading3 => s3)
NOTE J: yes heading 1 and 2 appear as s1 and s2 but then it stops. I can define up to 9 headings in MS Word and it would be ideal if all would be recognized and became visible somehow under the ImportedStyles tab all of them because then I could deal with them separately from s1 and s2 as they are needed and work properly within the bible books. This is an important issue …. like in our case we see that all bible books are ok. We now do not want to distort all that by pulling styles in every different way and direction to get what we want in de DOCX books and after that see that by doing this we have made a mess of the styles in the bible books
2 If a paragraph style is named after an SFM marker, then it uses that marker
3 I see some processing of paragraph styles ( <w:pStyle>) and run styles ( <w:rStyle> unless it is a hyperlink)
4 Handle bold, italic, strikethrough, underlined, highlighted text
Very good, but what we miss in our project is color … would it be possible to let SAB handle color codes like F00771# etc.
By the way CUSTOM COLORS of which there are 5, seem not to work as I expect. I defined e.g. custom color 1 in one of as red but it comes out in quite a diferent color.
5 Handle Alignment or Justification
Styles can be controlled in the Styles node in SAB if you can figure out the marker and the context.
NOTE J: I assume with the marker you mean the things like s1 and s2 etc. but what do you mean by the context?
We are not Paratext users but FileMakerPro users (database for Mac/Windows) and happy to find that - after XML export from FileMaker Pro - we could convert our XML bible books into SFM with the help of script. For the Bible books we are absolutely satisfied and it works allright despite the fact that we started from a different ‘track’. Several projects are dealt with by our small team using this technical infrastructure and our projects include also RTL script. So this is the very positive part of the story.
Before I continue, please note that I am not a programmer, although I have learned to understand SAB more or less and to work with it. So what I am going to say is from the point of view of the SAB user and from the point of view of the writer of BACKMATTER and FRONT MATTER BOOKS in MS Word (I use MS Word Mac as part of the Office 365 latest version)
About the DOCX files which we use we can say this: they contain introductory commentaries and and appendices with deeper studies of each bible book. Each book has its own introduction and its own appendix. We combine the Intro and Appendix of each Bible book into one BackMatterBook. These form the final part of one branch of our project which we would like to finalize this summer by putting the APP in 4 scripts on the Store and on the website, in fact 4 APPS.
So what is our problem or our wish regarding these DOCX files and the way SAB handles them. I am not really familiar with Paratext, but it seems to me that the DOCX format is so widely used that the way SAB deals with it, might be a bit more generous … if that is the right expression. Let me try to explain.
It might be very helpful if par and char styles sheets from MS Word would be recognized by SAB and put on the TAB ImportedStyles under the STYLES Tab in SAB.
It would be VERY helpful if SAB could recognize even just the names of lets us say 10 char-style-sheets and 10 par-style-sheets coming from a MSWord doc, even if they would not contain any specific internal information (like color, alignment, size, weight tc.). It would suffice if these names would just show up in a STABLE way inside e.g. with names like c1, c2 etc. or an other character let us say x1, x2, x3 and the same for the par. styles but with a different character eg. w1, w2 etc.
I capitalized the word STABLE above because we really experienced some ‘mysteries’ which - probably due to the fact that I am not a programmer - I would interpret as instability of the program at certain points (certainly not over the whole). Let me give an example: we imported a DOCX of more then 1000 pages (these will later be split up in portions for each book). Sometimes the styles or at least some would show up in the ImportedStyles Tab and sometimes not and sometimes I would wait till bedtime and say by myself , this is too bad (because they did not appear), let me take a rest and go to bed and continue on this to-morrow. So I close SAB to open it the next morning again after I started my Mac to find that some 40 styles appeared suddenly in the ImportedStyles Tab just because … because of what ??? because I slept or because SAB took a good rest and felt better the next day ?
I am not kidding, these things happened and of course I have no explanation for them as I also have no explanation for the fact that - after 10 minutes of very happily editing some of these imported styles (which suddenly appeared as ‘a miracle’) plus a few clicks on other TABs in SAB after which I returned again to the ImportedStyles sheet - I found that all these ImportedStyles had disappeared all of a sudden just as they came all of a sudden after I started my Mac in the morning and opened SAB.
And again today I was able to let some imported styles appear in the ImportedStyles Tab. They were /qt1 up to /qt6. I did manipulate them inside SAB and generated a nice APP with all these styles working in the APP. Beautiful. I thought we are almost where we want to be … so I enhanced my word doc a bit more and threw away the previous one imported it AGAIN into SAB …. and GONE were all the styles under the ImportedStyle Tab …. not to return again …. no mater how many times I tried to import it afresh.
So my question is what is going on here … and please help … it feels like I am walking in the mud …