What's the best way of referencing third-party packages in another 
directory on the same machine? I'm talking about a package that isn't 
available in the community package directory, but is available on GitHub. I 
realize YMMV with such packages. Specifically, in this case, 
https://github.com/bsouthga/elm-katex.

I tried creating a symlink in my project to it, and adding its source 
directory to my elm-package.json, along with the native-modules: true flag.

The problem is that var _bsouthga$elm_katex$Native_KaTeX is hard-coded in 
the native JS file. But when I build my project, because I'm using the 
default project URL, it gets referenced as _user$project$Native_KaTeX, 
which doesn't match. It seems the author was 
copying 
https://github.com/evancz/elm-markdown/blob/master/src/Native/Markdown.js, 
which uses the same convention. However, since that file is a community 
package, when it's installed by the package manager, it will actually get 
referenced correctly.

So I wonder if I can use elm-package to install a package from another 
directory, so hopefully the references will work out right?

Another possibility is given by looking 
at 
https://github.com/eeue56/take-home/wiki/Writing-your-first-Elm-Native-module. 
Here the author shows some very different boilerplate, which doesn't seem 
to involve the project name in the variable names. I'd have to copy the 
elm-katex code into my own project and tweak it a bit, but that's OK for 
now as I'll only be building/running my project locally for the foreseeable 
future. Also I'd be able to update the version of KaTeX that's embedded in 
the file.

Any other thoughts?

Thanks,
Lyle

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to