edoc_layout_chunks — edoc v1.3

Search documentation of edoc

# View Source edoc_layout_chunks (edoc v1.3)

Convert EDoc module documentation to an EEP-48 `docs_v1` chunk.

This layout is only expected to work with `edoc_doclet_chunks`. Section Using the EDoc API in the EDoc User's Guide shows an example of using this module.

This module breaks the convention stated in `edoc_doclet` to not rely on `edoc.hrl` in doclets and layouts. It uses `#entry{}` records directly to recover information that is not otherwise available to layouts.

See also: edoc_doclet_chunks, //stdlib/shell_docs.

# Summary

## Types

beam_language/0
doc/0
doc_language/0
doc_string/0
docs_v1/0

The Docs v1 chunk according to EEP 48.

docs_v1_entry/0

A tuple equivalent to the `#docs_v1_entry{}` record, but with the record name field skipped.

metadata/0
mime_type/0
signature/0
xmerl_attribute/0
xmerl_doc_node/0

Subtype of `xmerl_xpath:nodeEntity()`. It corresponds to `#xmlElement.content` as defined by `xmerl.hrl`, sans the `#xmlDecl{}`.

xpath/0

## Functions

module(Doc, Options)

Convert EDoc module documentation to an EEP-48 style doc chunk.

overview(Element, Options)

# Types

Link to this type

# beam_language/0

View Source

    -type beam_language() :: atom().

Link to this type

# doc/0

View Source

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

Link to this type

# doc_language/0

View Source

    -type doc_language() :: binary().

Link to this type

# doc_string/0

View Source

    -type doc_string() :: binary().

Link to this type

# docs_v1/0

View Source

    -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()]}.

The Docs v1 chunk according to EEP 48.

Link to this type

# docs_v1_entry/0

View Source

    -type 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.

Link to this type

# metadata/0

View Source

    -type metadata() :: map().

Link to this type

# mime_type/0

View Source

    -type mime_type() :: binary().

Link to this type

# signature/0

View Source

    -type signature() :: [binary()].

Link to this type

# xmerl_attribute/0

View Source

    -type xmerl_attribute() ::
              #xmlAttribute{name :: term(),
                            expanded_name :: term(),
                            nsinfo :: term(),
                            namespace :: term(),
                            parents :: term(),
                            pos :: term(),
                            language :: term(),
                            value :: term(),
                            normalized :: term()}.

Link to this type

# xmerl_doc_node/0

View Source

    -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()}.

Subtype of `xmerl_xpath:nodeEntity()`. It corresponds to `#xmlElement.content` as defined by `xmerl.hrl`, sans the `#xmlDecl{}`.

Link to this type

# xpath/0

View Source

    -type xpath() :: string().

# Functions

Link to this function

# module(Doc, Options)

View Source

    -spec module(edoc:edoc_module(), proplists:proplist()) -> binary().

Convert EDoc module documentation to an EEP-48 style doc chunk.

Link to this function

# overview(Element, Options)

View Source

    -spec overview(Element :: term(), proplists:proplist()) -> term().