> For the complete documentation index, see [llms.txt](https://sitecoreuml.gitbook.io/sitecoredxg/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sitecoreuml.gitbook.io/sitecoredxg/how-to/creating-a-custom-trigger/executing-documentation-generation.md).

# Executing Documentation Generation

In order to generate documentation, you need to call the `generateDocumentation` function of the `generation` module.

The function has the following syntax:

```
generation.generateDocumentation(
  Object data,        // the parsed JSON data response received from the serializer
  Fn successCallback, // callback to be executed on successful generation
  Fn errorCallback,   // callback to be executed on generation error
);
```

Following this syntax, the below can be used to execute documentation generation:

```javascript
generation.generateDocumentation(
  data,
  function (targetArchiveFilePath, targetArchiveFileName, targetFolderPath, targetHtmlDocFolderPath, targetMdjFilePath) {
    ...your logic to run on success...
  },
  function (error) {
    ...your logic to run on error...
  }
);
```
