Skip to content

Commit d084439

Browse files
authored
Merge pull request #87 from open-wc/feat/custom-kinds
customize export kinds in markdown
2 parents 5b418b6 + 5a96a12 commit d084439

File tree

37 files changed

+679
-384
lines changed

37 files changed

+679
-384
lines changed

packages/to-markdown/fixtures/css-parts/EXPECTED.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44

55
### CSS Parts
66

7-
| Name | Description |
8-
| ---- | --------------- |
9-
| bar | the bar element |
7+
| Name | Description |
8+
| ----- | --------------- |
9+
| `bar` | the bar element |
1010

1111
<hr/>
1212

1313
## Exports
1414

15-
| Kind | Name | Declaration | Module | Package |
16-
| ------------------------- | ---------- | ----------- | -------------------------------------- | ------- |
17-
| custom-element-definition | my-element | MyElement | ./fixtures/-TEST/package/my-element.js | |
15+
| Kind | Name | Declaration | Module | Package |
16+
| --------------------------- | ------------ | ----------- | -------------------------------------- | ------- |
17+
| `custom-element-definition` | `my-element` | MyElement | ./fixtures/-TEST/package/my-element.js | |

packages/to-markdown/fixtures/css-parts/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44

55
### CSS Parts
66

7-
| Name | Description |
8-
| ---- | --------------- |
9-
| bar | the bar element |
7+
| Name | Description |
8+
| ----- | --------------- |
9+
| `bar` | the bar element |
1010

1111
<hr/>
1212

1313
## Exports
1414

15-
| Kind | Name | Declaration | Module | Package |
16-
| ------------------------- | ---------- | ----------- | -------------------------------------- | ------- |
17-
| custom-element-definition | my-element | MyElement | ./fixtures/-TEST/package/my-element.js | |
15+
| Kind | Name | Declaration | Module | Package |
16+
| --------------------------- | ------------ | ----------- | -------------------------------------- | ------- |
17+
| `custom-element-definition` | `my-element` | MyElement | ./fixtures/-TEST/package/my-element.js | |

packages/to-markdown/fixtures/details-private/EXPECTED.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,38 +4,38 @@
44

55
### Fields
66

7-
| Name | Privacy | Type | Default | Description | Inherited From |
8-
| ---- | ------- | ---------- | ---------- | ----------- | -------------- |
9-
| pub | public | `'public'` | `'public'` | | |
7+
| Name | Privacy | Type | Default | Description | Inherited From |
8+
| ----- | ------- | ---------- | ---------- | ----------- | -------------- |
9+
| `pub` | public | `'public'` | `'public'` | | |
1010

1111
### Methods
1212

13-
| Name | Privacy | Description | Parameters | Return | Inherited From |
14-
| ------------ | ------- | ----------- | ---------- | ------ | -------------- |
15-
| publicMethod | public | | | `void` | |
13+
| Name | Privacy | Description | Parameters | Return | Inherited From |
14+
| -------------- | ------- | ----------- | ---------- | ------ | -------------- |
15+
| `publicMethod` | public | | | `void` | |
1616

1717
<details><summary>Private API</summary>
1818

1919
### Fields
2020

21-
| Name | Privacy | Type | Default | Description | Inherited From |
22-
| ---- | --------- | ------------- | ------------- | ----------- | -------------- |
23-
| prot | protected | `'protected'` | `'protected'` | | |
24-
| priv | private | `'private'` | `'private'` | | |
21+
| Name | Privacy | Type | Default | Description | Inherited From |
22+
| ------ | --------- | ------------- | ------------- | ----------- | -------------- |
23+
| `prot` | protected | `'protected'` | `'protected'` | | |
24+
| `priv` | private | `'private'` | `'private'` | | |
2525

2626
### Methods
2727

28-
| Name | Privacy | Description | Parameters | Return | Inherited From |
29-
| --------------- | --------- | ----------- | ---------- | ------ | -------------- |
30-
| protectedMethod | protected | | | `void` | |
31-
| privateMethod | private | | | `void` | |
28+
| Name | Privacy | Description | Parameters | Return | Inherited From |
29+
| ----------------- | --------- | ----------- | ---------- | ------ | -------------- |
30+
| `protectedMethod` | protected | | | `void` | |
31+
| `privateMethod` | private | | | `void` | |
3232

3333
</details>
3434

3535
<hr/>
3636

3737
## Exports
3838

