url

Function url 

Source
pub fn url<S: Into<String> + Clone>(
    site: &Site,
    text: S,
) -> Result<String, BibleError>
Expand description

Adds Markdown link syntax around found scriptures to an Online Bible and the modified string is returned. When possible, it will link directly to the scripture being referenced.

The url function takes a Site enum coresponding to the translation being used. As an example, if you were building links for the english version of the online NWT translation, you would use est::locales::nwt_en::Site::JwOrg to build the proper link.

ยงExample

use est;
use est::locales::nwt_en::Site::JwOrg;
 
let text: &str = "All friends should practice Proverbs 17:17!";
let expected:String = "All friends should practice [Proverbs 17:17](https://www.jw.org/en/library/bible/study-bible/books/proverbs/17/#v20017017)!".to_string();
assert_eq!(expected, est::url(&JwOrg, text).unwrap());