Copy as Markdown[View as Markdown](/docs/sdk/functions/writeCustomDoc.md)

***

# Function: writeCustomDoc()

> **writeCustomDoc**(`directory`): (`customDoc`, `options`) => `Promise`<`void`>

Defined in: custom-docs.ts:96

Write a custom doc to EventCatalog.

You can optionally override the path of the custom doc.

## Parameters[​](#parameters "Direct link to Parameters")

| Parameter   | Type     |
| ----------- | -------- |
| `directory` | `string` |

## Returns[​](#returns "Direct link to Returns")

`Function`

### Parameters[​](#parameters-1 "Direct link to Parameters")

| Parameter       | Type                  |
| --------------- | --------------------- |
| `customDoc`     | `CustomDoc`           |
| `options`       | { `path`: `string`; } |
| `options.path`? | `string`              |

### Returns[​](#returns-1 "Direct link to Returns")

`Promise`<`void`>

## Example[​](#example "Direct link to Example")

```
import utils from '@eventcatalog/utils';

const { writeCustomDoc } = utils('/path/to/eventcatalog');

// Write a custom doc to the catalog
// Custom doc would be written to docs/inventory-management.mdx
await writeCustomDoc({
  title: 'Inventory Management',
  summary: 'This is a summary',
  owners: ['John Doe'],
  badges: [{ content: 'Badge', backgroundColor: 'red', textColor: 'white' }],
  markdown: '# Hello world',
  fileName: 'inventory-management',
});

// Write a custom doc to the catalog but override the path
// Custom doc would be written to docs/guides/inventory-management/introduction.mdx
await writeCustomDoc({
  title: 'Inventory Management',
  summary: 'This is a summary',
  owners: ['John Doe'],
  badges: [{ content: 'Badge', backgroundColor: 'red', textColor: 'white' }],
  markdown: '# Hello world',
  fileName: 'introduction',
}, { path: "/guides/inventory-management"});
```
