Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: variable type markdown formatting #5931

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 20 additions & 12 deletions packages/web-components/fast-foundation/CEMToMarkdown.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ for(var i = 0, modulesLength = modules.length; i < modulesLength; i++)
{
dec.default = replaceJSDOCLinksWithMDLinks(fixTagsInText(dec.default.replaceAll(LF, ' ')));
}
if(dec.type)
{
dec.type.text = replaceJSDOCLinksWithMDLinks(fixTagsInText(dec.type.text.replaceAll(LF, ' ')));
}
dec.members?.forEach(member=>{
if(member.description)
{
Expand Down Expand Up @@ -197,18 +201,22 @@ function replaceJSDOCLinksWithMDLinks(text)
let startIndex = text.indexOf('{@link');
if(startIndex < 0) return text;

let endIndex = text.indexOf("}", startIndex);
if(endIndex < 0) return text;

const jsdocLink = text.slice(startIndex, endIndex + 1);
let linkParts = jsdocLink.replace("{@link ", "").replace("}", "").split('|');
if(linkParts.length === 1)
while(startIndex>=0)
{
return text.replace(jsdocLink, linkParts[0]);
}
else
{
return text.replace(jsdocLink, "[" + linkParts[1].trim() + "](" + linkParts[0].trim() + ")");
}
let endIndex = text.indexOf("}", startIndex);
if(endIndex < 0) return text;

const jsdocLink = text.slice(startIndex, endIndex + 1);
let linkParts = jsdocLink.replace("{@link ", "").replace("}", "").split('|');
if(linkParts.length === 1)
{
text = text.replace(jsdocLink, linkParts[0]);
}
else
{
text = text.replace(jsdocLink, "[" + linkParts[1].trim() + "](" + linkParts[0].trim() + ")");
}
startIndex = text.indexOf('{@link',endIndex);
}
return text;
}
12 changes: 3 additions & 9 deletions packages/web-components/fast-foundation/src/accordion/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,9 @@ export const myAccordionItem = AccordionItem.compose<AccordionItemOptions>({

### Variables

| Name | Description | Type |
| --------------------- | ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `AccordionExpandMode` | Expand mode for Accordion | `{
/** * Designates only a single {@link @microsoft/fast-foundation#(AccordionItem:class) } can be open a time. */
single: "single",

/** * Designates multiple {@link @microsoft/fast-foundation#(AccordionItem:class) or AccordionItems} can be open simultaneously. */
multi: "multi",
}` |
| Name | Description | Type |
| --------------------- | ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `AccordionExpandMode` | Expand mode for Accordion | `{ /** * Designates only a single @microsoft/fast-foundation#(AccordionItem:class) can be open a time. */ single: "single", /** * Designates multiple [AccordionItems](@microsoft/fast-foundation#(AccordionItem:class)) can be open simultaneously. */ multi: "multi", }` |

<hr/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,7 @@ See [listbox-option](/docs/components/listbox-option) for more information.

| Name | Description | Type |
| ---------------------- | --------------------------------- | --------------------------------------------------------------------------------- |
| `ComboboxAutocomplete` | Autocomplete values for combobox. | `{
inline: "inline",
list: "list",
both: "both",
none: "none",
}` |
| `ComboboxAutocomplete` | Autocomplete values for combobox. | `{ inline: "inline", list: "list", both: "both", none: "none", }` |

<hr/>

Expand Down
18 changes: 3 additions & 15 deletions packages/web-components/fast-foundation/src/data-grid/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,21 +207,9 @@ export const myDataGrid = DataGrid.compose({

| Name | Description | Type |
| ----------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| `GenerateHeaderOptions` | Enumerates the data grid auto generated header options default option generates a non-sticky header row | `{
none: "none",
default: "default",
sticky: "sticky",
}` |
| `DataGridCellTypes` | Enumerates possible data grid cell types. | `{
default: "default",
columnHeader: "columnheader",
rowHeader: "rowheader",
}` |
| `DataGridRowTypes` | Enumerates possible data grid row types | `{
default: "default",
header: "header",
stickyHeader: "sticky-header",
}` |
| `GenerateHeaderOptions` | Enumerates the data grid auto generated header options default option generates a non-sticky header row | `{ none: "none", default: "default", sticky: "sticky", }` |
| `DataGridCellTypes` | Enumerates possible data grid cell types. | `{ default: "default", columnHeader: "columnheader", rowHeader: "rowheader", }` |
| `DataGridRowTypes` | Enumerates possible data grid row types | `{ default: "default", header: "header", stickyHeader: "sticky-header", }` |

<hr/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,7 @@ export const myDivider = Divider.compose({

| Name | Description | Type |
| ------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `DividerRole` | Divider roles | `{
/** * The divider semantically separates content */
separator: "separator",

/** * The divider has no semantic value and is for visual presentation only. */
presentation: "presentation",
}` |
| `DividerRole` | Divider roles | `{ /** * The divider semantically separates content */ separator: "separator", /** * The divider has no semantic value and is for visual presentation only. */ presentation: "presentation", }` |

<hr/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,7 @@ export const myFlipper = Flipper.compose<FlipperOptions>({

| Name | Description | Type |
| ------------------ | ---------------------------------- | ------------------------------------------------- |
| `FlipperDirection` | The direction options for flipper. | `{
next: "next",
previous: "previous",
}` |
| `FlipperDirection` | The direction options for flipper. | `{ next: "next", previous: "previous", }` |

<hr/>

Expand Down
11 changes: 1 addition & 10 deletions packages/web-components/fast-foundation/src/menu/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,16 +175,7 @@ export const myMenuItem = MenuItem.compose<MenuItemOptions>({

| Name | Description | Type |
| -------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `MenuItemRole` | Menu items roles. | `{
/** * The menu item has a "menuitem" role */
menuitem: "menuitem",

/** * The menu item has a "menuitemcheckbox" role */
menuitemcheckbox: "menuitemcheckbox",

/** * The menu item has a "menuitemradio" role */
menuitemradio: "menuitemradio",
}` |
| `MenuItemRole` | Menu items roles. | `{ /** * The menu item has a "menuitem" role */ menuitem: "menuitem", /** * The menu item has a "menuitemcheckbox" role */ menuitemcheckbox: "menuitemcheckbox", /** * The menu item has a "menuitemradio" role */ menuitemradio: "menuitemradio", }` |

<hr/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ This component is built with the expectation that focus is delegated to the inpu
| `autofocus` | public | `boolean` | | Indicates that this element should get focus after the page finishes loading. See [autofocus HTML attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefautofocus) for more information. | |
| `hideStep` | public | `boolean` | `false` | When true, spin buttons will not be rendered | |
| `placeholder` | public | `string` | | Sets the placeholder value of the element, generally used to provide a hint to the user. | |
| `list` | public | `string` | | Allows associating a [datalist](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist) to the element by {@link https://developer.mozilla.org/en-US/docs/Web/API/Element/id}. | |
| `list` | public | `string` | | Allows associating a [datalist](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist) to the element by https://developer.mozilla.org/en-US/docs/Web/API/Element/id. | |
| `maxlength` | public | `number` | | The maximum number of characters a user can enter. | |
| `minlength` | public | `number` | | The minimum number of characters a user can enter. | |
| `size` | public | `number` | | Sets the width of the element to a specified number of characters. | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ This component is built with the expectation that focus is delegated to the inpu
| `readOnly` | public | `boolean` | | When true, the control will be immutable by user interaction. See [readonly HTML attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly) for more information. | |
| `autofocus` | public | `boolean` | | Indicates that this element should get focus after the page finishes loading. See [autofocus HTML attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefautofocus) for more information. | |
| `placeholder` | public | `string` | | Sets the placeholder value of the element, generally used to provide a hint to the user. | |
| `list` | public | `string` | | Allows associating a [datalist](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist) to the element by {@link https://developer.mozilla.org/en-US/docs/Web/API/Element/id}. | |
| `list` | public | `string` | | Allows associating a [datalist](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist) to the element by https://developer.mozilla.org/en-US/docs/Web/API/Element/id. | |
| `maxlength` | public | `number` | | The maximum number of characters a user can enter. | |
| `minlength` | public | `number` | | The minimum number of characters a user can enter. | |
| `pattern` | public | `string` | | A regular expression that the value must match to pass validation. | |
Expand Down
5 changes: 1 addition & 4 deletions packages/web-components/fast-foundation/src/select/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,7 @@ See [listbox-option](/docs/components/listbox-option) for more information.

| Name | Description | Type |
| ---------------- | ------------------------------------------------------------- | --------------------------------------------- |
| `SelectPosition` | Positioning directions for the listbox when a select is open. | `{
above: "above",
below: "below",
}` |
| `SelectPosition` | Positioning directions for the listbox when a select is open. | `{ above: "above", below: "below", }` |

<hr/>

Expand Down
4 changes: 1 addition & 3 deletions packages/web-components/fast-foundation/src/slider/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,7 @@ export const mySliderLabel = SliderLabel.compose({

| Name | Description | Type |
| ------------ | ------------------------------------------------------------------- | -------------------------------------- |
| `SliderMode` | The selection modes of a @microsoft/fast-foundation#(Slider:class). | `{
singleValue: "single-value",
}` |
| `SliderMode` | The selection modes of a @microsoft/fast-foundation#(Slider:class). | `{ singleValue: "single-value", }` |

<hr/>

Expand Down
5 changes: 1 addition & 4 deletions packages/web-components/fast-foundation/src/tabs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,7 @@ export const myTabs = Tabs.compose({

| Name | Description | Type |
| ----------------- | ------------------------------------------------------------------------ | ------------------------------------------------------------- |
| `TabsOrientation` | The orientation of the @microsoft/fast-foundation#(Tabs:class) component | `{
vertical: "vertical",
horizontal: "horizontal",
}` |
| `TabsOrientation` | The orientation of the @microsoft/fast-foundation#(Tabs:class) component | `{ vertical: "vertical", horizontal: "horizontal", }` |

<hr/>

Expand Down
Loading