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
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,16 @@ Update your project configuration to use Cmark:
docs: [markdown_processor: ExDoc.Markdown.Cmark]
```

# License
## Contributing

The easiest way to test changes to ExDoc is to locally re-generate it's own docs:

1. Run `mix setup` to install all dependencies
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mix setup uses just npm, however in https://github.com/elixir-lang/ex_doc/blob/master/assets/README.md#dependencies we mention yarn. I think we can assume folks installed yarn, so mix setup calls yarn install etc; wdyt?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. We should use yarn. But I think after the first install they would behave the same.

2. Run `mix docs` to generate docs. Note, ExDoc defines `docs` alias for local development,
see [`mix.exs`](./mix.exs) for more details
3. Commit both `assets/*` and (after running `mix docs`) `formatters/*` changes

## License

ExDoc source code is released under Apache 2 License. The generated contents, however, are under different licenses based on projects used to help render HTML, including CSS, JS, and other assets.

Expand Down
2 changes: 0 additions & 2 deletions formatters/epub/dist/app-6d5e229d3d.js

This file was deleted.

2 changes: 2 additions & 0 deletions formatters/epub/dist/app-bbb6f0765d.js

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions formatters/html/dist/app-9bd040e5e5.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions formatters/html/dist/app-9bd040e5e5.js.map

Large diffs are not rendered by default.

8 changes: 0 additions & 8 deletions formatters/html/dist/app-d5aabd004a.js

This file was deleted.

1 change: 0 additions & 1 deletion formatters/html/dist/app-d5aabd004a.js.map

This file was deleted.

25 changes: 23 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ defmodule ExDoc.Mixfile do

defp aliases do
[
clean: [&clean_test_fixtures/1, "clean"]
clean: [&clean_test_fixtures/1, "clean"],
setup: ["deps.get", &setup_assets/1],
docs: [&maybe_build_assets/1, "compile --force", "docs"]
]
end

Expand Down Expand Up @@ -85,6 +87,25 @@ defmodule ExDoc.Mixfile do
end

defp clean_test_fixtures(_args) do
File.rm_rf "test/tmp"
File.rm_rf("test/tmp")
end

defp setup_assets(_args) do
cmd("yarn", ~w(install))
end

defp maybe_build_assets(_args) do
if Mix.env() == :dev do
cmd("yarn", ~w(run build))
end
end

defp cmd(cmd, args, opts \\ []) do
opts = Keyword.merge([into: IO.stream(:stdio, :line), stderr_to_stdout: true], opts)
{_, result} = System.cmd(cmd, args, opts)

if result != 0 do
raise "Non-zero result (#{result}) from: #{cmd} #{Enum.map_join(args, " ", &inspect/1)}"
end
end
end
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2364,9 +2364,9 @@ hawk@~6.0.2:
hoek "4.x.x"
sntp "2.x.x"

highlight.js@isagalaev/highlight.js#9.12.0:
highlight.js@elixir-lang/highlight.js#278960a2ca:
version "9.12.0"
resolved "https://codeload.github.com/isagalaev/highlight.js/tar.gz/16ab6f3b5f9a432e6e8825807103b6bb5cefef15"
resolved "https://codeload.github.com/elixir-lang/highlight.js/tar.gz/278960a2ca269fab9aad39dfe1a9dccbb0bd6027"

hoek@0.9.x:
version "0.9.1"
Expand Down