Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@amanda-mitchell/remark-tag-bible-references

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@amanda-mitchell/remark-tag-bible-references

This is a remark plugin that will use the Biblia API to tag Bible references.

  • 3.0.0
  • npm
  • Socket score

Version published
Weekly downloads
29
increased by190%
Maintainers
1
Weekly downloads
 
Created
Source

@amanda-mitchell/remark-tag-bible-references

This is a remark plugin that will use the Biblia API to tag Bible references.

Installation

yarn add @amanda-mitchell/biblia-api @amanda-mitchell/remark-tag-bible-references

Usage

const unified = require('unified');
const markdown = require('remark-parse');
const stringify = require('rehype-stringify');
const remark2rehype = require('remark-rehype');
const fetch = require('node-fetch'); // This can be any library that implements the Fetch interface
const { createBibliaApiClient } = require('@amanda-mitchell/biblia-api');
const {
  tagBibleReferences,
} = require('@amanda-mitchell/remark-tag-bible-references');

const apiKey =
  'Go to https://bibliaapi.com/docs/API_Keys to generate an API key.';

const bibliaApi = createBibliaApiClient({ apiKey, fetch });

const markdownDoc = `
# Hello, world!
	
One of my favorite passages is Prov 26:4-5.
`;

const html = unified()
  .use(markdown)
  .use(tagBibleReferences, { bibliaApi })
  .use(remark2rehype)
  .use(stringify)
  .process(markdownDoc).contents;

console.log(html);

When run, this script will print

<h1>Hello, world!</h1>
<p>One of my favorite passages is <a href="https://biblia.com/bible/proverbs/26/4-5">Prov 26:4-5</a>.</p>

In addition to transforming Bible references into links, this plugin will also attach a bibleReference property to each link's data node that contains information about the parsed reference.

Keywords

FAQs

Package last updated on 06 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc