{"id":13670618,"url":"https://github.com/simonwalz/jsonschema2mk","last_synced_at":"2025-04-27T13:32:34.579Z","repository":{"id":43022055,"uuid":"329741736","full_name":"simonwalz/jsonschema2mk","owner":"simonwalz","description":"JSON schema to markdown generator","archived":false,"fork":false,"pushed_at":"2025-04-16T20:37:13.000Z","size":215,"stargazers_count":7,"open_issues_count":2,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-17T04:22:55.791Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simonwalz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-01-14T21:44:11.000Z","updated_at":"2025-04-16T20:37:16.000Z","dependencies_parsed_at":"2024-01-25T21:30:42.832Z","dependency_job_id":"3567fb17-4246-40ca-a101-fb3b66821106","html_url":"https://github.com/simonwalz/jsonschema2mk","commit_stats":{"total_commits":87,"total_committers":3,"mean_commits":29.0,"dds":0.08045977011494254,"last_synced_commit":"5624c7033c3e6a3c818c686fcf1b2a0664b2c5bf"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonwalz%2Fjsonschema2mk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonwalz%2Fjsonschema2mk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonwalz%2Fjsonschema2mk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonwalz%2Fjsonschema2mk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simonwalz","download_url":"https://codeload.github.com/simonwalz/jsonschema2mk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251145652,"owners_count":21543075,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T09:00:46.416Z","updated_at":"2025-04-27T13:32:29.563Z","avatar_url":"https://github.com/simonwalz.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# JSON schema to markdown generator (jsonschema2mk)\n\nThis project allows to generate documentation from [JSON Schema](https://json-schema.org) spezifications.\n\nExamples:\n\n  * [Configuration osiota ArtNet app](test/010-example-artnet.md) ([see project](https://github.com/osiota/osiota-app-artnet/blob/master/README.md))\n  * [Configuration osiota Modbus app](test/011-example-modbus.md) ([see project](https://github.com/osiota/osiota-app-modbus/blob/master/README.md))\n\n### Supported JSON schema features\n\n  * Basic attributes:\n    * title, description, default, examples\n    * enum, const\n    * deprecated\n    * $ref is same file, $id, $anchor\n  * number, integer\n    * minimum, maximum, exclusiveMinimum, exclusiveMaximum\n    * multipleOf\n  * string\n    * minLength, maxLength\n    * format\n    * pattern\n    * contentMediaType\n    * contentEncoding\n  * boolean\n  * null\n  * object\n    * properties\n    * additionalProperties (as boolean and as object)\n    * patternProperties\n    * required\n    * minProperties, maxProperties\n    * propertyNames.pattern\n  * array\n    * items (schema)\n    * items (array of schemas)\n    * minItems, maxItems\n    * uniqueItems\n    * contains\n    * minContains, maxContains\n  * allOf, oneOf, anyOf, not (not for object properties)\n  * if, then, else\n  * multiple types (`type: [\"string\", \"null\"]`)\n  * object: dependencies (Properties and Schema)\n\n\n### Missing JSON schema features\n\n  * $ref remotely or in other files\n\n\n## Install \u0026 Usage\n\n```sh\nnpm install jsonschema2mk\n```\n\nGenerate DOC.md:\n\n```sh\nnpx jsonschema2mk --schema schema.json \u003eDOC.md\n```\n\nOverwrite some partials with own partials:\n\n```sh\nnpx jsonschema2mk --schema schema.json --partials dir/ \u003eDOC.md\n```\n\n## Add to your project\n\nAdd to package.json:\n\n```json\n{\n\t\"scripts\": {\n\t\t\"doc\": \"jsonschema2mk --schema schema.json \u003eDOC.md\"\n\t}\n}\n```\n\nand run `npm run doc`.\n\n## Command line options\n\nUsage:\n\n```sh\nnpx jsonschema2mk [\u003coptions\u003e] \u003eDOC.md\n```\n\n\u003ctable\u003e\n  \u003cthead\u003e\n  \u003ctr\u003e\n    \u003cth\u003eOption\u003c/th\u003e\n    \u003cth\u003eDescription\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003ccode\u003e--schema schema.json\u003c/code\u003e\u003c/td\u003e\n    \u003ctd\u003eSpecify a JSON Schema file to convert.\u003cbr/\u003eDefault: \u003ccode\u003eschema.json\u003c/code\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003ccode\u003e--partials dir\u003c/code\u003e\u003c/td\u003e\n    \u003ctd\u003eOverwrite partials from dir. You can overwrite every partial (see directory partials/) or define own ones. This option can be used multiple times.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003ccode\u003e--extension ext\u003c/code\u003e\u003c/td\u003e\n    \u003ctd\u003eLoad feature extension. See \u003ca href=\"#internal-feature-extensions-option-extension\"\u003esection\u003c/a\u003e. This option can be used multiple times.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003ccode\u003e--plugin p\u003c/code\u003e\u003c/td\u003e\n    \u003ctd\u003eLoad plugin. See \u003ca href=\"#load-external-plugins-option-plugin\"\u003esection\u003c/a\u003e. This option can be used multiple times.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003ccode\u003e--level number\u003c/code\u003e\u003c/td\u003e\n    \u003ctd\u003eInitial Markdown heading level. Defaul is Zero.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\n### Internal Feature Extensions (Option extension)\n\nYou can load feature extensions if needed.\n\nImplemented Extensions:\n\n  * `table-format-2`: Show tables with the columns *name*, *type*, *title*, *description* and *required*. Default is to display a combined *name* and *title* column. See [example output](test/010-example-artnet-table2.md).\n  * `yaml-examples`: Show examples in YAML format.\n  * `front-matter`: Add a [front matter block](https://jekyllrb.com/docs/front-matter/).\u003cbr/\u003eYou can define the front-matter with `--fm.para1 value1 --fm.para2 value2`\n\nExample Calls:\n\n```sh\n# table-format 2\nnpx jsonschema2mk --schema schema.json \\\n\t--extension table-format-2 \u003eDOC.md\n# yaml-examples\nnpx jsonschema2mk --schema schema.json \\\n\t--extension yaml-examples \u003eDOC2.md\n# yaml-examples and front matter\nnpx jsonschema2mk --schema schema.json \\\n\t--extension yaml-examples \\\n\t--extension front-matter --fm.parent Reference --fm.nav_order 1 \u003eDOC3.md\n```\n\n\n### Load External Plugins (Option plugin)\n\nIf partial overwriting is not enogh (see above), you can load plugins.\n\nIn the plugin, you can load your own partials. It has the same API as extensions.\n\nThe Arguments Vector is available via `data.argv`.\n\nExample:\n\n```js\nmodule.exports = function(data, jsonschema2mk) {\n\tjsonschema2mk.load_partial_dir(__dirname + \"/partials\");\n};\n```\n\n\nCall it via:\n\n```sh\nnpx jsonschema2mk --schema schema.json --plugin my-plugin.js \u003eDOC.md\n```\n\n\n\n## Usage as Libray\n\nYou can integration this code as Library. See `cli.js` for an example.\n\n## Examples\n\nThe README.md files of all applications of the [osiota project](https://github.com/osiota/) are generated with the help of this program. See the adaption script in the [osiota-dev repository](https://github.com/osiota/osiota-dev/blob/master/doc-jsonschema) as well.\n\nExamples:\n\n  * [osiota-app-modbus](https://github.com/osiota/osiota-app-modbus)\n  * [osiota-app-onewire](https://github.com/osiota/osiota-app-onewire)\n\n\n## License\n\nThis software is released under the MIT license.\n\nPlease note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonwalz%2Fjsonschema2mk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonwalz%2Fjsonschema2mk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonwalz%2Fjsonschema2mk/lists"}