Manhwa.Config (manhwa v0.1.1)

Copy Markdown View Source

Runtime configuration access for the reader packages.

All function-shaped options are {module, function} tuples so they can live in compile-time config files.

config :manhwa,
  store: MyApp.ReaderStore,                       # required
  annotations: MyApp.ReaderAnnotations,           # optional
  gif_provider: MyApp.ReaderGifs,                 # optional
  etcher_host: MyAppWeb.EtcherHostLive,           # optional LiveView
  current_user: {MyAppWeb.ReaderGlue, :current_user},   # (conn) -> user
  etcher_session: {MyAppWeb.ReaderGlue, :etcher_session}, # (conn, user) -> map
  series_url: {MyAppWeb.ReaderGlue, :series_url},        # (series) -> path
  legacy_url: {MyAppWeb.ReaderGlue, :legacy_url}         # (series, chapter) -> path | nil

Summary

Functions

Resolve the current user from the conn. Default: conn.assigns[:current_user].

Debug-log sink for on-device telemetry (iOS Safari sessions without DevTools). nil disables the endpoint body (it still 200s). Set a file path to append JSON lines.

The LiveView module embedded (via live_render/3) to host the Etcher annotation layer and whatever comment UI the host wants. nil (the default) renders no annotation layer.

Extra session entries for the etcher-host LiveView (e.g. an auth token so the LiveView can re-load the user). Merged over the package-provided keys (fresco_id, series, chapter, and — for two-segment series — source/slug).

Optional {module, function} rendering extra head content on the strip reader page (a function component taking an assigns map) — e.g. an OCR runtime script tag powering the smart auto-reader.

Optional link to an alternate/legacy reader, shown in settings when present.

Host page for a series (the reader's Home / details link). Default /.

Functions

annotations()

current_user(conn)

Resolve the current user from the conn. Default: conn.assigns[:current_user].

debug_log_path()

Debug-log sink for on-device telemetry (iOS Safari sessions without DevTools). nil disables the endpoint body (it still 200s). Set a file path to append JSON lines.

etcher_host()

The LiveView module embedded (via live_render/3) to host the Etcher annotation layer and whatever comment UI the host wants. nil (the default) renders no annotation layer.

etcher_session(conn, user)

Extra session entries for the etcher-host LiveView (e.g. an auth token so the LiveView can re-load the user). Merged over the package-provided keys (fresco_id, series, chapter, and — for two-segment series — source/slug).

extra_head()

Optional {module, function} rendering extra head content on the strip reader page (a function component taking an assigns map) — e.g. an OCR runtime script tag powering the smart auto-reader.

gif_provider()

legacy_url(series, chapter)

Optional link to an alternate/legacy reader, shown in settings when present.

series_url(series)

Host page for a series (the reader's Home / details link). Default /.

store()