@microfleet/schema2md
TypeScript icon, indicating that this package has built-in type declarations

0.1.3 • Public • Published

Microfleet schema2md

Converts parsed JsonSchema into json2md compatible datastructures.

Install

yarn add @microfleet/schema2md

Configuration

  • linkTo?: (ref: SchemaRef) => string - function used when generating link href to the reference.
  • linkFrom?: (node: SchemaNode) => string - function used when generating link name for the reference.

Usage

For full working example please see tests or @microfleet/mdoc-markdow.

Please referer this page for schemas used in this example.

const { SchemaNode } = require('@microfleet/schema-tools')
const { Renderer } = require('@microfleet/schema2md')
const json2md = require('json2md')

const schemaTree = SchemaNode.parse(resolved)

const renderer = new Renderer()
const json2mdSchema = renderer.render(schemaTree)

const markdown = json2md(json2mdSchema)

Readme

Keywords

none

Package Sidebar

Install

npm i @microfleet/schema2md

Weekly Downloads

1

Version

0.1.3

License

MIT

Unpacked Size

29.3 kB

Total Files

31

Last publish

Collaborators

  • torinasakura
  • avvs