Skip to content

Commit

Permalink
generate api docs (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
elringus authored Jan 2, 2024
1 parent 932ef85 commit e134f90
Show file tree
Hide file tree
Showing 88 changed files with 1,762 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export default defineConfig({
docFooter: { prev: "Previous page", next: "Next page" },
nav: [
{ text: "Guide", link: "/guide/", activeMatch: "/guide/" },
{ text: "Reference", link: "/api/", activeMatch: "/api/" },
{
text: `v${(await import("./../../package.json")).version}`, items: [
{ text: "Changes", link: "https://github.com/elringus/imgit/releases/latest" },
Expand Down
19 changes: 19 additions & 0 deletions docs/api/imgit.assetspec.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [imgit](./imgit.md) &gt; [AssetSpec](./imgit.assetspec.md)

## AssetSpec type

Per-asset specifications assigned by the user.

**Signature:**

```typescript
export type AssetSpec = {
width?: number;
eager?: boolean;
merge?: boolean;
media?: string;
class?: string;
};
```
19 changes: 19 additions & 0 deletions docs/api/imgit.assetsyntax.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [imgit](./imgit.md) &gt; [AssetSyntax](./imgit.assetsyntax.md)

## AssetSyntax type

Asset syntax captured from transformed document.

**Signature:**

```typescript
export type AssetSyntax = {
text: string;
index: number;
url: string;
alt?: string;
spec?: string;
};
```
25 changes: 25 additions & 0 deletions docs/api/imgit.boot.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [imgit](./imgit.md) &gt; [boot](./imgit.boot.md)

## boot() function

Initializes build context with specified options.

**Signature:**

```typescript
export declare function boot(prefs?: Prefs, platform?: Platform): Promise<void>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| prefs | [Prefs](./imgit.prefs.md) | _(Optional)_ Build preferences; will use pre-defined defaults when not assigned. |
| platform | [Platform](./imgit.platform.md) | _(Optional)_ Runtime APIs to use; will attempt to detect automatically when not assigned. |

**Returns:**

Promise&lt;void&gt;

25 changes: 25 additions & 0 deletions docs/api/imgit.build.build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [imgit](./imgit.md) &gt; [build](./imgit.build.md) &gt; [build](./imgit.build.build.md)

## build.build() function

Default HTML builder for supported asset types (images and video).

**Signature:**

```typescript
export declare function build(asset: BuiltAsset, merges?: BuiltAsset[]): Promise<void>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| asset | [BuiltAsset](./imgit.builtasset.md) | |
| merges | [BuiltAsset](./imgit.builtasset.md)<!-- -->\[\] | _(Optional)_ |

**Returns:**

Promise&lt;void&gt;

24 changes: 24 additions & 0 deletions docs/api/imgit.build.buildall.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [imgit](./imgit.md) &gt; [build](./imgit.build.md) &gt; [buildAll](./imgit.build.buildall.md)

## build.buildAll() function

Builds HTML for the optimized assets to overwrite source syntax.

**Signature:**

```typescript
export declare function buildAll(assets: EncodedAsset[]): Promise<BuiltAsset[]>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| assets | [EncodedAsset](./imgit.encodedasset.md)<!-- -->\[\] | |

**Returns:**

Promise&lt;[BuiltAsset](./imgit.builtasset.md)<!-- -->\[\]&gt;

24 changes: 24 additions & 0 deletions docs/api/imgit.build.buildcontentsource.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [imgit](./imgit.md) &gt; [build](./imgit.build.md) &gt; [buildContentSource](./imgit.build.buildcontentsource.md)

## build.buildContentSource() function

Builds serve url for content file with specified full path based on configured root option.

**Signature:**

```typescript
export declare function buildContentSource(path: string): string;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| path | string | |

**Returns:**

string

13 changes: 13 additions & 0 deletions docs/api/imgit.build.container_attr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [imgit](./imgit.md) &gt; [build](./imgit.build.md) &gt; [CONTAINER\_ATTR](./imgit.build.container_attr.md)

## build.CONTAINER\_ATTR variable

Attribute expected on containers of HTML generated for imgit content.

**Signature:**

```typescript
CONTAINER_ATTR = "data-imgit-container"
```
13 changes: 13 additions & 0 deletions docs/api/imgit.build.cover_contained_style.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [imgit](./imgit.md) &gt; [build](./imgit.build.md) &gt; [COVER\_CONTAINED\_STYLE](./imgit.build.cover_contained_style.md)

## build.COVER\_CONTAINED\_STYLE variable

CSS style applied to contained elements, siblings to cover element.

**Signature:**

```typescript
COVER_CONTAINED_STYLE = "width:100%;"
```
13 changes: 13 additions & 0 deletions docs/api/imgit.build.cover_container_style.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [imgit](./imgit.md) &gt; [build](./imgit.build.md) &gt; [COVER\_CONTAINER\_STYLE](./imgit.build.cover_container_style.md)

## build.COVER\_CONTAINER\_STYLE variable

CSS style applied to container of cover element.

**Signature:**

```typescript
COVER_CONTAINER_STYLE = "display:flex;"
```
13 changes: 13 additions & 0 deletions docs/api/imgit.build.cover_style.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [imgit](./imgit.md) &gt; [build](./imgit.build.md) &gt; [COVER\_STYLE](./imgit.build.cover_style.md)

## build.COVER\_STYLE variable

CSS style applied to cover element itself.

**Signature:**

```typescript
COVER_STYLE = "width:100%;margin-left:-100%;"
```
13 changes: 13 additions & 0 deletions docs/api/imgit.build.loadable_attr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [imgit](./imgit.md) &gt; [build](./imgit.build.md) &gt; [LOADABLE\_ATTR](./imgit.build.loadable_attr.md)

## build.LOADABLE\_ATTR variable

Attribute expected on HTML elements loaded by imgit.

**Signature:**

```typescript
LOADABLE_ATTR = "data-imgit-loadable"
```
24 changes: 24 additions & 0 deletions docs/api/imgit.build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [imgit](./imgit.md) &gt; [build](./imgit.build.md)

## build namespace

## Functions

| Function | Description |
| --- | --- |
| [build(asset, merges)](./imgit.build.build.md) | Default HTML builder for supported asset types (images and video). |
| [buildAll(assets)](./imgit.build.buildall.md) | Builds HTML for the optimized assets to overwrite source syntax. |
| [buildContentSource(path)](./imgit.build.buildcontentsource.md) | Builds serve url for content file with specified full path based on configured root option. |

## Variables

| Variable | Description |
| --- | --- |
| [CONTAINER\_ATTR](./imgit.build.container_attr.md) | Attribute expected on containers of HTML generated for imgit content. |
| [COVER\_CONTAINED\_STYLE](./imgit.build.cover_contained_style.md) | CSS style applied to contained elements, siblings to cover element. |
| [COVER\_CONTAINER\_STYLE](./imgit.build.cover_container_style.md) | CSS style applied to container of cover element. |
| [COVER\_STYLE](./imgit.build.cover_style.md) | CSS style applied to cover element itself. |
| [LOADABLE\_ATTR](./imgit.build.loadable_attr.md) | Attribute expected on HTML elements loaded by imgit. |

25 changes: 25 additions & 0 deletions docs/api/imgit.build_2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [imgit](./imgit.md) &gt; [build\_2](./imgit.build_2.md)

## build\_2() function

Default HTML builder for supported asset types (images and video).

**Signature:**

```typescript
export declare function build(asset: BuiltAsset, merges?: BuiltAsset[]): Promise<void>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| asset | [BuiltAsset](./imgit.builtasset.md) | |
| merges | [BuiltAsset](./imgit.builtasset.md)<!-- -->\[\] | _(Optional)_ |

**Returns:**

Promise&lt;void&gt;

24 changes: 24 additions & 0 deletions docs/api/imgit.buildall.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [imgit](./imgit.md) &gt; [buildAll](./imgit.buildall.md)

## buildAll() function

Builds HTML for the optimized assets to overwrite source syntax.

**Signature:**

```typescript
export declare function buildAll(assets: EncodedAsset[]): Promise<BuiltAsset[]>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| assets | [EncodedAsset](./imgit.encodedasset.md)<!-- -->\[\] | |

**Returns:**

Promise&lt;[BuiltAsset](./imgit.builtasset.md)<!-- -->\[\]&gt;

24 changes: 24 additions & 0 deletions docs/api/imgit.buildcontentsource.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [imgit](./imgit.md) &gt; [buildContentSource](./imgit.buildcontentsource.md)

## buildContentSource() function

Builds serve url for content file with specified full path based on configured root option.

**Signature:**

```typescript
export declare function buildContentSource(path: string): string;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| path | string | |

**Returns:**

string

17 changes: 17 additions & 0 deletions docs/api/imgit.builtasset.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [imgit](./imgit.md) &gt; [BuiltAsset](./imgit.builtasset.md)

## BuiltAsset type

Final product of asset transformation with associated HTML.

**Signature:**

```typescript
export type BuiltAsset = EncodedAsset & {
html: string;
};
```
**References:** [EncodedAsset](./imgit.encodedasset.md)

13 changes: 13 additions & 0 deletions docs/api/imgit.cache.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [imgit](./imgit.md) &gt; [cache](./imgit.cache.md)

## cache variable

Cached results of the build operations.

**Signature:**

```typescript
cache: Cache
```
20 changes: 20 additions & 0 deletions docs/api/imgit.cache_2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [imgit](./imgit.md) &gt; [Cache\_2](./imgit.cache_2.md)

## Cache\_2 type

Cached results of the build operations. Each property is persisted as a standalone JSON file between build runs. Custom properties can be added.

**Signature:**

```typescript
export type Cache = Record<string, unknown> & {
sizes: Record<string, number>;
probes: Record<string, ContentInfo>;
specs: Record<string, EncodeSpec>;
covers: Record<string, string>;
};
```
**References:** [ContentInfo](./imgit.contentinfo.md)<!-- -->, [EncodeSpec](./imgit.encodespec.md)

15 changes: 15 additions & 0 deletions docs/api/imgit.cacheoptions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [imgit](./imgit.md) &gt; [CacheOptions](./imgit.cacheoptions.md)

## CacheOptions type

Configures server cache.

**Signature:**

```typescript
export type CacheOptions = {
root: string;
};
```
Loading

0 comments on commit e134f90

Please sign in to comment.