Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marcusolsson/json-schema-docs
A simple JSON Schema to Markdown generator.
https://github.com/marcusolsson/json-schema-docs
Last synced: 1 day ago
JSON representation
A simple JSON Schema to Markdown generator.
- Host: GitHub
- URL: https://github.com/marcusolsson/json-schema-docs
- Owner: marcusolsson
- License: apache-2.0
- Created: 2020-05-13T15:23:08.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-03-08T22:26:21.000Z (over 2 years ago)
- Last Synced: 2024-06-20T06:27:34.777Z (5 months ago)
- Language: Go
- Size: 51.8 KB
- Stars: 14
- Watchers: 78
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# json-schema-docs
[![License](https://img.shields.io/github/license/grafana/json-schema-docs)](LICENSE)
[![Go Report Card](https://goreportcard.com/badge/github.com/grafana/json-schema-docs)](https://goreportcard.com/report/github.com/grafana/json-schema-docs)A simple JSON Schema to Markdown generator.
This generator doesn't attempt to support the full JSON Schema specification. Instead, it's designed with the rationale that most people are only using a subset of the spec.
## Install
```bash
go install github.com/marcusolsson/json-schema-docs
```## Run
```bash
json-schema-docs -schema ./user.schema.json > user.md
```To use a template when generating the Markdown:
```bash
json-schema-docs -schema ./user.schema.json -template user.md.tpl > user.md
````template` is the path to a file containing a Go template, such as this one:
```bash
+++
title = "{{ .Title }}"
description = "{{ .Description }}"
+++# API reference
This is the reference documentation for an API.
{{ .Markdown 2 }}
```The argument to `.Markdown` is the heading level you want the docs to start at.
## License
[Apache 2.0 License](LICENSE)