File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
ex_doc/formatter/markdown Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -35,11 +35,16 @@ defmodule ExDoc do
3535 end
3636
3737 defp find_formatter ( name ) do
38- [ ExDoc.Formatter , String . upcase ( name ) ]
38+ [ ExDoc.Formatter , format_module_name ( name ) ]
3939 |> Module . concat ( )
4040 |> check_formatter_module ( name )
4141 end
4242
43+ defp format_module_name ( "html" ) , do: "HTML"
44+ defp format_module_name ( "epub" ) , do: "EPUB"
45+ defp format_module_name ( "markdown" ) , do: "Markdown"
46+ defp format_module_name ( name ) , do: String . upcase ( name )
47+
4348 defp check_formatter_module ( modname , argname ) do
4449 if Code . ensure_loaded? ( modname ) do
4550 modname
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ defmodule ExDoc.Formatter.Markdown.Templates do
2626 def module_type ( % { type: type } = _node ) , do: "(#{ type } )"
2727
2828 @ doc """
29- Formats the attribute type used to define the spec of the given `node`.
29+ Formats the attribute type used to define the spec of the given `node`.
3030 """
3131 def format_spec_attribute ( module , node ) do
3232 module . language . format_spec_attribute ( node )
@@ -149,7 +149,7 @@ defmodule ExDoc.Formatter.Markdown.Templates do
149149 @ spec synopsis ( nil ) :: nil
150150 def synopsis ( doc ) when is_binary ( doc ) do
151151 case :binary . split ( doc , "\n \n " ) do
152- [ left , _ ] -> String . trim_trailing ( left ) |> String . trim_trailing ( left , ":" ) <> "\n \n "
152+ [ left , _ ] -> ( String . trim_trailing ( left ) |> String . trim_trailing ( ":" ) ) <> "\n \n "
153153 [ all ] -> all
154154 end
155155 end
You can’t perform that action at this time.
0 commit comments