Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements to erlang docs #102

Merged
merged 3 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions lib/aws_codegen/docstring.ex
Original file line number Diff line number Diff line change
Expand Up @@ -274,18 +274,23 @@ defmodule AWS.CodeGen.Docstring do
if String.contains?(text, "\n") do
"\n```\n#{String.trim_leading(text, "\n")}'''#{@two_break_lines}"
else
"`#{text}'"
## ex_doc blows up on these sorts of things as it sees them as a reference to a function.
## Just ignore them as they refer to aws-sdk-go based implementations and we don't really care about that
if String.ends_with?(text, "()") do
""
else
"`#{text}'"
end
end

{"a", attrs, children} = html_node ->
{"a", attrs, children} ->
case Enum.find(attrs, fn {attr, _} -> attr == "href" end) do
{_, href} ->
text = Floki.text(children)

if text == href do
"[#{href}]"
else
html_node
"#{text}: #{href}"
end

nil ->
Expand Down
2 changes: 1 addition & 1 deletion test/aws_codegen/docstring_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ defmodule AWS.CodeGen.DocstringTest do
"""
%% @doc A short description.
%%
%% This is a <a href="https://foo.bar">link</a>.
%% This is a link: https://foo.bar.
%% This is a `code' and a multiline is here:
%%
%% ```
Expand Down
Loading