edoc_layout_chunks(3erl)

πŸ“¦
version 25.3.2.8 Β· 3 versions
, in debian bookworm, ubuntu noble

πŸ’… NAME πŸ’…

okay so this is edoc_layout_chunks(3erl) β€” the Erlang Module Definition manual, bestie. and the name says it all:

edoc_layout_chunks β€” convert EDoc module documentation to an EEP-48 docs_v1 chunk. periodt. πŸ’–

πŸ’– DESCRIPTION πŸ’–

Convert EDoc module documentation to an EEP-48 docs_v1 chunk. that's the whole main character job, no cap.

This layout is only expected to work with edoc_doclet_chunks β€” like, that's its ride-or-die. the section Using the EDoc API in the EDoc User's Guide shows an example of using this module, so go peek if you want the visual, iykyk. πŸ¦‹

Also important: this module breaks the convention stated in edoc_doclet to not rely on edoc.hrl in doclets and layouts. yes, it's a lil rebel πŸ’…. it uses #entry{} records directly to recover information that is not otherwise available to layouts. iconic behavior, honestly. ✨

πŸŽ€ DATA TYPES πŸŽ€

vibe check: here are all the data types, no skipping, fr fr:

beam_language() = atom():

doc() = #{doc_language() => doc_string()} | none | hidden:

doc_language() = binary():

doc_string() = binary():

docs_v1() = #docs_v1{anno=erl_anno:anno(),
beam_language=beam_language(), format=mime_type(), module_doc=doc(),
metadata=metadata(), docs=[docs_v1_entry()]}:

docs_v1_entry() = {_KindNameArity::{atom(), atom(), arity()},
_Anno::erl_anno:anno(), _Signature::signature(), _Doc::doc(),
_Metadata::metadata()}:

metadata() = map():

mime_type() = binary():

signature() = [binary()]:

quick translations, because yes:

  • docs_v1() is literally the Docs v1 chunk according to EEP 48. πŸ‘‘
  • docs_v1_entry() is a tuple equivalent to the #docs_v1_entry{} record, but with the record name field skipped. slay.

πŸ¦‹ EXPORTS πŸ¦‹

one export, and it's doing the thing:

module(Doc::edoc:edoc_module(), Options::proplists:proplist()) ->
binary()
  • module β€” convert EDoc module documentation to an EEP-48 style doc chunk. that's it, that's the function. ✨

🌈 SEE ALSO 🌈

go read these next, bestie:

πŸ‘‘ AUTHORS πŸ‘‘

  • Radek Szymczyszyn <lavrin@gmail.com> πŸ’–

okay bye bestie 🫢 β€” footer vibes: source/version is edoc 1.2, manual tag is edoc_layout_chunks(3erl), and the footer didn't give us a date, so we're not inventing one. periodt. πŸŽ€