open-wc / custom-elements-manifest

Custom Elements Manifest is a file format that describes custom elements in your project.
https://custom-elements-manifest.open-wc.org/
227 stars 37 forks source link

feat: add section output customization options #139

Closed michaelwarren1106 closed 2 years ago

michaelwarren1106 commented 2 years ago

This PR adds boolean flag options to the existing output customization options that controls whether or not sections of the final md output get displayed. Each section/table type is configurable along with a filter for class names to exclude certain classes by regex, and a setting for the main (h1) heading. The new options object is:

export interface Options {
  private?: 'details'|'hidden'|'all';
  headingOffset?: number;
  mainHeading: boolean;
  classNameFilter: string | (() => string);
  superClass: boolean;
  fields: boolean;
  methods: boolean;
  staticFields: boolean;
  staticMethods: boolean;
  slots: boolean;
  events: boolean;
  attributes: boolean;
  cssProperties: boolean;
  cssParts: boolean;
  mixins: boolean;
  variables: boolean;
  functions: boolean;
  exports: boolean;
}
netlify[bot] commented 2 years ago

✔️ Deploy Preview for custom-elements-manifest-analyzer ready!

🔨 Explore the source changes: 9a8929f0b33e019547d0a3de393d323dafc68a84

🔍 Inspect the deploy log: https://app.netlify.com/sites/custom-elements-manifest-analyzer/deploys/6176bc817748860007e4bd6d

😎 Browse the preview: https://deploy-preview-139--custom-elements-manifest-analyzer.netlify.app

michaelwarren1106 commented 2 years ago

@bennypowers I pushed up the config changes and documentation updates. I ended up keeping the classNameFilter because at the end of the day, i dont think we can really predict all of the use cases/permutations of manifest/json => markdown conversion. Its just a tiny config option and function, so there's not a lot of bloat, but i think could provide some value for folks like me that are trying to use the generated markdown in user-facing docs as directly as possible.

I have no problems removing it if folks are really against it, but i have a feeling i'd be using it myself if merged.