erl_docgen-1.0.1
erl_docgen-1.0.1
erl_docgen-1.0.1
pdfdir
Relative path from the html directory to where the pdf file are placed.
Example:
Generate PDF
The generation of the PDF file is done in two steps. First is xsltproc used to generate a .fo file which is used as
input to the fop command to produce th PDF file.
Example:
Upcoming changes
The output from the erl_docgen documentation build process is now just the OTP style. But in a near future we
will for example add the possibility to change logo, color in the PDF and style sheet for the HTML.
<description>
<p>Some text..</p>
</description>
<include file="file1"></include>
<include file="file2"></include>
</part>
1.3.2 <part>
The top level tag of a part DTD.
Contains a <header>, an optional <description>, followed by one or more <include>.
1.3.3 <description>
The introduction after the title and before the bulk of included chapters/manual pages.
Contains any combination and any number of block tags except <image> and <table>.
1.3.4 <include>
An empty tag. The attribute file specifies a file to include. The .xml file extension should be omitted.
Example:
<include file="notes"></include>
<p>Introduction...</p>
<section>
<title>Title on second level</title>
<p>First paragraph.</p>
<section>
<title>Title on third level</title>
<p>...</p>
</section>
</section>
...
</chapter>
1.3.6 <chapter>
The top level tag of a chapter DTD.
Contains a <header>, an optional introduction consisting of any combination of block tags, followed by one or more
<section>.
1.3.7 <section>
Subdivision of a chapter.
Contains an optional <marker>, a <title>, followed by any combination and any number of block tags and <section
ghlink="maint/lib/erl_docgen/doc/src/user_guide_dtds.xml#L172">.
1.3.8 <title>
Section title, contains plain text.
<description>
<p>Application description...</p>
</description>
<include file="module1">
<include file="module2">
</application>
1.4.2 <application>
The top level tag of an application DTD.
Contains a <header>, an optional <description>, followed by one or more <include>.
<app>Application name</app>
<description>
<p>A longer description of the application.</p>
</description>
<section>
<title>Configuration</title>
<p>...</p>
</section>
...
<authors>
<aname>Name of author</aname>
<email>Email of author</email>
</authors>
</appref>
<appref>
The top level tag of an appref DTD.
Contains <header>, <app>, <appsummary>, <description>, zero or more <section> and <funcs>, followed by zero
or more <authors>.
<app>
The application name. Contains plain text.
<appsummary>
Short summary. Contains plain text.
<com>Command name</com>
<description>
<p>A long description of the command.</p>
</description>
<funcs>
<func>
<name>command</name>
<name>command -flag <arg></name>
<fsummary>A short command summary (max 40 characters).</fsummary>
<desc>
<p>An extended command description.
</desc>
</func>
</funcs>
<section>
<title>Options</title>
<p>...</p>
</section>
<authors>
<aname>Name of author</aname>
<email>Email of author</email>
</authors>
</comref>
<comref>
The top level tag for a comref DTD.
Contains <header>, <com>, <comsummary>, <description>, zero or more <section> and <funcs>, followed by zero
or more <authors>.
<com>
The command name. Contains plain text.
<comsummary>
Short summary. Contains plain text.
<description ghlink="maint/lib/erl_docgen/doc/src/refman_dtds.xml#L285">
<p>A longer description of the C library.</p>
</description>
<funcs>
<func ghlink="maint/lib/erl_docgen/doc/src/refman_dtds.xml#L290">
<name><ret>void</ret><nametext>start(bar)</nametext></name>
<name><ret>void</ret><nametext>start(foo)</nametext></name>
<fsummary>A short function summary (max 40 characters).</fsummary>
<type>
<v>char bar</v>
<v>int foo</v>
</type>
<desc>
<p>An extended function description.</p>
</desc>
</func>
...
</funcs>
<section ghlink="maint/lib/erl_docgen/doc/src/refman_dtds.xml#L306">
<title>A title</title>
<p>Some text...</p>
</section>
</cref>
<cref>
The top level tag for a cref DTD.
Contains <header>, <lib>, <libsummary>, <description>, zero or more <section> and <funcs>, followed by zero or
more <authors>.
<lib>
The C library name or acronym. Contains plain text.
<libsummary>
Short summary. Contains plain text.
<module>Module name</module>
<description>
<p>A longer description of the module.</p>
</description>
<funcs>
<func>
<name>start() -> Result</name>
<name>start(N) -> Result</name>
<fsummary>A short function summary (max 40 characters).</fsummary>
<type>
<v>Pid = pid()</v>
<v>N = int()</v>
<v>Result = {ok, Pid} | {error, Reason}</v>
<v>Reason = term()</v>
<d>A parameter description.</d>
</type>
<desc>
<p>An extended function description.</p>
</desc>
</func>
...
</funcs>
<section>
<title>Some Title</title>
<p>Some text...</p>
</section>
<authors>
<aname>Name of author</aname>
<email>Email of author</email>
</authors>
</erlref>
<erlref>
The top level tag for an erlref DTD.
Contains <header>, <module>, <modulesummary>, <description>, zero or more <section> and <funcs>, followed by
zero or more <authors>.
<module>
The module name. Contains plain text.
<modulesummary>
Short summary. Contains plain text.
<file>fileref</file>
<description>
<p>A longer description of the file.</p>
</description>
<section>
<title>File format</title>
<p>...</p>
</section>
<authors>
<aname>Name of author</aname>
<email>Email of author</email>
</authors>
</fileref>
The file reference manual can also contain function definitions, similar to the erlref DTD.
<fileref>
The top level tag for a fileref DTD.
Contains <header>, <file>, <filesummary>, <description>, zero or more <section> and <funcs>, followed by zero or
more <authors>.
<file>
The name of the file or file type. Contains plain text.
<filesummary>
Short summary. Contains plain text.
1.4.8 <description>
The introduction after the title and before sections and "formal" definitions.
Contains any combination and any number of block tags except <image> and <table>.
1.4.9 <section>
Subdivisions of the document. Contains an optional <marker>, a <title>, followed by any combination and any number
of block tags except <image> and <table>.
1.4.10 <funcs>
A group of "formal" function definitions.
Contains one or more <func>.
1.4.11 <func>
A "formal" function definition.
Contains one or more <name>, followed by <fsummary>, <type> (optional) and <desc> (optional).
1.4.12 <name>
Function/command signature with name, arguments and return value. Contains plain text, except for the cref DTD
where it contains a <ret> (return type, plain text) and a <nametext> (function name and arguments, plain text).
In the case of an erlref DTD, it will automatically be added a marker, <marker id="Name/Arity"> or
<marker id="Name">, based on the contents of this tag before the function definition.
Example: Consider the following name definition
Then a marker like this will be added <marker id="foo/2"> before the function definition in the generated
HTML. That is, referring to the function using <seemfa marker="#foo/2">foo/2</seemfa> will
automatically work.
1.4.13 <fsummary>
Function/command summary. Contains plain text, <c> and <em>.
1.4.14 <type>
Type declarations for the function/command.
Contains one or more pairs of <v> and <d> (optional).
1.4.15 <v>
Type declaration for an argument or return value. Contains plain text.
1.4.16 <d>
Description for an argument or return value. Contains plain text, <c> and <em>.
1.4.17 <desc>
Function/command description. Contains block tags except <image> and <table>.
1.4.18 <authors>
Authors of the manual page. The authors element is optional.
Contains one or more pairs of <aname> and <email>.
1.4.19 <aname>
Author name. Contains plain text.
1.4.20 <email>
Author email address. Contains plain text.
<header>
<copyright>...</copyright>
<legalnotice>...</legalnotice>
<title>...</title>
<prepared>...</prepared>
<responsible>...</responsible>
<docno>...</docno>
<approved>...</approved>
<checked>...</checked>
<date>...</date>
<rev>...</rev>
<file>...</file>
</header>
1.5.1 <header>
Top level tag for the header part.
1.5.2 <copyright>
The copyright element holds information about date(s) and holder(s) of a document copyright. The copyright
element is optional. The copyright element has an inner structure containing one or more year elements followed
by zero of more holder elements.
See example below:
<copyright>
<year>1997</year>
<year>2007</year>
<holder>Ericsson AB</holder>
</copyright>
1.5.3 <legalnotice>
The legalnotice element is used to express copyright, trademark, license, and other legal formalities of a
document. The element contains only PCDATA in the same manner as code and pre.
1.5.4 <title>
For part and application documents, this will be the title of the document, visible in the left frame and on the
front page.
For chapter documents, this will be the chapter name.
For reference manual documents, this tag is ignored.
1.5.5 <shorttitle>
This optional tag is ignored. It will likely be removed in the future.
1.5.6 <prepared>
This tag is intended for administrative use and is ignored.
1.5.7 <responsible>
This optional tag is intended for administrative use and is ignored.
1.5.8 <docno>
Document number.
For part and application documents, the document number is visible in the left frame and on the front page.
For other types of documents, this tag is ignored.
1.5.9 <approved>
This optional tag is intended for administrative use and is ignored.
1.5.10 <checked>
This optional tag is intended for administrative use and is ignored.
1.5.11 <date>
This tag is intended for administrative use and is ignored.
1.5.12 <rev>
Document version.
For part and application documents, the document version is visible in the left frame and on the front page.
For other types of documents, this tag is ignored.
1.5.13 <file>
This optional tag is intended for administrative use and is ignored.
Eat yourself<br/>senseless!
results in:
Eat yourself
senseless!
The <br> tag is both a block- and an inline tag.
<code>
sum([H|T]) ->
H + sum(T);
sum([]) ->
0.
</code>
results in:
sum([H|T]) ->
H + sum(T);
sum([]) ->
0.
There is an attribute type = "erl" | "c" | "none", but currently this attribute is ignored. Default value
is "none"
Note:
No tags are allowed within the tag and no character entities are expanded.
results in:
...
%% Erlang example
-module(example).
start() ->
{error,"Pid required!"}.
start(Pid) ->
spawn(fun() -> init(Pid) end).
%% Erlang example
...
<list type="ordered">
<item>Askosal:
<list>
<item>Nullalisis</item>
<item>Facilisis</item>
</list>
</item>
<item>Ankara</item>
</list>
results in:
• Askosal:
• Nullalisis
• Facilisis
• Ankara
results in:
I call specific attention to the authority given by the 21st Amendment to the Constitution to prohibit transportation
or importation of intoxicating liquors into any State in violation of the laws of such State.
<note>
<p>This function is mainly intended for debugging.</p>
</note>
results in:
Note:
This function is mainly intended for debugging.
<pre>
$ <input>erl</input>
Erlang (BEAM) emulator version 5.5.3 [async-threads:0] [hipe] [kernel-poll:false]
results in:
$ erl
Erlang (BEAM) emulator version 5.5.3 [async-threads:0] [hipe] [kernel-poll:false]
results in:
Whereas Section 217(a) of the Act of Congress entitled "An Act ..." approved June 16, 1933, provides as follows:
Section 217(a) The President shall proclaim the law.
<taglist>
<tag><c>eacces</c></tag>
<item>Permission denied.</item>
<tag><c>enoent</c></tag>
<item>No such file or directory.</item>
</taglist>
results in:
eacces
Permission denied.
enoent
No such file or directory.
<warning>
<p>This function might be removed in a future version without
prior warning.</p>
</warning>
results in:
Warning:
This function might be removed in a future version without prior warning.
<image file="man">
<icaption>A Silly Man</icaption>
</image>
results in:
<table>
<row>
<cell align="left" valign="top"><em>Boys</em></cell>
<cell align="center" valign="middle"><em>Girls</em></cell>
</row>
<row>
<cell align="left" valign="middle">Juda</cell>
<cell align="right" valign="bottom">Susy</cell>
</row>
<row>
<cell align="left" valign="middle">Anders</cell>
<cell align="left" valign="middle">Victoria</cell>
</row>
<tcaption>A table caption</tcaption>
</table>
results in:
Boys Girls
Juda Susy
Anders Victoria
results in:
Returns true if Term is an integer.
results in:
<marker id="marker_example"/>
<seemfa marker="stdlib:string#length/1">string:length/1</seemfa>
<seemfa marker="string#length/1">string:length/1</seemfa>
<seemfa marker="#length/1">string:length/1</seemfa>
<seeerl marker="stdlib:string">string(3)</seemfa>,
<seeerl marker="stdlib:string#oldapi">Old API in string</seemfa>
<seetype marker="stdlib:string#grapheme_cluster">string::grapheme_cluster()</seetype>
<seecom>
Points to the documentation of any command line utility. Example:
<seecom marker="erts:epmd">epmd</seecom>
<seecref marker="erts:erl_nif">erl_nif</seecref>
<seefile marker="kernel:config">config(3)</seefile>
results in: Kernel User's Guide Index, Logging in the Kernel User's Guide.
<url href="http://www.erlang.org">erlang.org</url>
¯ ¯ macron
± ± plus-or-minus
¸ ¸ cedilla
The different element types follow their HTML meaning when rendered. The following are some general rules for
how the chunk elements are allowed to be generated.
• Inline and pre elements are not allowed to contain block elements.
• p elements are not allowed to be nested.
The attributes on some elements have a special meaning.
{'div',[{class,unicode:unicode_binary()}],_}
The class name will be used to provide styling to the content in the div. The types of classes used by Erlang/
OTP are: warning, note, do, dont and quote.
{ul,[{class,<<"types">>}],_}
This is a list containing type documentation.
{li,[{name,TypeName :: unicode:unicode_binary()}],_}
A list item with a type specification located in the metadata of this modules EEP-48 documentation. The
implementation should look for the AST representation of the type under the types key. This attribute is only
valid under a ul with class <<"types">>.
{li,[{class,<<"type">>}],_}
A list item with the type described in the Erlang Documentation Format. This attribute is only valid under a ul
with class <<"types">>.
{li,[{class,<<"description">>}],_}
A list item with the description of the type previous in the list. This attribute is only valid under a ul with class
<<"types">>.
The shell_docs:validate/1 function can be used to do a validation of the Erlang Documentation Format.
equiv := {Type,Name,Arity}
The current function/type shares documentation with another function/type. This means that if this and the
target function/type are to be shown at the same time only the prototype of this function/type should will
be displayed and the documentation will use a common body of text.
2 Reference Manual
The erl_docgen supports the OTP documentation build.
erl_docgen
Application