檢視原始碼 edoc_layout_chunks (edoc v1.3.2)
將 EDoc 模組文件轉換為 EEP-48 docs_v1
chunk。
此佈局預期僅與 edoc_doclet_chunks
一起使用。EDoc 使用者指南中的 使用 EDoc API 章節展示了使用此模組的範例。
此模組打破了 edoc_doclet
中所聲明的慣例,不依賴 doclet 和佈局中的 edoc.hrl
。它直接使用 #entry{}
記錄來恢復佈局中無法取得的資訊。
概要
類型
根據 EEP 48 的 Docs v1 chunk。
與 #docs_v1_entry{}
記錄等效的 tuple,但跳過了記錄名稱欄位。
xmerl_xpath:nodeEntity()
的子類型。 它對應於 xmerl.hrl
定義的 #xmlElement.content
,但不包含 #xmlDecl{}
。
類型
-type beam_language() :: atom().
-type doc() :: #{doc_language() => doc_string()} | none | hidden.
-type doc_language() :: binary().
-type doc_string() :: binary().
-type docs_v1() :: #docs_v1{anno :: erl_anno:anno(), beam_language :: beam_language(), format :: mime_type(), module_doc :: doc(), metadata :: metadata(), docs :: [docs_v1_entry()]}.
根據 EEP 48 的 Docs v1 chunk。
-type docs_v1_entry() :: {_KindNameArity :: {atom(), atom(), arity()}, _Anno :: erl_anno:anno(), _Signature :: signature(), _Doc :: doc(), _Metadata :: metadata()}.
與 #docs_v1_entry{}
記錄等效的 tuple,但跳過了記錄名稱欄位。
-type metadata() :: map().
-type mime_type() :: binary().
-type signature() :: [binary()].
-type xmerl_doc_node() :: #xmlComment{parents :: term(), pos :: term(), language :: term(), value :: term()} | #xmlElement{name :: term(), expanded_name :: term(), nsinfo :: term(), namespace :: term(), parents :: term(), pos :: term(), attributes :: term(), content :: term(), language :: term(), xmlbase :: term(), elementdef :: term()} | #xmlPI{name :: term(), parents :: term(), pos :: term(), value :: term()} | #xmlText{parents :: term(), pos :: term(), language :: term(), value :: term(), type :: term()}.
xmerl_xpath:nodeEntity()
的子類型。 它對應於 xmerl.hrl
定義的 #xmlElement.content
,但不包含 #xmlDecl{}
。
-type xpath() :: string().
函式
-spec module(edoc:edoc_module(), proplists:proplist()) -> binary().
將 EDoc 模組文件轉換為 EEP-48 風格的 doc chunk。
-spec overview(Element :: term(), proplists:proplist()) -> term().