     comments: []
   ]
 
+  @doc """
+  This event stream format's MIME type is `text/event-stream`.
+  """
   def mime_type do
     "text/event-stream"
   end
 
+  @doc """
+  Does the event have any data lines.
+
+  An event without any data lines will not trigger any browser events.
+  """
   def empty?(%{lines: []}), do: true
   def empty?(%{lines: _}), do: false
 
   @doc """
+  Format an event to be sent as part of a stream
+
+  **NOTE:** Each data/comment line must be without new line charachters.
 
   ## Examples
+  *In these examples this module has been aliased to `SSE`*.
 
       iex> %SSE{type: "greeting", lines: ["Hi,", "there"], comments: ["comment"]}
       ...> |> SSE.serialize()
       "event: greeting\\n: comment\\ndata: Hi,\\ndata: there"
+
+      iex> %SSE{lines: ["message with id"], id: "some-id"}
+      ...> |> SSE.serialize()
+      "data: message with id\\nid: some-id"
+
+      iex> %SSE{lines: ["message setting retry to 10s"], retry: 10_000}
+      ...> |> SSE.serialize()
+      "data: message setting retry to 10s\\nretry: 10000"
   """
   def serialize(event = %__MODULE__{}) do
     type_line(event)

  defp retry_line(%{retry: nil}) do
    []
  end
  defp retry_line(%{retry: retry}) do
    single_line?(retry) || raise "Bad"
    ["retry: " <> retry]
  end

  defp single_line?(text) do

  ```

  A living standard is available from [WHATWG](https://html.spec.whatwg.org/#server-sent-events).

  The contents of a server-sent-event are:

  | **type** | The type of an event |
  | **lines** | The data contents of the event split by line |
  | **id** | Value to send in `last-event-id` header when reconnecting |
  | **retry** | Time to wait before retrying connection in milliseconds |
  | **comments** | Any lines from original block that were marked as comments |
  """

  @new_line ~r/\R/
