yumemi/gen/static_source
面へ写す back 側の静的資料。面 package の Gleam 走査とは別の口で読む。
Types
pub type Error {
Missing(path: String)
Unreadable(path: String, detail: String)
}
Constructors
-
Missing(path: String) -
Unreadable(path: String, detail: String)
pub type Host {
Host(
connector: String,
host: String,
name: String,
information: String,
purpose: String,
side: String,
)
}
Constructors
-
Host( connector: String, host: String, name: String, information: String, purpose: String, side: String, )
Values
pub fn external_hosts(
source_text: String,
) -> Result(List(Host), Nil)
JS ファイルから EXTERNAL_HOSTS の6欄だけを読む。shape が違えば Error。
pub fn load(app_dir: String) -> Result(Sources, Error)
<app>/src/external_hosts.mjs と <repo-root>/docs/api-v1.md を読む。
.mjs は専用の狭い字句読みで宣言形を検査し、Markdown は字として保持する。