# buildEntityPageIndexes

**Kind:** Function

**Source:** [`atloria-monorepo/libs/parser-core/src/techdocs/entity-page.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/libs/parser-core/src/techdocs/entity-page.ts#L305)

Build the shared indexes renderEntityPage can consume, ONCE, for callers that render many
pages from the same graph. Turns per-page O(entities+relationships) work into O(deg) lookups.

## Signature

```ts
function buildEntityPageIndexes(entities: Entity[], relationships: Relationship[]): {
  nameResolver: (id: string) => string;
  outgoingBySource: Map<string, Relationship[]>;
  incomingByTarget: Map<string, Relationship[]>;
}
```

## Parameters

| Name | Type |
|---|---|
| `entities` | `Entity[]` |
| `relationships` | `Relationship[]` |

**Returns:** `{
  nameResolver: (id: string) => string;
  outgoingBySource: Map<string, Relationship[]>;
  incomingByTarget: Map<string, Relationship[]>;
}`
