# This file is auto-generated by alef — DO NOT EDIT.
# alef:hash:4e15143f4af1ae8bafbdb1506ef057da924484c66a19483966333558ad437e75
# To regenerate: alef generate
# To verify freshness: alef verify --exit-code
# Issues & docs: https://github.com/kreuzberg-dev/alef
defmodule Kreuzberg.PageConfig do
  @moduledoc """
  Page extraction and tracking configuration.

  Controls how pages are extracted, tracked, and represented in the extraction results.
  When `None`, page tracking is disabled.

  Page range tracking in chunk metadata (first_page/last_page) is automatically enabled
  when page boundaries are available and chunking is configured.
  """

  @typedoc "Page extraction and tracking configuration."
  @type t :: %__MODULE__{
          extract_pages: boolean(),
          insert_page_markers: boolean(),
          marker_format: String.t() | nil
        }

  defstruct extract_pages: false,
            insert_page_markers: false,
            marker_format: "

<!-- PAGE {page_num} -->

"

  defimpl Jason.Encoder do
    @doc false
    def encode(value, opts) do
      value
      |> Map.from_struct()
      |> Enum.reject(fn {_k, v} -> v == nil end)
      |> Enum.into(%{})
      |> Jason.Encoder.encode(opts)
    end
  end
end
