Code Monkey home page Code Monkey logo

remark-corebc's Introduction

Remark CoreBC

This Remark plugin, "remark-corebc," transforms Core Blockchain notations into Markdown links (when positively checked) and negated text (when negatively checked), enhancing documents with blockchain data integrations. It features ICAN validation, customizable links to blockchain explorers, and formatting options for various blockchain identifiers.

About Blockchain

Blockchain is a decentralized, distributed ledger technology that records transactions across a network of computers. It provides transparency, security, and immutability for data storage and transfer. Core Blockchain is a blockchain platform that offers a scalable, secure, and efficient infrastructure for decentralized applications and digital assets.

The main aim is to support ICAN-based blockchains, such as:

Installation

Install the plugin using npm or yarn:

npm install remark-corebc

Or:

yarn add remark-corebc

Usage

To automatically convert Core Blockchain notations into clickable links or text definition and optionally validate ICAN identifiers:

import remark from 'remark';
import remarkCorebc from 'remark-corebc';

(async () => {
  try {
    const file = await remark()
      .use(remarkCorebc, { enableIcanCheck: true })
      .process('Your markdown text here');
    console.log(String(file));
  } catch (err) {
    throw err;
  }
})();

The plugin recognizes notations such as [cb1234...@cb] and [!cb1234...@cb], converting them to links and optionally validating ICAN identifiers, displaying invalid items as text.

Options

Configure the plugin with the following options:

  • enableIcanCheck: Enable ICAN validation (default: true).
  • enableSkippingIcanCheck: Skip ICAN validation with "!" prefix (default: true).
  • linkNetworks: Link to specific blockchain networks (default: true).
  • explorerUrl: Mainnet explorer URL for constructing links (default: https://blockindex.net/).
  • explorerTestnetUrl: Testnet explorer URL for constructing links (default: https://xab.blockindex.net/).
  • urlPathAddress: URL path for address links, appended to explorerUrl or explorerTestnetUrl. Use ${1} as a placeholder for the address (e.g., address/${1}).
  • urlPathBlockNo: URL path for block number links, appended to explorerUrl or explorerTestnetUrl. Use ${1} as a placeholder for the block number (e.g., block/${1}).
  • urlPathBlockHash: URL path for block hash links, appended to explorerUrl or explorerTestnetUrl. Use ${1} as a placeholder for the block hash (e.g., block/${1}).
  • checkAddress: Transform blockchain addresses (default: true).
  • checkBlockNumber: Transform block numbers (default: true).
  • checkBlockHash: Transform block hashes (default: true).
  • debug: Print transformation details to console (default: false).

Features

  • ICAN Validation: Validates ICAN identifiers for reliability.
  • Link Customization: Customizes links to mainnet and testnet explorers for direct blockchain data access.
  • Data Transformation: Formats blockchain addresses, numbers, and hashes into clickable links.
  • Configuration Flexibility: Tailors behavior with a variety of options.
  • Seamless Integration: Fits into Remark pipelines, enhancing documents with blockchain integrations.

Contributing

Contributions are welcome! Please submit pull requests or open issues to improve the plugin.

License

Licensed under the CORE License.

remark-corebc's People

Contributors

rastislavcore avatar

Watchers

 avatar ali avatar Sasha Zezulinsky avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.