seeking software help with Sefaria API to display bilingual text on HTML canvas

47 views
Skip to first unread message

Chaim C

unread,
Jun 23, 2019, 3:12:12 PM6/23/19
to Sefaria Project
I am seeking help, perhaps example javascript code, for how I can display Sefaria textual material on an HTML canvas.


Within a Dafboard presentation I wanted to enhance a small video shiur, which referenced this Mishna source, with synchronized source text display.  Ideally the relevant phrases can be highlighted as the speaker references them.

Dafboard originally expected source text to be in image format, such as scanned daf images.  If there were a way to have Sefaria provide an image version of links like this, that would drop in.

However there should be an opportunity now, particularly with [albeit different] Python back ends, to display the bilingual source text (without images) and have a Sefaria widget available to presenters, when developing multi-sensory presentations, with ease.

If there is anyone willing to help demonstrate how to display just the two paragraphs within an existing canvas?

The section I'd want is this:
<p lang="heclass="he">יְהוּדָה בֶן תֵּימָא אוֹמֵר, הֱוֵי עַז כַּנָּמֵר, וְקַל כַּנֶּשֶׁר, וְרָץ כַּצְּבִי, וְגִבּוֹר כָּאֲרִי, לַעֲשׂוֹת רְצוֹן אָבִיךָ שֶׁבַּשָּׁמָיִם. הוּא הָיָה אוֹמֵר, עַז פָּנִים לְגֵיהִנֹּם, וּבֹשֶׁת פָּנִים לְגַן עֵדֶן. יְהִי רָצוֹן מִלְּפָנֶיךָ יְיָ אֱלֹהֵינוּ שֶׁתִּבְנֶה עִירְךָ בִּמְהֵרָה בְיָמֵינוּ וְתֵן חֶלְקֵנוּ בְתוֹרָתֶךָ:
</p><p lang="enclass="en">Judah ben Tema said: Be strong as a leopard, and swift as an eagle, and fleet as a gazelle, and brave as a lion, to do the will of your Father who is in heaven. He used to say: the arrogant is headed for Gehinnom and the blushing for the garden of Eden. May it be the will, O Lord our God, that your city be rebuilt speedily in our days and set our portion in the studying of your Torah. </p><div class="clearFix"></div></div></span><span><div tabindex="0class="segmentdata-ref="Pirkei Avot 5:21aria-controls="panel-1aria-label="Click to see links to Pirkei Avot 5:21">



This current result simply uses screen snapshot images   http://dafboard2.torahtechnologies.org/presentation/4 .  I would like to do better.

--Chaim
TorahTechnologies.org

Lev Israel

unread,
Jun 24, 2019, 10:58:47 AM6/24/19
to sef...@googlegroups.com
Chaim - 

For any reference for in a URL (like Pirkei_Avot.5.20 in your URL), you can get the underlying data from our REST API.  
Your example's URL would be: 

The "text" and "he" fields then have the data. 

As for rendering that text on an HTML Canvas - much depends on your toolset.  Whatever it may be, though, tutorials abound.

Hope this helps.
Lev

--
You received this message because you are subscribed to the Google Groups "Sefaria Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sefaria+u...@googlegroups.com.
To post to this group, send email to sef...@googlegroups.com.
Visit this group at https://groups.google.com/group/sefaria.
To view this discussion on the web visit https://groups.google.com/d/msgid/sefaria/39be5c53-c11e-460e-b705-dd44a1a6919a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Reply all
Reply to author
Forward
0 new messages