Skip to content

Commit

Permalink
docs: ✏️ Regenerate API documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
phun-ky committed Aug 28, 2024
1 parent dd8e13b commit 065a3f6
Show file tree
Hide file tree
Showing 61 changed files with 550 additions and 274 deletions.
5 changes: 4 additions & 1 deletion api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,22 @@

---

> Last updated 2024-08-23T11:58:26.652Z
> Last updated 2024-08-28T09:42:51.066Z
## Modules

- [config/browser](config/browser.md)
- [features/a11y](features/a11y.md)
- [features/a11y/constants](features/a11y/constants.md)
- [features/a11y/utils/create-a11y-element](features/a11y/utils/create-a11y-element.md)
- [features/a11y/utils/styles](features/a11y/utils/styles.md)
- [features/grid](features/grid.md)
- [features/mark](features/mark.md)
- [features/measure](features/measure.md)
- [features/pin](features/pin.md)
- [features/pin/utils/create-pin-element](features/pin/utils/create-pin-element.md)
- [features/pin/utils/get-character-to-use](features/pin/utils/get-character-to-use.md)
- [features/pin/utils/get-content-for-pin](features/pin/utils/get-content-for-pin.md)
- [features/pin/utils/pin-element](features/pin/utils/pin-element.md)
- [features/pin/utils/styles](features/pin/utils/styles.md)
- [features/spacing](features/spacing.md)
Expand Down Expand Up @@ -58,6 +60,7 @@
- [utils/debounce](utils/debounce.md)
- [utils/direction-of-element](utils/direction-of-element.md)
- [utils/get-coords-pair-from-objects](utils/get-coords-pair-from-objects.md)
- [utils/get-options](utils/get-options.md)
- [utils/id](utils/id.md)
- [utils/intrinsic-coords](utils/intrinsic-coords.md)
- [utils/node](utils/node.md)
Expand Down
2 changes: 1 addition & 1 deletion api/config/browser.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# config/browser

> Last updated 2024-08-23T11:58:26.653Z
> Last updated 2024-08-28T09:42:51.067Z
Contains the helper functions to activate SPECCER via a script tag, based on attributes:

Expand Down
46 changes: 5 additions & 41 deletions api/features/a11y.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,46 +6,10 @@

# features/a11y

> Last updated 2024-08-23T11:58:26.655Z
> Last updated 2024-08-28T09:42:51.069Z
## Functions

### create()

```ts
function create(type?, content?, n?): HTMLElement;
```

Creates an HTML element based on the specified type. \*

#### Parameters

| Parameter | Type | Default value | Description |
| ---------- | --------- | ------------- | --------------------------------------------------- |
| `type`? | `string` | `'tabstops'` | Type of element ('tabstops', 'landmark', 'region'). |
| `content`? | `unknown` | `undefined` | Content to be added to the element. |
| `n`? | `string` | `'span'` | HTML tag name (default is 'span'). |

#### Returns

