Skip to content

Commit c1345d0

Browse files
author
José Valim
committed
Generate markdown.so into priv directory
1 parent 0cebe7f commit c1345d0

File tree

5 files changed

+5
-7
lines changed

5 files changed

+5
-7
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
ebin/
2-
html/
32
test/tmp
43
*.o
54
*.so

Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,12 @@ NIF_SRC=\
3434

3535
clean:
3636
rm -f sundown/src/*.o sundown/html/*.o src/*.o
37-
rm -f share/markdown.so
37+
rm -f priv/markdown.so
3838
rm -rf $(EBIN_DIR)
3939
rm -rf test/tmp
4040
@ echo
4141

42-
43-
share/markdown.so: sundown/libsundown.so ${NIF_SRC}
42+
priv/markdown.so: sundown/libsundown.so ${NIF_SRC}
4443
$(CC) $(CFLAGS) $(ERLANG_FLAGS) -shared $(OPTIONS) -o $@ $(SUNDOWN_OBJS) $(NIF_SRC)
4544

4645
.PHONY: clean

lib/markdown.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ defmodule Markdown do
22
@on_load { :init, 0 }
33

44
def init do
5-
file = Path.expand('../../share/markdown', __FILE__)
6-
:ok = :erlang.load_nif(String.to_char_list!(file), 1)
5+
path = :filename.join(:code.priv_dir(:ex_doc), 'markdown')
6+
:ok = :erlang.load_nif(path, 1)
77
end
88

99
def to_html(_) do

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ defmodule Mix.Tasks.Compile.Sundown do
22
@shortdoc "Compiles sundown that ships with ExDoc"
33

44
def run(_) do
5-
Mix.shell.info System.cmd("make share/markdown.so")
5+
Mix.shell.info System.cmd("make priv/markdown.so")
66
end
77
end
88

File renamed without changes.

0 commit comments

Comments
 (0)