edoc_layout_chunks(3)

πŸ“¦
version 29.0.6 Β· 2 versions
, in ubuntu stonking

✨ edoc_layout_chunks β€” the Erlang Module Definition ✨

okay so bestie, welcome to edoc_layout_chunks, straight out of the Erlang Module Definition section of the manual. this is the lil layout module that turns your EDoc module docs into an EEP-48 docs_v1 chunk. she's niche, she's specific, she's doing her job and doing it well πŸ’…


🌸 NAME 🌸

edoc_layout_chunks β€” Convert EDoc module documentation to an EEP-48 docs_v1 chunk.


πŸ’– DESCRIPTION πŸ’–

okay so first thing, no surprises: this layout is only expected to work with edoc_doclet_chunks. like, that's her soulmate, that's her person, don't try to set her up with anyone else 🫢

there's a section in the EDoc User's Guide called Using the EDoc API that shows an example of using this module, so if you wanna see her in action, that's your girl.

now here's the tea β˜• β€” this module breaks the convention stated in edoc_doclet, the one that says doclets and layouts shouldn't rely on edoc.hrl. she does it anyway. she goes straight in and uses #entry{} records directly to recover information that isn't otherwise available to layouts. iconic? yes. conventional? absolutely not. but that's the whole point, iykyk 😭

See also: edoc_doclet_chunks, //stdlib/shell_docs.


πŸ¦‹ DATA TYPES πŸ¦‹

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

The Docs v1 chunk according to EEP 48. periodt ✨

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

A tuple equivalent to the #docs_v1_entry{} record, but with the record name field skipped. so she's the record's chill, low-key twin β€” same vibes, minus the name tag πŸ’€


πŸŽ€ FUNCTIONS πŸŽ€

  • module(edoc:edoc_module(), proplists:proplist()) -> binary() β€” Convert EDoc module documentation to an EEP-48 style doc chunk. that's it, that's the function, she takes your edoc:edoc_module() and a proplists:proplist(), and she hands you back a binary(). one job, done flawlessly πŸ‘‘

friendly reminder: if you're not running this through edoc_doclet_chunks, you're kinda setting yourself up. the docs literally say that's the only combo she's expected to work with. don't do her dirty πŸ™ˆ

and that's the whole page, bestie πŸ“ this gorgeous little thing is brought to you by Ericsson AB, shipping as part of edoc version 1.5, filed under edoc_layout_chunks(3). no date on this one, she's timeless like that πŸ’œ ✨ 🧚

πŸ“¦ where this page comes from