Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion assets/js/epub.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
import hljs from 'highlight.js/build/highlight.pack'

hljs.initHighlightingOnLoad()

2 changes: 1 addition & 1 deletion lib/ex_doc/markdown/cmark.ex
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ defmodule ExDoc.Markdown.Cmark do
Generate HTML output. Cmark takes no options.
"""
def to_html(text, _opts) do
Cmark.to_html(text) |> ExDoc.Markdown.pretty_codeblocks
text |> Cmark.to_html() |> ExDoc.Markdown.pretty_codeblocks()
end
end
2 changes: 1 addition & 1 deletion lib/ex_doc/markdown/earmark.ex
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ defmodule ExDoc.Markdown.Earmark do
file: Keyword.get(opts, :file),
breaks: Keyword.get(opts, :breaks, false),
smartypants: Keyword.get(opts, :smartypants, true))
Earmark.as_html!(text, options) |> ExDoc.Markdown.pretty_codeblocks
text |> Earmark.as_html!(options) |> ExDoc.Markdown.pretty_codeblocks()
end
end
4 changes: 2 additions & 2 deletions lib/ex_doc/retriever.ex
Original file line number Diff line number Diff line change
Expand Up @@ -433,8 +433,8 @@ defmodule ExDoc.Retriever do
end
end

defp anno_line(line) when is_integer(line), do: line |> abs()
defp anno_line(anno), do: :erl_anno.line(anno) |> abs()
defp anno_line(line) when is_integer(line), do: abs(line)
defp anno_line(anno), do: anno |> :erl_anno.line() |> abs()

# Detect if a module is an exception, struct,
# protocol, implementation or simply a module
Expand Down
14 changes: 7 additions & 7 deletions test/ex_doc/formatter/html_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ defmodule ExDoc.Formatter.HTMLTest do
assert File.regular?("#{output_dir()}/CompiledWithDocs.html")
assert File.regular?("#{output_dir()}/CompiledWithDocs.Nested.html")

assert [_] = "#{output_dir()}/dist/app-*.css" |> Path.wildcard
assert [_] = "#{output_dir()}/dist/app-*.js" |> Path.wildcard
assert [] = "#{output_dir()}/another_dir/dist/app-*.js.map" |> Path.wildcard
assert [_] = Path.wildcard("#{output_dir()}/dist/app-*.css")
assert [_] = Path.wildcard("#{output_dir()}/dist/app-*.js")
assert [] = Path.wildcard("#{output_dir()}/another_dir/dist/app-*.js.map")

content = File.read!("#{output_dir()}/index.html")
assert content =~ ~r{<meta http-equiv="refresh" content="0; url=api-reference.html">}
Expand All @@ -145,9 +145,9 @@ defmodule ExDoc.Formatter.HTMLTest do
assert File.regular?("#{output_dir()}/another_dir/CompiledWithDocs.html")
assert File.regular?("#{output_dir()}/another_dir/RandomError.html")

assert [_] = "#{output_dir()}/another_dir/dist/app-*.css" |> Path.wildcard
assert [_] = "#{output_dir()}/another_dir/dist/app-*.js" |> Path.wildcard
assert [_] = "#{output_dir()}/another_dir/dist/app-*.js.map" |> Path.wildcard
assert [_] = Path.wildcard("#{output_dir()}/another_dir/dist/app-*.css")
assert [_] = Path.wildcard("#{output_dir()}/another_dir/dist/app-*.js")
assert [_] = Path.wildcard("#{output_dir()}/another_dir/dist/app-*.js.map")

content = File.read!("#{output_dir()}/another_dir/index.html")
assert content =~ ~r{<meta http-equiv="refresh" content="0; url=RandomError.html">}
Expand Down Expand Up @@ -228,7 +228,7 @@ defmodule ExDoc.Formatter.HTMLTest do
test "before_closing_*_tags are placed in the right place - generated pages" do
config = doc_config([main: "readme"])
generate_docs(config)

content = File.read!("#{output_dir()}/readme.html")
assert content =~ ~r[#{@before_closing_head_tag_content_html}\s*</head>]
assert content =~ ~r[#{@before_closing_body_tag_content_html}\s*</body>]
Expand Down
8 changes: 6 additions & 2 deletions test/ex_doc_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ defmodule ExDocTest do
test "build_config & normalize_options" do
project = "Elixir"
version = "1"
options = [formatter: IdentityFormatter, retriever: IdentityRetriever,
source_root: "root_dir", source_beam: "beam_dir",]
options = [
formatter: IdentityFormatter,
retriever: IdentityRetriever,
source_root: "root_dir",
source_beam: "beam_dir",
]

{_, config} = ExDoc.generate_docs project, version, Keyword.merge(options, [output: "test/tmp/ex_doc"])
assert config.output == "test/tmp/ex_doc"
Expand Down