[From nobody Mon Mar 25 16:16:48 2013 Date: Sat, 24 Jun 2006 11:31:17 -0400 From: Serge Aleynikov <serge@hq.idt.net> Subject: edoc custom XML layout To: Erlang Users' List <erlang-questions@erlang.org> Message-id: <449D5AC5.3030102@hq.idt.net> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT X-Accept-Language: en-us, en User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) Hi, I am trying to figure out how to write a custom layout module for edoc in order to export Erlang documentation to an XML format suitable for including in our internal documentation site powered by the Appache's Forrest engine (forrest.apache.org). As the edoc's documentation doesn't mention the guidelines for creating custom layouts, is there any reference or samples with some helpful info (other than the *.erl sources)? I tried to call edoc:read/2, but it doesn't seem to work with otpsgml_layout: 23> pwd(). /opt/erlang/R11B-0/lib/erlang/lib/edoc-0.6.9/src ok 24> edoc:read("edoc_layout.erl", [{layout, edoc_layout}]). ["<!DOCTYPE HTML PUBLIC \"", "-//W3C//DTD HTML 4.01 Transitional//EN", ... ] 25> edoc:read("edoc_layout.erl", [{layout, otpsgml_layout}]). edoc: error in layout 'otpsgml_layout': {'EXIT',{badarg,[{erlang,binary_to_list,[{aname,[[82,105,99,104,97,114,100|...]]}]},{xmerl_lib,export_text,2},{xmerl_lib,export_text,2},{xmerl,apply_cb,5},{xmerl,export_content,2},{xmerl,export_content,2},{xmerl,export_content,2},{xmerl,export_content,2}]}}. ** exited: error ** Is my assumption correct that I would need to create a xxx_layout.erl module similar to otpsgml_layout, and then make the following call to generate edoc documentation using that layout: edoc:run([], ["my_file.erl"], [{layout, xxx_layout}]). I am only guessing because edoc:run/3 doesn't mention the {layout, Layout} option. Regards, Serge ]