edoc custom XML layout

Serge Aleynikov <>
Sat Jun 24 17:31:17 CEST 2006


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 

23> pwd().
24> edoc:read("edoc_layout.erl", [{layout, edoc_layout}]).
  "-//W3C//DTD HTML 4.01 Transitional//EN",

25> edoc:read("edoc_layout.erl", [{layout, otpsgml_layout}]).
edoc: error in layout 'otpsgml_layout': 
** 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.



More information about the erlang-questions mailing list