-
Notifications
You must be signed in to change notification settings - Fork 334
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
Admonition does not work in Erlang @doc blocks #1901
Comments
The Thoughm I'm not sure what it is you are trying to achieve? Do you want to write Markdown in edoc comments? or is it only the admonition that you are after? |
Only the admonition (in whatever syntax). |
Have you tried doing it with xhtml? %% @doc
%% <blockquote><h4 class="error">Error</h4> This syntax will render an error block</blockquote> Another solution might be to do what we do with peer, that is |
I've tried the
ex_doc does not understand the embedded The |
How do you call ex_doc? When I use this module: -module(t).
-export([go/0]).
%% @doc
%% <blockquote><h4 class="error">Error</h4>aaa</blockquote>
go() -> ok. and call Erlang/OTP 26 [erts-14.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]
Eshell V14.2 (press Ctrl+G to abort, type help(). for help)
1> edoc:run(["t.erl"],[{doclet, edoc_doclet_chunks},{layout, edoc_layout_chunks}]).
t.erl: warning: 'blockquote' is not allowed - skipping tag, extracting content
ok the output is: 2> {ok, B} = file:read_file("chunks/t.chunk"), binary_to_term(B).
{docs_v1,[{file,"t.erl"},{location,1}],
erlang,<<"application/erlang+html">>,#{},#{},
[{{function,go,0},
[{file,"t.erl"},{location,7}],
[<<"go()">>],
#{<<"en">> =>
[{h4,[{class,<<"error">>}],[<<"Error">>]},<<"aaa">>]},
#{}}]} In Erlang/27 it does however work as it should. > erl
Erlang/OTP 27 [RELEASE CANDIDATE 3] [erts-14.2.5] [source-c1c93fb293] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]
Eshell V14.2.5 (press Ctrl+G to abort, type help(). for help)
1> edoc:run(["t.erl"],[{doclet, edoc_doclet_chunks},{layout, edoc_layout_chunks}]).
ok
2> f(), {ok, B} = file:read_file("chunks/t.chunk"), binary_to_term(B).
{docs_v1,[{file,"t.erl"},{location,1}],
erlang,<<"application/erlang+html">>,#{},#{},
[{{function,go,0},
[{file,"t.erl"},{location,7}],
[<<"go()">>],
#{<<"en">> =>
[{blockquote,[],
[{h4,[{class,<<"error">>}],[<<"Error">>]},
<<"aaa">>]}]},
#{}}]} Because of this PR: erlang/otp#8077 |
Indeed, that is an interesting question and it took me a while to retrace what I have done to reproduce the problem. It needs:
t.erl is moved into a dummy application to build it with rebar3. Then:
The t.erl that I'm using is:
rebar.config:
|
Ah, you are using Erlang 27-rc2, not 26.2 as you stated above. That is why you get that output. erlang/otp#8077 was merged after rc3, so you need to use latest master to get those changes. If you use 26.2 the I did a change in 27.0-rc1 for how unrecognized HTML elements are handled, that is why |
I will close this as it is not an ExDoc issue. :) I did a quick try on Erlang/OTP 27 and it works as desired. I am not sure if there is appetite to backport this to earlier EDoc versions. |
Placing a Admonition block into an Erlang @doc chunk does not work.
This:
results in this output:
I know that the goal is to push Erlang users to markup docs. But that needs support for the
-doc
and that is only available in OTP-27. That means that everything that wants or needs to support older versions is stuck with@doc
tags and it would be great if they would work too.The text was updated successfully, but these errors were encountered: