All Projects → adobe → Jsonschema2md

adobe / Jsonschema2md

Licence: apache-2.0
Convert Complex JSON Schemas into Markdown Documentation

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Jsonschema2md

Markdown Nice
支持主题设计的 Markdown 编辑器,让排版变 Nice
Stars: ✭ 3,291 (+1062.9%)
Mutual labels:  markdown
Logicandcodinggames
[Resource List] Programming-related games I'd like to try
Stars: ✭ 277 (-2.12%)
Mutual labels:  markdown
Game Programming Patterns
Source repo for the book
Stars: ✭ 3,096 (+993.99%)
Mutual labels:  markdown
Tty Markdown
Convert a markdown document or text into a terminal friendly output.
Stars: ✭ 275 (-2.83%)
Mutual labels:  markdown
Markdownediting
Powerful Markdown package for Sublime Text with better syntax understanding and good color schemes.
Stars: ✭ 2,976 (+951.59%)
Mutual labels:  markdown
Gitit Bigger
Gitit Bigger: 超棒的个人、团队Wiki/文档方案(Git、Markdown、Bootstrap、Ace、Docker)
Stars: ✭ 279 (-1.41%)
Mutual labels:  markdown
Mak
A universal notepad. (WIP)
Stars: ✭ 270 (-4.59%)
Mutual labels:  markdown
Allmark
A cross-platform markdown web server
Stars: ✭ 284 (+0.35%)
Mutual labels:  markdown
Flow Netbeans Markdown
Markdown file support for the NetBeans IDE
Stars: ✭ 276 (-2.47%)
Mutual labels:  markdown
Djv
Dynamic JSON Schema Validator - Supports draft-04/06
Stars: ✭ 281 (-0.71%)
Mutual labels:  json-schema
Format Readme
Формат файла README
Stars: ✭ 270 (-4.59%)
Mutual labels:  markdown
Boostnote Markdown Cheatsheet
📋 📘 The missing one page markdown feature cheat sheet for Boostnote
Stars: ✭ 276 (-2.47%)
Mutual labels:  markdown
Markdowntoc
SublimeText3 plugin which generate a table of contents (TOC) in a markdown document.
Stars: ✭ 278 (-1.77%)
Mutual labels:  markdown
Pydoc Markdown
Create Python API documentation in Markdown format.
Stars: ✭ 273 (-3.53%)
Mutual labels:  markdown
Text
📑 Collaborative document editing using Markdown
Stars: ✭ 282 (-0.35%)
Mutual labels:  markdown
Pdf To Markdown
A PDF to Markdown converter
Stars: ✭ 270 (-4.59%)
Mutual labels:  markdown
Apostrophe
Mirror of
Stars: ✭ 272 (-3.89%)
Mutual labels:  markdown
Codeexpander
A cross-platform cloud synchronization development tool for developers that includes input enhancement, code snippet management, and Markdown. (专为开发者开发的一个集输入增强、代码片段管理(支持 Markdown)为一体跨平台云同步的开发工具。)
Stars: ✭ 285 (+0.71%)
Mutual labels:  markdown
Sq
swiss-army knife for data
Stars: ✭ 275 (-2.83%)
Mutual labels:  markdown
Markdown Pp
Preprocessor for Markdown files to generate a table of contents and other documentation needs
Stars: ✭ 280 (-1.06%)
Mutual labels:  markdown

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.

JSON Schema Support

jsonschema2md is developed against JSON Schema 2019-09, but not the full vocabulary is supported. Please check the detailed list of JSON Schema keywords supported by jsonschema2md. This list is updated by our tests.

Requirements

  • npm version 3.10.8 or up
  • node v10 or up

Example Output

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

Installing and running

$ npm install -g @adobe/jsonschema2md

# show usage information
$ jsonschema2md

# run task
$ jsonschema2md -d examples/schemas -o examples/docs
# generated output for whole folder is written to ./examples/docs

Internationalization

The generated documentation can be internationalized. Select the language you want to use for the output using the -l parameter.

Supported languages are:

  • English
  • German

If you want to provide a translation of your own, please use GitLocalize

Display custom attributes in the property description

jsonschema2md displays only the attributes of an property which are defined by the JSON Schema standard. If you want to display additional attributes in the property description you could provide a comma separated list with your custom attributes.

$ jsonschema2md -d examples/schemas -o examples/docs -p version,test

Disable header template

In some cases you do not need a header because it does not provide any useful information. With the --header (or -h) parameter you can disable the inclusion of headers.

# run against JSON Schema Draft 06
$ jsonschema2md -d examples/schemas -o examples/docs -v 06 -h false

Examples as YAML

If you are using JSON Schema to validate YAML documents, for instance configuration files, you might wish for examples to be formatted as YAML, not JSON. Using the command line option -f yaml or --example-format yaml achieves this goal.

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

  "devDependencies": {
    "@adobe/jsonschema2md": "^4.0.0"
  }

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

"scripts": {
  "prepare": "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 @adobe/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:

npm 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

npm run test will generate a code coverage report at the end of the test run. Anything below 100% coverage counts as a test failure.

Style Guide / Linting

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

npm run lint

TODOs

Add support for missing keywords

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].