# `PtcRunner.PromptLoader`
[🔗](https://github.com/andreasronge/ptc_runner/blob/main/lib/ptc_runner/prompt_loader.ex#L1)

Compile-time utilities for loading prompt templates from files.

Extracts content between `<!-- PTC_PROMPT_START -->` and `<!-- PTC_PROMPT_END -->` markers.
If markers are not found, returns the trimmed full content.

## Examples

    # Basic extraction
    content = File.read!("priv/prompts/my-prompt.md")
    prompt = PtcRunner.PromptLoader.extract_content(content)

    # With header (for metadata parsing)
    {header, content} = PtcRunner.PromptLoader.extract_with_header(content)

# `extract_content`

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

Extract prompt content from file content string.

Returns content between markers, or trimmed full content if markers not found.

## Examples

    iex> PtcRunner.PromptLoader.extract_content("before<!-- PTC_PROMPT_START -->content<!-- PTC_PROMPT_END -->after")
    "content"

    iex> PtcRunner.PromptLoader.extract_content("<!-- PTC_PROMPT_START -->only start marker")
    "only start marker"

    iex> PtcRunner.PromptLoader.extract_content("  no markers  ")
    "no markers"

# `extract_with_header`

```elixir
@spec extract_with_header(String.t()) :: {String.t(), String.t()}
```

Extract prompt content with metadata header.

Returns `{header, content}` tuple where header is text before the start marker.
Used by `LanguageSpec` for version metadata parsing.

## Examples

    iex> PtcRunner.PromptLoader.extract_with_header("header<!-- PTC_PROMPT_START -->content<!-- PTC_PROMPT_END -->after")
    {"header", "content"}

    iex> PtcRunner.PromptLoader.extract_with_header("header<!-- PTC_PROMPT_START -->only start")
    {"header", "only start"}

    iex> PtcRunner.PromptLoader.extract_with_header("  no markers  ")
    {"  no markers  ", "no markers"}

---

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