39-
| Kind | Name | Declaration | Module | Package |
40-
| ------------------------- | ---------- | ----------- | --------------- | ------- |
41-
| custom-element-definition | my-element | MyElement | ./my-element.js | |
39+
| Kind | Name | Declaration | Module | Package |
40+
| --------------------------- | ------------ | ----------- | --------------- | ------- |
41+
| `custom-element-definition` | `my-element` | MyElement | ./my-element.js | |

packages/to-markdown/fixtures/details-private/README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,38 +4,38 @@
44

55
### Fields
66

7-
| Name | Privacy | Type | Default | Description | Inherited From |
8-
| ---- | ------- | ---------- | ---------- | ----------- | -------------- |
9-
| pub | public | `'public'` | `'public'` | | |
7+
| Name | Privacy | Type | Default | Description | Inherited From |
8+
| ----- | ------- | ---------- | ---------- | ----------- | -------------- |
9+
| `pub` | public | `'public'` | `'public'` | | |
1010

1111
### Methods
1212

13-
| Name | Privacy | Description | Parameters | Return | Inherited From |
14-
| ------------ | ------- | ----------- | ---------- | ------ | -------------- |
15-
| publicMethod | public | | | `void` | |
13+
| Name | Privacy | Description | Parameters | Return | Inherited From |
14+
| -------------- | ------- | ----------- | ---------- | ------ | -------------- |
15+
| `publicMethod` | public | | | `void` | |
1616

1717
<details><summary>Private API</summary>
1818

1919
### Fields
2020

21-
| Name | Privacy | Type | Default | Description | Inherited From |
22-
| ---- | --------- | ------------- | ------------- | ----------- | -------------- |
23-
| prot | protected | `'protected'` | `'protected'` | | |
24-
| priv | private | `'private'` | `'private'` | | |
21+
| Name | Privacy | Type | Default | Description | Inherited From |
22+
| ------ | --------- | ------------- | ------------- | ----------- | -------------- |
23+
| `prot` | protected | `'protected'` | `'protected'` | | |
24+
| `priv` | private | `'private'` | `'private'` | | |
2525

2626
### Methods
2727

28-
| Name | Privacy | Description | Parameters | Return | Inherited From |
29-
| --------------- | --------- | ----------- | ---------- | ------ | -------------- |
30-
| protectedMethod | protected | | | `void` | |
31-
| privateMethod | private | | | `void` | |
28+
| Name | Privacy | Description | Parameters | Return | Inherited From |
29+
| ----------------- | --------- | ----------- | ---------- | ------ | -------------- |
30+
| `protectedMethod` | protected | | | `void` | |
31+
| `privateMethod` | private | | | `void` | |
3232

3333
</details>
3434

3535
<hr/>
3636

3737
## Exports
3838

