bible-linker
v1.0.17
Published
Recognize Bible verse reference in a piece of text and preprocess the text.
Downloads
26
Maintainers
Readme
bible-linker
Recognize bible verse references in the text and process them.
Usage
const { bibleLink, youVersion } = require('bible-linker')
// Use your own linker
const processed = bibleLink(
'In the verse Gen 3:5-6...', 'en', ownLinker)
function ownLinker({
grabbed,
language,
bookIndex,
chapter,
verseFrom,
verseTo
}) {
return `#${grabbed}#${bookIndex}##`
}
console.log(processed)
// In the verse #Gen 3:5-6#1##...
// Use YouVersion linker
const hyperlink = youVersion(
'In the verse Gen 3:5-6...', 'en')
console.log(hyperlink)
// In the verse <a href="https://www.bible.com/bible/114/GEN.3.5.6">Gen 3:5-6</a>