# `Volt.Plugin.EmbeddedModule`
[🔗](https://github.com/elixir-volt/volt/blob/v0.16.0/lib/volt/plugin/embedded_module.ex#L1)

A module embedded in a source file owned by a Volt plugin.

Embedded modules model single-file-component subresources such as `<script>`
and `<style>` blocks. They are addressed as query modules derived from the
real parent file instead of opaque synthetic ids, which preserves source-file
identity for resolution, watching, and diagnostics.

# `kind`

```elixir
@type kind() :: :script | :style | :custom
```

# `t`

```elixir
@type t() :: %Volt.Plugin.EmbeddedModule{
  content_type: String.t() | nil,
  extension: String.t(),
  index: non_neg_integer() | nil,
  source: String.t(),
  type: kind()
}
```

# `content_type`

```elixir
@spec content_type(t()) :: String.t()
```

Content type inferred from an embedded module kind.

# `filename`

```elixir
@spec filename(String.t(), t() | nil) :: String.t()
```

Return a compiler-friendly filename for the embedded module.

# `id`

```elixir
@spec id(String.t(), t()) :: String.t()
```

Build the internal query-module id for an embedded module under a parent file.

# `id?`

```elixir
@spec id?(String.t()) :: boolean()
```

Return true when an id addresses an embedded module.

# `normalize`

```elixir
@spec normalize(term(), non_neg_integer()) :: t()
```

Normalize legacy tuple modules or maps into embedded module structs.

# `normalize_all`

```elixir
@spec normalize_all([term()]) :: [t()]
```

Normalize a list of embedded modules and assign indexes where omitted.

# `parent_path`

```elixir
@spec parent_path(String.t()) :: String.t()
```

Return the real parent file for ids that address embedded modules.

# `parse_id`

```elixir
@spec parse_id(String.t()) :: {:ok, Volt.Plugin.EmbeddedModule.ID.t()} | :error
```

Parse an embedded query-module id.

# `specifier`

```elixir
@spec specifier(String.t(), t()) :: String.t()
```

Build an import specifier for an embedded module from its parent module.

---

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