How are SFM items mapped to RAB styles?

I found this thread:
https://community.software.sil.org/t/link-to-sfm-code-documentation/1329

And I have a good grasp of USFM in contexts like Paratext, or where we operate some small humble databases using SFM.

Now I am far from my team and their source-files and I need to quickly create some Reading App for developing and testing our emerging privacy policies.

I have lots of choices for SFM codes, like \p but when I look over the impressive (I like) list of available default styles inside RAB I wonder where I can look up the respective SFM code, when I want to use a certain RAB style.

Example: I want to use some “normal paragraph” tagged div.p in RAB and then some simple headings, maybe “section heading 1” tagged div.s in RAB.

I can guess that I look at the styles list in RAB and remove “div.” to arrive at a valid SFM like \p and \s.

But what SFM do I need to use, to access all the “more exotic” styles in RAB like “body” or “a:link” when I prepare my content as an SFM file please?

Is there an inbuilt map in RAB and can I see it? Or even edit it?

Thank you.

If you know USFM then RAB styles should be easy to understand.

A normal paragraph is \p found in the styles as:
div.p

The div part is from HTML and means a block of content. A paragraph in other words.
The period starts a class name and all USFM markup is mapped to a class name. So .p comes from \p.
A span indicates a character markup within paragraph.
So \bd Bold words\bd* markup is found at span.bd

So if you want a title like markup that is only at the beginning then use \mt1 and \mt2.

If it is a header in the body then use \s, \s1, \s2.
image

For Paragraphs the two most common are \p and \m.
image

You can make up your own SFM codes if you want but there will be no default styling. You will have to add it all yourself. Which is a lot of work. So sticking to USFM markup is the easiest option.

1 Like

Thank you Ian. You confirmed my guess-work, and I am happy that I got it right for the normal paragraphs.

So I just repeat the “tricky bit” from the end of my question, where my guessing does not help me:

But what SFM do I need to use, to access all the “more exotic” styles in RAB like “body” or “a:link” when I prepare my content as an SFM file please?

Is there an inbuilt map in RAB and can I see it? Or even edit it? Or if I got the concept wrong, and it is not a question of “map”, then please let me know how RAB is processing SFM to arrive at its own styles.

But what SFM do I need to use, to access all the “more exotic” styles in RAB like “body” or “a:link” when I prepare my content as an SFM file please?

The body by default is the whole document.

‘a:link’ has no SFM equivalent but you can use Markdown markup to create a link to other pages or to external things such as a web site or to a Bible app that has deep linking turned on.

Markdown markup for a hyperlink is like this:

[words shown in link](https://fake.com/page)

Is there an inbuilt map in RAB and can I see it? Or even edit it?
RAB uses USFM markers as the default styling and knows how to handle those. You can make your own system if you want but hen you have to add the styling to those markers. RAB will add them to the Styles but they will have no styling properties.

One reference is here: Cheat Sheet for most commonly used USFM codes (with examples?)