purifycss-webpack icon indicating copy to clipboard operation
purifycss-webpack copied to clipboard

Push option descriptions to JSON schema

Open bebraw opened this issue 8 years ago • 3 comments

There should be a mechanism that would write the readme table based on the fields and their descriptions. This is likely something that should be tackled in webpack-defaults first.

bebraw avatar May 04 '17 13:05 bebraw

I can take a look at this soon, we could use the description(s) from options.json (Validation Schema) and add a new var ${options.option.desc} to the readme task in webpack-defaults

dist/options.json

{
   "type": "object",
   "properties": {
      "option": {
        "type": "boolean",
        "default": false,
        "description": "lorem ..."
     }
   },
  "additionalProperties": false
}

README#Options

|Name|Type|Default|Description|
|:----:|:----:|:------:|:-----------|
|${options.option}|${options.option.type}|options.option.default|${options.option.description}|

michael-ciniawsky avatar May 04 '17 17:05 michael-ciniawsky

The default in schema-utilsmight be tricky since the respective option must be always 'set' then, but I didn't invest any time in checking out possible options eventually avoid this yet tbh 😛

michael-ciniawsky avatar May 04 '17 17:05 michael-ciniawsky

@michael-ciniawsky Yeah, it's the same problem for each loader/plugin. We should solve this properly once, push the solution to defaults, and replicate.

bebraw avatar May 04 '17 17:05 bebraw