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
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/priv/ex_doc/formatter/html/assets/dist/* -diff
/formatters/html/dist/* -diff
/formatters/html/dist/* -diff
4 changes: 0 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,9 @@ matrix:
notifications:
recipients:
- jose.valim@plataformatec.com.br
before_install:
- nvm install 5.10.0
before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- npm install -g npm
- npm install
env:
- MIX_ENV=test
script:
Expand Down
8 changes: 4 additions & 4 deletions assets/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Assets

In this directory live all assets for `ExDoc`. The ready to use built
versions are found in `priv/ex_doc/formatter/{html,epub}/assets/dist`. To
change any of them read please read the following instructions:
versions are found in `formatters/{html,epub}/dist`. To change any of
them read please read the following instructions:

## Dependencies

To work on these assets you need to install [Node.js] and [npm] first (probably
as superuser or administrator). After that execute the following commands:

```bash
$ npm install -g gulp
$ npm install
$ yarn global add gulp
$ yarn install
```

Now many gulp tasks are available via the `gulp` command line.
Expand Down
2 changes: 1 addition & 1 deletion assets/js/templates/search-results.handlebars
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<h1>Search Results for <em>{{value}}</em></h1>

{{#if empty}}
Sorry, we couldn't find anything for <em>{{value}}</em>.
<p>Sorry, we couldn't find anything for <em>{{value}}</em>.</p>
{{else}}
{{#each levels}}
<h2 class="results-title">{{name}}</h2>
Expand Down

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions formatters/html/dist/app-c922dbe7ef.css

Large diffs are not rendered by default.

14 changes: 4 additions & 10 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ var environment = $.util.env.type || 'development'
var isProduction = environment === 'production'

var distPath = {
html: 'priv/ex_doc/formatter/html/assets/dist',
epub: 'priv/ex_doc/formatter/epub/assets/dist'
html: 'formatters/html/dist',
epub: 'formatters/epub/dist'
}

var npmPlugin = new LessPluginNpmImport()
Expand All @@ -52,18 +52,12 @@ var languages = [
// -----

gulp.task('buildHighlight', function (done) {
exec('npm install', {
exec('node tools/build.js -n ' + languages.join(' '), {
cwd: './node_modules/highlight.js'
}, function (err, stdout, stderr) {
if (err) return done(err)

exec('node tools/build.js -n ' + languages.join(' '), {
cwd: './node_modules/highlight.js'
}, function (err, stdout, stderr) {
if (err) return done(err)

done()
})
done()
})
})

Expand Down
4 changes: 1 addition & 3 deletions lib/ex_doc/formatter/epub/assets.ex
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
defmodule ExDoc.Formatter.EPUB.Assets do
@moduledoc false

@assets_dir Application.app_dir(:ex_doc, "priv/ex_doc/formatter/epub/assets")

defmacrop embed_pattern(pattern) do
[@assets_dir, pattern]
["formatters/epub", pattern]
|> Path.join()
|> Path.wildcard()
|> Enum.map(&{Path.basename(&1), File.read!(&1)})
Expand Down
4 changes: 1 addition & 3 deletions lib/ex_doc/formatter/html/assets.ex
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
defmodule ExDoc.Formatter.HTML.Assets do
@moduledoc false

@assets_dir Application.app_dir(:ex_doc, "priv/ex_doc/formatter/html/assets")

defmacrop embed_pattern(pattern) do
[@assets_dir, pattern]
["formatters/html", pattern]
|> Path.join()
|> Path.wildcard()
|> Enum.map(&{Path.basename(&1), File.read!(&1)})
Expand Down
1 change: 0 additions & 1 deletion priv/ex_doc/formatter/html/assets/dist/app-110d9134a6.css

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion test/ex_doc/formatter/epub/templates_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ defmodule ExDoc.Formatter.EPUB.TemplatesTest do

setup_all do
File.mkdir_p!("test/tmp/epub_templates/OEBPS")
File.cp_r!("priv/ex_doc/formatter/epub/assets", "test/tmp/epub_templates/OEBPS")
File.cp_r!("formatters/epub", "test/tmp/epub_templates/OEBPS")
:ok
end

Expand Down
2 changes: 1 addition & 1 deletion test/ex_doc/formatter/html/templates_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ defmodule ExDoc.Formatter.HTML.TemplatesTest do

setup_all do
File.mkdir_p!("test/tmp/html_templates")
File.cp_r!("priv/ex_doc/formatter/html/assets", "test/tmp/html_templates")
File.cp_r!("formatters/html", "test/tmp/html_templates")
File.touch!("test/tmp/html_templates/dist/sidebar_items-123456.js")
:ok
end
Expand Down
Loading