Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

55 Zeilen
2.3 KiB

vor 14 Jahren
vor 14 Jahren
  1. %% -*- erlang-indent-level: 4;indent-tabs-mode: nil -*-
  2. %% ex: ts=4 sw=4 et
  3. %% -------------------------------------------------------------------
  4. %%
  5. %% rebar: Erlang Build Tools
  6. %%
  7. %% Copyright (c) 2010 Dave Smith (dizzyd@dizzyd.com)
  8. %%
  9. %% Permission is hereby granted, free of charge, to any person obtaining a copy
  10. %% of this software and associated documentation files (the "Software"), to deal
  11. %% in the Software without restriction, including without limitation the rights
  12. %% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13. %% copies of the Software, and to permit persons to whom the Software is
  14. %% furnished to do so, subject to the following conditions:
  15. %%
  16. %% The above copyright notice and this permission notice shall be included in
  17. %% all copies or substantial portions of the Software.
  18. %%
  19. %% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  20. %% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  21. %% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  22. %% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  23. %% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  24. %% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  25. %% THE SOFTWARE.
  26. %% -------------------------------------------------------------------
  27. %% @author Dave Smith <dizzyd@dizzyd.com>
  28. %% @doc rebar_edoc supports the following command:
  29. %% <ul>
  30. %% <li>doc (essentially erl -noshell -run edoc_run application
  31. %% "'$(&lt;app_name&gt;)'"
  32. %% '"."' '[&lt;options&gt;]')</li>
  33. %% </ul>
  34. %% EDoc options can be given in the <code>edoc_opts</code> option in
  35. %% <code>rebar.config</code>.
  36. %% @copyright 2010 Dave Smith
  37. %% -------------------------------------------------------------------
  38. -module(rebar_edoc).
  39. -export([doc/2]).
  40. -include("rebar.hrl").
  41. %% ===================================================================
  42. %% Public API
  43. %% ===================================================================
  44. %% @doc Generate Erlang program documentation.
  45. %% @spec doc(#config{}, string()) -> ok
  46. -spec(doc(Config::#config{}, File::string()) -> ok).
  47. doc(Config, File) ->
  48. {ok, AppName, _AppData} = rebar_app_utils:load_app_file(File),
  49. EDocOpts = rebar_config:get(Config, edoc_opts, []),
  50. ok = edoc:application(AppName, ".", EDocOpts),
  51. ok.