From 7a3387d902af7d5895ae7bd8fc6d1d55dd88fab7 Mon Sep 17 00:00:00 2001 From: Klas Jersevi Date: Fri, 12 Sep 2025 12:46:26 +0200 Subject: [PATCH] Hide redundant public column when using private details --- .../to-markdown/fixtures/details-private/EXPECTED.md | 12 ++++++------ .../to-markdown/fixtures/details-private/README.md | 12 ++++++------ packages/to-markdown/index.js | 4 ++-- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/to-markdown/fixtures/details-private/EXPECTED.md b/packages/to-markdown/fixtures/details-private/EXPECTED.md index 7207f86a..1412c770 100644 --- a/packages/to-markdown/fixtures/details-private/EXPECTED.md +++ b/packages/to-markdown/fixtures/details-private/EXPECTED.md @@ -4,15 +4,15 @@ ### Fields -| Name | Privacy | Type | Default | Description | Inherited From | -| ----- | ------- | ---------- | ---------- | ----------- | -------------- | -| `pub` | public | `'public'` | `'public'` | | | +| Name | Type | Default | Description | Inherited From | +| ----- | ---------- | ---------- | ----------- | -------------- | +| `pub` | `'public'` | `'public'` | | | ### Methods -| Name | Privacy | Description | Parameters | Return | Inherited From | -| -------------- | ------- | ----------- | ---------- | ------ | -------------- | -| `publicMethod` | public | | | `void` | | +| Name | Description | Parameters | Return | Inherited From | +| -------------- | ----------- | ---------- | ------ | -------------- | +| `publicMethod` | | | `void` | |
Private API diff --git a/packages/to-markdown/fixtures/details-private/README.md b/packages/to-markdown/fixtures/details-private/README.md index 7207f86a..1412c770 100644 --- a/packages/to-markdown/fixtures/details-private/README.md +++ b/packages/to-markdown/fixtures/details-private/README.md @@ -4,15 +4,15 @@ ### Fields -| Name | Privacy | Type | Default | Description | Inherited From | -| ----- | ------- | ---------- | ---------- | ----------- | -------------- | -| `pub` | public | `'public'` | `'public'` | | | +| Name | Type | Default | Description | Inherited From | +| ----- | ---------- | ---------- | ----------- | -------------- | +| `pub` | `'public'` | `'public'` | | | ### Methods -| Name | Privacy | Description | Parameters | Return | Inherited From | -| -------------- | ------- | ----------- | ---------- | ------ | -------------- | -| `publicMethod` | public | | | `void` | | +| Name | Description | Parameters | Return | Inherited From | +| -------------- | ----------- | ---------- | ------ | -------------- | +| `publicMethod` | | | `void` | |
Private API diff --git a/packages/to-markdown/index.js b/packages/to-markdown/index.js index 33522929..babc2134 100644 --- a/packages/to-markdown/index.js +++ b/packages/to-markdown/index.js @@ -198,8 +198,8 @@ function makeModuleDoc(mod, options) { ...kind === 'mixin' && optionEnabled(omittedSections.mixins) ? makeTable('Parameters', [CELLS.NAME, CELLS.TYPE, CELLS.DEFAULT, 'description'], decl.parameters) : [], ...optionEnabled(omittedSections.staticFields) ? makeTable('Static Fields', [CELLS.NAME, 'privacy', CELLS.TYPE, CELLS.DEFAULT, 'description', CELLS.INHERITANCE], staticFieldsDecl) : [], ...optionEnabled(omittedSections.staticMethods) ? makeTable('Static Methods', [CELLS.NAME, 'privacy', 'description', CELLS.PARAMETERS, CELLS.RETURN, CELLS.INHERITANCE], staticMethodsDecl) : [], - ...optionEnabled(omittedSections.fields) ? makeTable('Fields', [CELLS.NAME, 'privacy', CELLS.TYPE, CELLS.DEFAULT, 'description', CELLS.INHERITANCE], fieldsDecl) : [], - ...optionEnabled(omittedSections.methods) ? makeTable('Methods', [CELLS.NAME, 'privacy', 'description', CELLS.PARAMETERS, CELLS.RETURN, CELLS.INHERITANCE], methodsDecl) : [], + ...optionEnabled(omittedSections.fields) ? makeTable('Fields', [CELLS.NAME, options?.private === 'details' ? null : 'privacy', CELLS.TYPE, CELLS.DEFAULT, 'description', CELLS.INHERITANCE].filter(identity), fieldsDecl) : [], + ...optionEnabled(omittedSections.methods) ? makeTable('Methods', [CELLS.NAME, options?.private === 'details' ? null : 'privacy', 'description', CELLS.PARAMETERS, CELLS.RETURN, CELLS.INHERITANCE].filter(identity), methodsDecl) : [], ...optionEnabled(omittedSections.events) ? makeTable('Events', [CELLS.NAME, CELLS.TYPE, 'description', CELLS.INHERITANCE], decl.events) : [], ...optionEnabled(omittedSections.attributes) ? makeTable('Attributes', [CELLS.NAME, CELLS.ATTR_FIELD, CELLS.INHERITANCE], decl.attributes) : [], ...optionEnabled(omittedSections.cssProperties) ? makeTable('CSS Properties', [CELLS.NAME, CELLS.DEFAULT, 'description'], decl.cssProperties) : [],