adobe/jsonschema2md

Name: jsonschema2md

Owner: Adobe Systems Incorporated

Description: Convert Complex JSON Schemas into Markdown Documentation

Created: 2017-12-04 13:51:19.0

Updated: 2018-01-17 10:33:36.0

Pushed: 2018-01-05 17:44:14.0

Homepage: null

Size: 1326

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

JSON Schema Markdown Tools

CircleCI

Documenting and validating complex JSON Schemas can be hard. This tool makes it easier by providing a number of scripts that can turn JSON Schema files into readable Markdown documentation that is ready for consumption on GitHub or processed using Jekyll or other static site generators.

These tools have been introduced by Adobe to document Adobe's Experience Data Models (XDM), but can be used for other JSON Schema documents, too.

Requirements
Example Output

Using the schemas in examples/schemas, the output in examples/docs has been generated.

Installing and running
one this project
t clone git@github.com:adobe/jsonschema2md.git

stall dependencies
 jsonschema2md && npm install

ow usage information
de cli.js

n task
de cli.js -d examples/schemas -o examples/docs
nerated output for whole folder is written to ./examples/docs
Installing the jsonschema2md Command Line Tools

The JSON Schema Markdown tools also includes a convenient jsonschema2md command line tool that can be installed using:

m link

The command line arguments are identical between the jsonschema2md binary and the cli.js node script.

Using JSON Schema Markdown Tools from npm

You can conveniently use the JSON Schema Markdown Tools from npm. This makes it possible to set up a conversion toolchain for your JSON Schema project that is driven entirely by npm. To do so, first define the dependency by adding this to your "devDependencies" section of package.json

evDependencies": {
"jsonschema2md": "^1.0.2"

Then add the following to the "scripts" section of your package.json and adapt accordingly:

ipts": {
repare": "mkdir -p docs/reference && jsonschema2md -o docs/reference -d schemas/draft-04

If you run npm install before running npm run prepare, npm will install the jsonschema2md in a node_modules/.bin path, even if you did not install the JSON Schema Markdown beforehand.

Tests

Ensure you have all the dependencies installed via npm install, then run:

test

This will run our Jasmine test suite as well as lint the JavaScript according to our style guide (see below).

CI

Continuous integration runs on CircleCI. All pull requests automatically trigger a job that runs the tests by executing the config.yml.

Code Coverage

You can run npm run cover to get a code coverage report, that is, a sense of how much of the project's code is “covered” by the test suite.

Style Guide / Linting

This project uses eslint to enforce JavaScript coding style. To run the linter:

run lint
TODOs
Contributing

Please see Contributing.md for details. Pull requests are welcome.

License/Copyright

Copyright 2017 Adobe Systems Incorporated. All rights reserved. This file is licensed to you under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.