[`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement)

The created HTML element.

#### Example

```ts
const tabElement = create('tabstops', null, 'div');
const landmarkElement = create('landmark', 1, 'div');
const regionElement = create('region', null, 'div');
```

#### Defined in

[features/a11y/index.ts:30](https://github.com/phun-ky/speccer/blob/main/src/features/a11y/index.ts#L30)

---

### element()

```ts
Expand All @@ -54,7 +18,7 @@ function element(targetEl, content?, type?): Promise<void>;

Adds an accessibility element to the document body based on the target element and type.

![Screenshot of speccer a11y tab stops in use](https://github.com/phun-ky/speccer/blob/main/public/a11y-tabstop.png?raw=true)
![Screenshot of speccer a11y tab stops in use](https://github.com/phun-ky/speccer/blob/main/public/speccer-a11y-tabstops-light.png?raw=true)
![Screenshot of speccer a11y landmark in use](https://github.com/phun-ky/speccer/blob/main/public/a11y-landmark.png?raw=true)

#### Parameters
Expand Down Expand Up @@ -83,7 +47,7 @@ if (targetElement) {

#### Defined in

[features/a11y/index.ts:73](https://github.com/phun-ky/speccer/blob/main/src/features/a11y/index.ts#L73)
[features/a11y/index.ts:34](https://github.com/phun-ky/speccer/blob/main/src/features/a11y/index.ts#L34)

---

Expand All @@ -107,7 +71,7 @@ init();

#### Defined in

[features/a11y/index.ts:168](https://github.com/phun-ky/speccer/blob/main/src/features/a11y/index.ts#L168)
[features/a11y/index.ts:129](https://github.com/phun-ky/speccer/blob/main/src/features/a11y/index.ts#L129)

---

Expand Down Expand Up @@ -145,7 +109,7 @@ if (shortcutElement) {

#### Defined in

[features/a11y/index.ts:116](https://github.com/phun-ky/speccer/blob/main/src/features/a11y/index.ts#L116)
[features/a11y/index.ts:77](https://github.com/phun-ky/speccer/blob/main/src/features/a11y/index.ts#L77)

---

Expand Down
2 changes: 1 addition & 1 deletion api/features/a11y/constants.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# features/a11y/constants

> Last updated 2024-08-23T11:58:26.656Z
> Last updated 2024-08-28T09:42:51.070Z
## Variables

Expand Down
65 changes: 65 additions & 0 deletions api/features/a11y/utils/create-a11y-element.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<div>
<img alt="SPECCER logo" src="https://raw.githubusercontent.com/phun-ky/speccer/main/public/logo-speccer-horizontal-colored-package.svg?raw=true" style="max-height:32px;" />
</div>

[@phun-ky/speccer](../../../README.md) / features/a11y/utils/create-a11y-element

# features/a11y/utils/create-a11y-element

> Last updated 2024-08-28T09:42:51.071Z
## Functions

### createA11yElement()

```ts
function createA11yElement(type?, content?, n?): HTMLElement;
```

Creates an HTML element based on the specified type. \*

#### Parameters

| Parameter | Type | Default value | Description |
| ---------- | --------- | ------------- | --------------------------------------------------- |
| `type`? | `string` | `'tabstops'` | Type of element ('tabstops', 'landmark', 'region'). |
| `content`? | `unknown` | `undefined` | Content to be added to the element. |
| `n`? | `string` | `'span'` | HTML tag name (default is 'span'). |

#### Returns

[`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement)

The created HTML element.

#### Example

```ts
const tabElement = create('tabstops', null, 'div');
const landmarkElement = create('landmark', 1, 'div');
const regionElement = create('region', null, 'div');
```

#### Defined in

[features/a11y/utils/create-a11y-element.ts:18](https://github.com/phun-ky/speccer/blob/main/src/features/a11y/utils/create-a11y-element.ts#L18)

---

**Contributing**

Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md)

**Sponsor me**

I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites.

The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :)

[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky).

![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true)

---

This project created by [Alexander Vassbotn Røyne-Helgesen](http://phun-ky.net) is licensed under a [MIT License](https://choosealicense.com/licenses/mit/).
2 changes: 1 addition & 1 deletion api/features/a11y/utils/styles.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# features/a11y/utils/styles

> Last updated 2024-08-23T11:58:26.657Z
> Last updated 2024-08-28T09:42:51.071Z
## Functions

Expand Down
18 changes: 9 additions & 9 deletions api/features/grid.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# features/grid

> Last updated 2024-08-23T11:58:26.658Z
> Last updated 2024-08-28T09:42:51.072Z
## Functions

Expand All @@ -20,11 +20,11 @@ Creates a visual grid overlay for a given target element.

#### Parameters

| Parameter | Type | Description |
| --------------- | ---------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- |
| `targetElement` | [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) | The target element to create the grid overlay for. |
| `styles` | [`CSSStyleDeclaration`](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration) | The computed styles of the target element. |
| `options` | [`Record`](https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type)\<`string`, `string`> | Options to determine what to draw |
| Parameter | Type | Description |
| --------------- | --------------------------------------------------------------------------------------- | -------------------------------------------------- |
| `targetElement` | [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) | The target element to create the grid overlay for. |
| `styles` | [`CSSStyleDeclaration`](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration) | The computed styles of the target element. |
| `options` | [`SpeccerOptionsInterface`](../types/speccer.md#specceroptionsinterface) | Options to determine what to draw |

#### Returns

Expand All @@ -42,7 +42,7 @@ if (targetElement) {

#### Defined in

[features/grid/index.ts:26](https://github.com/phun-ky/speccer/blob/main/src/features/grid/index.ts#L26)
[features/grid/index.ts:27](https://github.com/phun-ky/speccer/blob/main/src/features/grid/index.ts#L27)

---

Expand All @@ -56,7 +56,7 @@ Create a visual overlay to present the column gaps for a grid container

Adds a visual grid overlay to the target element if it has the appropriate data attribute and is a grid.

![grid](https://github.com/phun-ky/speccer/blob/main/public/grid.png?raw=true)
![grid](https://github.com/phun-ky/speccer/blob/main/public/speccer-grid-full-dark.png?raw=true)

#### Parameters

Expand All @@ -83,7 +83,7 @@ if (targetElement) {

#### Defined in

[features/grid/index.ts:137](https://github.com/phun-ky/speccer/blob/main/src/features/grid/index.ts#L137)
[features/grid/index.ts:142](https://github.com/phun-ky/speccer/blob/main/src/features/grid/index.ts#L142)

---

Expand Down
6 changes: 3 additions & 3 deletions api/features/mark.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# features/mark

> Last updated 2024-08-23T11:58:26.658Z
> Last updated 2024-08-28T09:42:51.072Z
## Functions

Expand Down Expand Up @@ -39,7 +39,7 @@ document.body.appendChild(marker);

#### Defined in

[features/mark/index.ts:21](https://github.com/phun-ky/speccer/blob/main/src/features/mark/index.ts#L21)
[features/mark/index.ts:22](https://github.com/phun-ky/speccer/blob/main/src/features/mark/index.ts#L22)

---

Expand Down Expand Up @@ -74,7 +74,7 @@ element(targetElement);

#### Defined in

[features/mark/index.ts:44](https://github.com/phun-ky/speccer/blob/main/src/features/mark/index.ts#L44)
[features/mark/index.ts:45](https://github.com/phun-ky/speccer/blob/main/src/features/mark/index.ts#L45)

---

Expand Down
18 changes: 9 additions & 9 deletions api/features/measure.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,25 @@

# features/measure

> Last updated 2024-08-23T11:58:26.659Z
> Last updated 2024-08-28T09:42:51.073Z
## Functions

### create()

```ts
function create(text, area, tag): HTMLElement;
function create(text, options, tag): HTMLElement;
```

Create a measurement element with optional text, area, and element type.

#### Parameters

| Parameter | Type | Default value | Description |
| --------- | -------------------- | ------------- | ----------------------------------- |
| `text` | `string` \| `number` | `''` | The text to display on the element. |
| `area` | `null` \| `string` | `''` | The area to specify with CSS class. |
| `tag` | `string` | `'span'` | The element type. |
| Parameter | Type | Default value | Description |
| --------- | ------------------------------------------------------------------------ | ------------- | ----------------------------------- |
| `text` | `string` \| `number` | `''` | The text to display on the element. |
| `options` | [`SpeccerOptionsInterface`](../types/speccer.md#specceroptionsinterface) | `undefined` | The options. |
| `tag` | `string` | `'span'` | The element type. |

#### Returns

Expand All @@ -41,7 +41,7 @@ document.body.appendChild(measurement);

#### Defined in

[features/measure/index.ts:30](https://github.com/phun-ky/speccer/blob/main/src/features/measure/index.ts#L30)
[features/measure/index.ts:25](https://github.com/phun-ky/speccer/blob/main/src/features/measure/index.ts#L25)

---

Expand Down Expand Up @@ -76,7 +76,7 @@ element(targetElement);

#### Defined in

[features/measure/index.ts:59](https://github.com/phun-ky/speccer/blob/main/src/features/measure/index.ts#L59)
[features/measure/index.ts:62](https://github.com/phun-ky/speccer/blob/main/src/features/measure/index.ts#L62)

---

Expand Down
4 changes: 2 additions & 2 deletions api/features/pin.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# features/pin

> Last updated 2024-08-23T11:58:26.659Z
> Last updated 2024-08-28T09:42:51.073Z
This feature highlights the anatomy of an element.

Expand Down Expand Up @@ -75,7 +75,7 @@ pinElements(sectionElement);

#### Defined in

[features/pin/index.ts:44](https://github.com/phun-ky/speccer/blob/main/src/features/pin/index.ts#L44)
[features/pin/index.ts:47](https://github.com/phun-ky/speccer/blob/main/src/features/pin/index.ts#L47)

---

Expand Down
Loading

0 comments on commit 065a3f6

Please sign in to comment.