Skip to content
Browse files

add support for edoc layout options (refs #544)

  • Loading branch information...
1 parent b6d7bbb commit d60887f24daacfd4f01502f39efbf7543e837849 @fjl committed Aug 11, 2011
Showing with 23 additions and 5 deletions.
  1. +11 −4 README.md
  2. +2 −0 src/tetrapak.app.src
  3. +10 −1 src/tetrapak_task_doc.erl
View
15 README.md
@@ -56,20 +56,27 @@ Defaults to `false`.
-------------------------------------------------------------------------
- edoc.hidden :: boolean()
+ edoc.todo :: boolean()
-Whether documentation for hidden functions shall be generated.
+Whether `@todo` notes should be included in the documentation.
Defaults to `false`.
-------------------------------------------------------------------------
- edoc.todo :: boolean()
+ edoc.sort_functions :: boolean()
-Whether `@todo` notes should be included in the documentation.
+Whether functions should be sorted alphabetically.
Defaults to `false`.
-------------------------------------------------------------------------
+ edoc.pretty_print :: boolean()
+
+Whether type specs and signatures should be pretty-printed.
+Defaults to `true`.
+
+-------------------------------------------------------------------------
+
package.outdir :: string()
The directory where built packages are placed. This directory
View
2 src/tetrapak.app.src
@@ -54,6 +54,8 @@
{"edoc.private", false},
{"edoc.hidden", false},
{"edoc.todo", false},
+ {"edoc.pretty_print", true},
+ {"edoc.sort_functions", false},
{"test.ct.srcdir", "test"},
{"test.ct.logdir", "test-log"},
{"test.ct.suite", "all"},
View
11 src/tetrapak_task_doc.erl
@@ -15,6 +15,11 @@ check("clean:edoc") ->
filelib:is_dir(tetrapak:config_path("edoc.outdir")).
run("doc:edoc", _) ->
+ case tetrapak:config("edoc.pretty_print") of
+ true -> PPOpts = [{pretty_printer, erl_pp}];
+ false -> PPOpts = []
+ end,
+
DD = tetrapak:config_path("edoc.outdir"),
tpk_file:mkdir(DD),
edoc:application(tetrapak:get("config:appfile:name"),
@@ -23,7 +28,11 @@ run("doc:edoc", _) ->
{includes, [tetrapak:subdir("include")]},
{private, tetrapak:config("edoc.private")},
{hidden, tetrapak:config("edoc.hidden")},
- {todo, tetrapak:config("edoc.todo")}]);
+ {todo, tetrapak:config("edoc.todo")},
+
+ %% layout options
+ {sort_functions, tetrapak:config("edoc.sort_functions")}
+ | PPOpts]);
run("clean:edoc", _) ->
DD = tetrapak:config_path("edoc.outdir"),

0 comments on commit d60887f

Please sign in to comment.
Something went wrong with that request. Please try again.