[erlang-questions] edoc and erlang code quoting

CT Radu ct.radu.001@REDACTED
Wed Jan 7 13:45:54 CET 2015


Thank you.
That was the missing piece.

Tiberiu

2015-01-07 11:07 GMT+02:00 Richard Carlsson <carlsson.richard@REDACTED>:

> Use ```....''' wiki notation. See
> http://www.erlang.org/doc/apps/edoc/chapter.html#Verbatim_quoting
>
> You can use <code>...</code>, but then you have to HTML-escape all < and &
> characters in your example code manually. For example: <code> ...{
> <<"client">>,<&lt"ClientOne">>}, ...</code>
>
>
>         /Richard
>
> On Wed, Jan 7, 2015 at 9:57 AM, CT Radu <ct.radu.001@REDACTED> wrote:
>
>> Hi all,
>>
>> Does anyone know how to properly embed erlang code examples inside e @doc
>> tag ?
>>
>> For example, I have something like:
>>
>> %% @doc Mongo Query.
>> %% Answer example:
>> %% <code>
>> %%      [
>> %%       {<<"client">>, <<"ClientOne">>},
>> %%       {<<"client-dir">>, <<"/dir/path">>}
>> %%      ]
>> %% </code>
>> %% @end
>>
>> I run edoc using  :
>> erl -pa ebin/ -noshell\
>>     -eval 'edoc:application(app_name, ".", [{source_path,
>> ["/full/source/path"]}]), init:stop().'
>>
>> And I get this:
>> 2991- fatal: {invalid_name,"<\"clie"}
>> /full/source/path/module.erl, function get_clients_dirs/0: at line 156:
>> error in XML parser: {fatal,{{invalid_name,"<\"clie"},
>>                              {file,file_name_unknown},
>>                              {line,159},
>>                              {col,11}}}.
>> edoc: skipping source file '/full/source/path/module.erl': {'EXIT',error}.
>> edoc: error in doclet 'edoc_doclet': {'EXIT',error}.
>> {"init terminating in do_boot",error}
>>
>> If you have any ideas on how I can generate this properly, I'll be
>> gratefull.
>> Costin-Tiberiu Radu,
>>
>>
>>
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://erlang.org/mailman/listinfo/erlang-questions
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150107/7b40461f/attachment.htm>


More information about the erlang-questions mailing list