0.1.3 • Published 4 years ago

@microfleet/schema2md v0.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

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)