vocab-docs

1.1.0 • Public • Published

vocab-docs

returns markdown documentation about a vocab.

supports

  • [~] id

  • properties

  • [~] description

  • additionalProperties

  • patternProperties

  • allOf

  • anyOf

  • oneOf

  • not

  • definitions

  • items schema

  • items array of schemas

  • additionalItems

  • [~] context

  • prefixes

  • [~] value

pull requests welcome!

install

with npm, do:

npm i --save vocab-docs

example

var vocabDocs = require('vocab-docs');

var personVocab = {
  id: "Person",
  description: "A real or imaginary person",
  prefixes: {
    "": "http://schema.org/",
    "foaf": "http://xmlns.com/foaf/0.1/",
  },
  context: "foaf:Person",
  properties: {
    name: {
      description: "Preferred full name",
      context: "name",
      type: "string",
    },
    handle: {
      description: "Commonly-used short name",
      context: "foaf:nick",
      type: "string",
    },
  },
};

var personDocs = vocabDocs(personVocab);

console.log(personDocs);
//# Person
//
//A real or imaginary person
//
//## prefixes
//
//|   prefix  |  namespace  |
//|-----------|-------------|
//| "" | http://schema.org/ |
//| "foaf" | http://xmlns.com/foaf/0.1/ |
//
//
//## properties
//
//### name
//
//- description: Preferred full name
//- context: name
//- type: string
//
//### handle
//
//- description: Commonly-used short name
//- context: foaf:nick
//- type: string
//
//
//

license

AGPLv3

Package Sidebar

Install

npm i vocab-docs

Weekly Downloads

3

Version

1.1.0

License

AGPLv3

Last publish

Collaborators

  • ahdinosaur