# Source

A document before transform: its metadata as the schema produced it, and the entry's body.

> Every page: https://tomekit.aayush.cv/llms.txt

Defined in: [index.ts:57](https://github.com/aayushbtw/tomekit/blob/main/packages/tomekit/src/index.ts#L57)

A document before `transform`: its metadata as the schema produced it, and the entry's body.

## Example

```ts
// One transform shared by several collections
function withUrl<TMetadata extends object>(
  { metadata, slug }: Source<TMetadata>,
  { collection }: TransformContext
) {
  return { metadata: { ...metadata, url: `/${collection}/${slug}` } };
}
```

## Properties

### body

```ts
body: string;
```

Defined in: [index.ts:62](https://github.com/aayushbtw/tomekit/blob/main/packages/tomekit/src/index.ts#L62)

The entry's body, eg a file's text after the frontmatter block.

***

### file

```ts
file: TFile;
```

Defined in: [index.ts:64](https://github.com/aayushbtw/tomekit/blob/main/packages/tomekit/src/index.ts#L64)

Where the entry's file lives, or `undefined` when its loader gave none.

***

### metadata

```ts
metadata: TMetadata;
```

Defined in: [index.ts:66](https://github.com/aayushbtw/tomekit/blob/main/packages/tomekit/src/index.ts#L66)

The entry's metadata, as the collection's schema produced it.

***

### slug

```ts
slug: string;
```

Defined in: [index.ts:68](https://github.com/aayushbtw/tomekit/blob/main/packages/tomekit/src/index.ts#L68)

The document's key in its collection, eg `guides/setup`.