39-
| Kind | Name | Declaration | Module | Package |
40-
| ------------------------- | ---------- | ----------- | --------------- | ------- |
41-
| custom-element-definition | my-element | MyElement | ./my-element.js | |
39+
| Kind | Name | Declaration | Module | Package |
40+
| --------------------------- | ------------ | ----------- | --------------- | ------- |
41+
| `custom-element-definition` | `my-element` | MyElement | ./my-element.js | |
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# `custom-kinds.js`:
2+
3+
## class: `MyElement`, `my-element`
4+
5+
<hr/>
6+
7+
## Variables
8+
9+
| Name | Description | Type |
10+
| ---- | ----------- | --------- |
11+
| `js` | | `boolean` |
12+
13+
<hr/>
14+
15+
## Exports
16+
17+
| Kind | Name | Declaration | Module | Package |
18+
| ----------------------------------------------------------------------------------------------------------------------------- | ----------- | ----------- | -------------------------------------- | ------- |
19+
| ![custom-element-definition](https://raw.githubusercontent.com/webcomponents/webcomponents.org/master/client/assets/logo.svg) | `MyElement` | MyElement | ./fixtures/-TEST/package/my-element.js | |
20+
| JavaScript | `js` | js | ./fixtures/-TEST/package/my-element.js | |
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# `custom-kinds.js`:
2+
3+
## class: `MyElement`, `my-element`
4+
5+
<hr/>
6+
7+
## Variables
8+
9+
| Name | Description | Type |
10+
| ---- | ----------- | --------- |
11+
| `js` | | `boolean` |
12+
13+
<hr/>
14+
15+
## Exports
16+
17+
| Kind | Name | Declaration | Module | Package |
18+
| ----------------------------------------------------------------------------------------------------------------------------- | ----------- | ----------- | -------------------------------------- | ------- |
19+
| ![custom-element-definition](https://raw.githubusercontent.com/webcomponents/webcomponents.org/master/client/assets/logo.svg) | `MyElement` | MyElement | ./fixtures/-TEST/package/my-element.js | |
20+
| JavaScript | `js` | js | ./fixtures/-TEST/package/my-element.js | |
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"schemaVersion": "1.0.0",
3+
"readme": "",
4+
"modules": [
5+
{
6+
"kind": "javascript-module",
7+
"path": "custom-kinds.js",
8+
"declarations": [
9+
{
10+
"kind": "class",
11+
"name": "MyElement",
12+
"tagName": "my-element"
13+
},
14+
{
15+
"kind": "variable",
16+
"name": "js",
17+
"type": {
18+
"text": "boolean"
19+
}
20+
}
21+
],
22+
"exports": [
23+
{
24+
"kind": "custom-element-definition",
25+
"name": "MyElement",
26+
"declaration": {
27+
"name": "MyElement",
28+
"module": "./fixtures/-TEST/package/my-element.js"
29+
}
30+
},
31+
{
32+
"kind": "js",
33+
"name": "js",
34+
"declaration": {
35+
"name": "js",
36+
"module": "./fixtures/-TEST/package/my-element.js"
37+
}
38+
}
39+
]
40+
}
41+
]
42+
}

packages/to-markdown/fixtures/heading-offset-2/EXPECTED.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,41 @@
44

55
##### Fields
66

7-
| Name | Privacy | Type | Default | Description | Inherited From |
8-
| ----- | ------- | ---- | ------- | ----------- | -------------- |
9-
| prop1 | public | | | | |
7+
| Name | Privacy | Type | Default | Description | Inherited From |
8+
| ------- | ------- | ---- | ------- | ----------- | -------------- |
9+
| `prop1` | public | | | | |
1010

1111
##### Methods
1212

13-
| Name | Privacy | Description | Parameters | Return | Inherited From |
14-
| -------------- | ------- | ----------------------------------- | --------------------- | ------ | -------------- |
15-
| instanceMethod | public | Some description of the method here | `e: Event, a: string` | | |
13+
| Name | Privacy | Description | Parameters | Return | Inherited From |
14+
| ---------------- | ------- | ----------------------------------- | --------------------- | ------ | -------------- |
15+
| `instanceMethod` | public | Some description of the method here | `e: Event, a: string` | | |
1616

1717
##### Events
1818

19-
| Name | Type | Description | Inherited From |
20-
| -------- | ------- | ----------- | -------------- |
21-
| my-event | `Event` | | |
19+
| Name | Type | Description | Inherited From |
20+
| ---------- | ------- | ----------- | -------------- |
21+
| `my-event` | `Event` | | |
2222

2323
##### CSS Properties
2424

25-
| Name | Default | Description |
26-
| ------------------ | --------------- | ------------------------- |
27-
| --background-color | `rebeccapurple` | Controls the color of bar |
25+
| Name | Default | Description |
26+
| -------------------- | --------------- | ------------------------- |
27+
| `--background-color` | `rebeccapurple` | Controls the color of bar |
2828

2929
<hr/>
3030

3131
#### Functions
3232

33-
| Name | Description | Parameters | Return |
34-
| -------------- | ------------------------- | ----------------------- | --------- |
35-
| functionExport | This is a function export | `a: string, b: boolean` | `boolean` |
33+
| Name | Description | Parameters | Return |
34+
| ---------------- | ------------------------- | ----------------------- | --------- |
35+
| `functionExport` | This is a function export | `a: string, b: boolean` | `boolean` |
3636

3737
<hr/>
3838

3939
#### Exports
4040

41-
| Kind | Name | Declaration | Module | Package |
42-
| ------------------------- | -------------- | -------------- | --------------- | ------- |
43-
| custom-element-definition | my-element | MyElement | ./my-element.js | |
44-
| js | functionExport | functionExport | ./my-element.js | |
41+
| Kind | Name | Declaration | Module | Package |
42+
| --------------------------- | ---------------- | -------------- | --------------- | ------- |
43+
| `custom-element-definition` | `my-element` | MyElement | ./my-element.js | |
44+
| `js` | `functionExport` | functionExport | ./my-element.js | |

packages/to-markdown/fixtures/heading-offset-2/README.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,41 @@
44

55
##### Fields
66

7-
| Name | Privacy | Type | Default | Description | Inherited From |
8-
| ----- | ------- | ---- | ------- | ----------- | -------------- |
9-
| prop1 | public | | | | |
7+
| Name | Privacy | Type | Default | Description | Inherited From |
8+
| ------- | ------- | ---- | ------- | ----------- | -------------- |
9+
| `prop1` | public | | | | |
1010

1111
##### Methods
1212

13-
| Name | Privacy | Description | Parameters | Return | Inherited From |
14-
| -------------- | ------- | ----------------------------------- | --------------------- | ------ | -------------- |
15-
| instanceMethod | public | Some description of the method here | `e: Event, a: string` | | |
13+
| Name | Privacy | Description | Parameters | Return | Inherited From |
14+
| ---------------- | ------- | ----------------------------------- | --------------------- | ------ | -------------- |
15+
| `instanceMethod` | public | Some description of the method here | `e: Event, a: string` | | |
1616

1717
##### Events
1818

19-
| Name | Type | Description | Inherited From |
20-
| -------- | ------- | ----------- | -------------- |
21-
| my-event | `Event` | | |
19+
| Name | Type | Description | Inherited From |
20+
| ---------- | ------- | ----------- | -------------- |
21+
| `my-event` | `Event` | | |
2222

2323
##### CSS Properties
2424

25-
| Name | Default | Description |
26-
| ------------------ | --------------- | ------------------------- |
27-
| --background-color | `rebeccapurple` | Controls the color of bar |
25+
| Name | Default | Description |
26+
| -------------------- | --------------- | ------------------------- |
27+
| `--background-color` | `rebeccapurple` | Controls the color of bar |
2828

2929
<hr/>
3030

3131
#### Functions
3232

33-
| Name | Description | Parameters | Return |
34-
| -------------- | ------------------------- | ----------------------- | --------- |
35-
| functionExport | This is a function export | `a: string, b: boolean` | `boolean` |
33+
| Name | Description | Parameters | Return |
34+
| ---------------- | ------------------------- | ----------------------- | --------- |
35+
| `functionExport` | This is a function export | `a: string, b: boolean` | `boolean` |
3636

3737
<hr/>
3838

3939
#### Exports
4040

41-
| Kind | Name | Declaration | Module | Package |
42-
| ------------------------- | -------------- | -------------- | --------------- | ------- |
43-
| custom-element-definition | my-element | MyElement | ./my-element.js | |
44-
| js | functionExport | functionExport | ./my-element.js | |
41+
| Kind | Name | Declaration | Module | Package |
42+
| --------------------------- | ---------------- | -------------- | --------------- | ------- |
43+
| `custom-element-definition` | `my-element` | MyElement | ./my-element.js | |
44+
| `js` | `functionExport` | functionExport | ./my-element.js | |

packages/to-markdown/fixtures/hide-private/EXPECTED.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@
44

55
### Fields
66

7-
| Name | Privacy | Type | Default | Description | Inherited From |
8-
| ---- | --------- | ------------- | ------------- | ----------- | -------------- |
9-
| pub | public | `'public'` | `'public'` | | |
10-
| prot | protected | `'protected'` | `'protected'` | | |
7+
| Name | Privacy | Type | Default | Description | Inherited From |
8+
| ------ | --------- | ------------- | ------------- | ----------- | -------------- |
9+
| `pub` | public | `'public'` | `'public'` | | |
10+
| `prot` | protected | `'protected'` | `'protected'` | | |
1111

1212
### Methods
1313

14-
| Name | Privacy | Description | Parameters | Return | Inherited From |
15-
| --------------- | --------- | ----------- | ---------- | ------ | -------------- |
16-
| publicMethod | public | | | `void` | |
17-
| protectedMethod | protected | | | `void` | |
14+
| Name | Privacy | Description | Parameters | Return | Inherited From |
15+
| ----------------- | --------- | ----------- | ---------- | ------ | -------------- |
16+
| `publicMethod` | public | | | `void` | |
17+
| `protectedMethod` | protected | | | `void` | |
1818

1919
<hr/>
2020

2121
## Exports
2222

23-
| Kind | Name | Declaration | Module | Package |
24-
| ------------------------- | ---------- | ----------- | --------------- | ------- |
25-
| custom-element-definition | my-element | MyElement | ./my-element.js | |
23+
| Kind | Name | Declaration | Module | Package |
24+
| --------------------------- | ------------ | ----------- | --------------- | ------- |
25+
| `custom-element-definition` | `my-element` | MyElement | ./my-element.js | |

0 commit comments

Comments
 (0)