Open zsviczian opened 3 years ago
Corrected an error in the SB
javascript var searchTerm = prompt('Provide the verses you want to import (e.g.: 1CO 2:3 or PSA 23:1-6)'); var searchParts = searchTerm.match('(.{3})\\s(\\d+):(\\d+)-?(\\d+)?'); var book = searchParts[1]; var chapter = searchParts[2]; var verseFrom = searchParts[3]; var verseTo = (searchParts[4]!=undefined) ? searchParts[4] : verseFrom; var result = '> **' + searchTerm + '**'; for (let verse=verseFrom; verse<=verseTo;verse++) { search_for = '{{'+verse+':BIBLE:'+book+' '+chapter+':'+verse+'}}'; block_uid = window.roamAlphaAPI.q(`[:find ?uid . :where [?e :block/string ?s] [(clojure.string/starts-with? ?s "${search_for}")] [?e :block/uid ?uid]]`); result = result + '\n(('+block_uid+'))'; } return result;
Imports a set of Bible verses as block references.
You need to import the Bible following the process described in my blogpost here: https://www.zsolt.blog/2020/12/importing-bible-to-roam-final-solution.html
You can find the link to the ASV.EDN archive which will restore the American Standard Version translation of the Bible for you.
https://youtu.be/4tzM-qVQzj0 https://www.zsolt.blog/2020/12/importing-bible-to-roam-final-solution.html
It seems this code no longer works. Would it be possible to update it? Thanks so much!!!
Corrected an error in the SB
✂️ Copy of your #42SmartBlock from Roam
42SmartBlock Verses
javascript var searchTerm = prompt('Provide the verses you want to import (e.g.: 1CO 2:3 or PSA 23:1-6)'); var searchParts = searchTerm.match('(.{3})\\s(\\d+):(\\d+)-?(\\d+)?'); var book = searchParts[1]; var chapter = searchParts[2]; var verseFrom = searchParts[3]; var verseTo = (searchParts[4]!=undefined) ? searchParts[4] : verseFrom; var result = '> **' + searchTerm + '**'; for (let verse=verseFrom; verse<=verseTo;verse++) { search_for = '{{'+verse+':BIBLE:'+book+' '+chapter+':'+verse+'}}'; block_uid = window.roamAlphaAPI.q(`[:find ?uid . :where [?e :block/string ?s] [(clojure.string/starts-with? ?s "${search_for}")] [?e :block/uid ?uid]]`); result = result + '\n(('+block_uid+'))'; } return result;
%>📋 Describe the SmartBlock
Imports a set of Bible verses as block references.
✅ Describe any prerequisites or dependencies that are required for this SmartBlock
You need to import the Bible following the process described in my blogpost here: https://www.zsolt.blog/2020/12/importing-bible-to-roam-final-solution.html
You can find the link to the ASV.EDN archive which will restore the American Standard Version translation of the Bible for you.
📷 Screenshot of your #42SmartBlock workflow/template from Roam
💡 Additional Info
https://youtu.be/4tzM-qVQzj0 https://www.zsolt.blog/2020/12/importing-bible-to-roam-final-solution.html