Uploaded image for project: 'Erlang/OTP'
  1. Erlang/OTP
  2. ERL-1473

types mentioned in @type is not generated by edoc

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Help Wanted
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: OTP-23, OTP-24.0
    • Fix Version/s: None
    • Component/s: edoc
    • Labels:
      None

      Description

      I was wring docs of a new feature which is going to contribute to syntax_tools.
      and found it fails smoke-test in travis-ci.
      it is caused by

      Missing Anchor: "/lib/syntax_tools-2.4/doc/html/erl_syntax_traverse.html#type-traverse_style" from /lib/syntax_tools-2.4/doc/html/erl_syntax_traverse.html

      I found that tag of type traverse_style()

      -type traverse_style() :: traverse_step() | all | list.
      -type traverse_step() :: pre | post | leaf.
      

      is missing at doc/xml/erl_syntax_traverse.xml

      <tag><marker id="type-traverse_step"/>traverse_step() = pre | post | leaf</tag>

      so i write some sample code

      -module(test_edoc).
      -export_type([a/0]).
      -type a() :: b().
      -type b() :: hello.
      

      and run
      rebar3 edoc
      which generates

      <h3 class="typedecl"><a name="type-a">a()</a></h3>
      <p><tt>a() = <a href="#type-b">b()</a></tt></p>
      <h3 class="typedecl"><a name="type-b">b()</a></h3>
      <p><tt>b() = hello</tt></p>

      when i add @type doc for a().

      -module(test_edoc).
      -export_type([a/0]).
      %% @type a() = b().
      %% 
      %% hello world
      %% 
      -type a() :: b().
      -type b() :: hello.
      

      and run
      rebar3 edoc
      which generates

      <h3 class="typedecl"><a name="type-a">a()</a></h3>
      <p><tt>a() = <a href="#type-b">b()</a></tt></p>
      <p>hello world
      </p>
      <hr>

      and

      <h3 class="typedecl"><a name="type-b">b()</a></h3>
      <p><tt>b() = hello</tt></p>

      disappeared

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            slepher slepher
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: