jsonschema2md icon indicating copy to clipboard operation
jsonschema2md copied to clipboard

Allow output to be configurable

Open Relequestual opened this issue 6 years ago • 2 comments

Looking at things like the header section I can see how it would be useful once it's clear what each heading means (It took me a few minutes to work out how "Abstract" and "Extensible" are defined for example).

It could be useful for those looking for simple output, to allow things like the header to be configurabally turned off.

I can see how a number of other elements may want to be configurable, so I'd suggest something like a jsonschema2md.rc file.

{
  "config": {
    "sections": {
      "header": false
    }
  },
  "meta": {
    "authors": [
      {
        "name": "Mr Test"
      }
    ]
  }
}

or for alternate header layout, assuming the current layout is "table"...

{
  "config": {
    "sections": {
      "header": {
        "layout": "list"
      }
    }
  }
}

Does this sound reasonable?

If so, I'll begin work on making this happen.

Relequestual avatar Apr 01 '19 09:04 Relequestual

Yes, that sounds reasonable. I'd probably use something like https://www.npmjs.com/package/pkg-conf to enable configurations in package.json.

trieloff avatar Apr 15 '19 08:04 trieloff

I can see a use case for people wanting to use jsonschema2md without having their main code be javascript. I don't know if using that package and configuring using package.json prohibits that.

It can also see a later use case of having specific config changes in folders, hence suggesting having your own .rc type file.

However in the absense of known or documented use cases that require such today, I'm happy to take the pragmatic approach.

Relequestual avatar Apr 15 '19 08:04 Relequestual