aboutsummaryrefslogtreecommitdiffstats
path: root/lib/edoc/src/edoc.hrl
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2010-06-22 09:42:44 +0200
committerHans Bolinder <[email protected]>2011-03-10 12:57:37 +0100
commit8052b98f596db048467c0c57cbaac1d3a27687ad (patch)
tree144fcf14894c8a5c7df3778d7b1d91fa6a72a1cb /lib/edoc/src/edoc.hrl
parentcc5885e81da81dc52bd7890ff3612a48d2f4a9f2 (diff)
downloadotp-8052b98f596db048467c0c57cbaac1d3a27687ad.tar.gz
otp-8052b98f596db048467c0c57cbaac1d3a27687ad.tar.bz2
otp-8052b98f596db048467c0c57cbaac1d3a27687ad.zip
Make Erlang specifications and types available in EDoc
It is now possible to use Erlang specifications and types in EDoc documentation. Erlang specifications and types will be used unless there is also a function specification (@spec) or a type alias (@type) with the same name. In the current implementation the placement of -spec matters: it should be placed where the @spec would otherwise have been placed. Not all Erlang types are included in the documentation, but only those exported by some export_type declaration or used by some documented Erlang specification (-spec). There is currently no support for overloaded Erlang specifications. The syntax definitions of EDoc have been augmented to cope with most of the Erlang types. (But we recommend that Erlang types should be used instead.) edoc:read_source() takes one new option, report_missing_types. edoc_layout:module() takes one new option, pretty_printer.
Diffstat (limited to 'lib/edoc/src/edoc.hrl')
-rw-r--r--lib/edoc/src/edoc.hrl11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/edoc/src/edoc.hrl b/lib/edoc/src/edoc.hrl
index 71cc1a52b9..43657b3b8f 100644
--- a/lib/edoc/src/edoc.hrl
+++ b/lib/edoc/src/edoc.hrl
@@ -37,6 +37,7 @@
-define(SOURCE_DIR, "src").
-define(EBIN_DIR, "ebin").
-define(EDOC_DIR, "doc").
+-define(REPORT_MISSING_TYPE, false).
-include("edoc_doclet.hrl").
@@ -83,10 +84,11 @@
%% Module Entries (one per function, plus module header and footer)
-%% @type entry() = #entry{name = atom(),
-%% args = [string()],
+%% @type entry() = #entry{{atom(), integer()} % function
+%% | name = atom(), % other
+%% args = [atom()],
%% line = integer(),
-%% export = bool(),
+%% export = boolean(),
%% data = term()}
-record(entry, {name, args = [], line = 0, export, data}).
@@ -95,6 +97,7 @@
%% @type tag() = #tag{name = atom(),
%% line = integer(),
+%% origin = comment | code,
%% data = term()}
--record(tag, {name, line = 0, data}).
+-record(tag, {name, line = 0, origin = comment, data}).