# `DCATR.Manifest.Generator`
[🔗](https://github.com/dcat-r/dcatr-ex/blob/v0.1.0/lib/dcatr/manifest/generator.ex#L1)

Generates `DCATR.Manifest` files for DCAT-R repositories from EEx templates.

Manifest files define service and repository configuration in RDF files. The generator
creates these files from customizable templates, enabling project scaffolding and custom
manifest type initialization.

The generator integrates with `DCATR.Manifest.LoadPath` to determine the target directory
and supports EEx templating for dynamic content generation.

# `default_template_dir`

Returns the default template directory for manifest generation.

## Configuration

The default template directory can be configured with the `:manifest_template_dir` option
of the `:dcatr` application configuration:

    config :dcatr, manifest_template_dir: "custom/path"

# `generate`

```elixir
@spec generate(DCATR.Manifest.Type.t(), Path.t(), keyword()) :: :ok | {:error, any()}
```

Generates the manifest files for a DCATR repository.

The `project_dir` is the root directory of the project where additional directories
may be created by custom manifest types. The manifest files themselves will be
generated in a subdirectory determined by the last path in the load path.

## Options

- `:template` - Custom template directory (default: uses `manifest_type.generator_template/0`)
- `:force` - Overwrite existing manifest directory (default: `false`)
- `:assigns` - Keyword list of assigns for EEx templates (e.g., `[service_title: "My Service"]`)

## Examples

    # Generate default manifests in config/dcatr/
    Generator.generate(DCATR.Manifest, "/path/to/project")

    # Use custom template with EEx assigns
    Generator.generate(
      DCATR.Manifest,
      "/path/to/project",
      template: "/custom/templates",
      assigns: [service_title: "My Service", creator: "http://example.org/me"]
    )

# `manifest_dir`

```elixir
@spec manifest_dir(keyword()) :: {:ok, Path.t()} | {:error, any()}
```

Returns the manifest directory path within the project directory.

The manifest directory is determined from the configured load path.
The last path in the load path with the highest precedence is used,
since it is the most specific path.

Returns an error if the last path in the load path is absolute, since
manifest directories must be relative to the project directory.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
