0.1.0 • Published 4 years ago

@code-blocks/from-md v0.1.0

Weekly downloads
1
License
GPLv2
Repository
github
Last release
4 years ago

@code-blocks/from-md

Extracts code blocks from markdown.

Usage

import fromMD from '@code-blocks/from-md'

fromMD(someHTML, ['line-chart', 'csv-table'])

Takes tow arguments:

  • md a string containing markdown
  • languages an array of languages to extract

Returns an array of parts:

export interface PartCode {
  type: 'code'
  language: string
  content: string
}

export interface PartOther {
  type: 'other'
  content: string
}

export type Part = PartCode | PartOther
0.1.0

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago

0.0.0

4 years ago