File tree 2 files changed +9
-1
lines changed
lib/ex_doc/formatter/html
test/ex_doc/formatter/html
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -146,7 +146,14 @@ defmodule ExDoc.Formatter.HTML.Templates do
146
146
defp sidebar_entries ( { group , nodes } ) do
147
147
nodes =
148
148
for node <- nodes do
149
- % { id: "#{ node . name } /#{ node . arity } " , anchor: URI . encode ( node . id ) }
149
+ id =
150
+ if "struct" in node . annotations do
151
+ node . signature
152
+ else
153
+ "#{ node . name } /#{ node . arity } "
154
+ end
155
+
156
+ % { id: id , anchor: URI . encode ( node . id ) }
150
157
end
151
158
152
159
% { key: HTML . text_to_id ( group ) , name: group , nodes: nodes }
Original file line number Diff line number Diff line change @@ -218,6 +218,7 @@ defmodule ExDoc.Formatter.HTML.TemplatesTest do
218
218
assert content =~ ~r( "id":"CompiledWithDocs".*"key":"functions".*"example/2") ms
219
219
assert content =~ ~r( "id":"CompiledWithDocs".*"key":"functions".*"example_without_docs/0") ms
220
220
assert content =~ ~r( "id":"CompiledWithDocs.Nested") ms
221
+ assert content =~ ~r( \{ "anchor":"__struct__/0","id":"%CompiledWithDocs\{ \} "\} ) ms
221
222
end
222
223
223
224
test "outputs nodes grouped based on metadata" do
You can’t perform that action at this time.
0 commit comments