halohalospecial / atom-elmjutsu

A bag of tricks for developing with Elm. (Atom package)
https://atom.io/packages/elmjutsu
MIT License
192 stars 24 forks source link

Generate documentation.json if not available from elm-lang.org #73

Closed stejanse closed 7 years ago

stejanse commented 7 years ago

I use elm-install for private packages in my Elm project. Those private packages are documented, but of course, the documentation.json is not available on elm-lang.org. Now I get an error as previewed in the image, and autocomplete does not work. It would be nice, if elmjitsu would generate the documentation.json itself using elm-make if it is not available from elm-lang.org.

image

halohalospecial commented 7 years ago

Hi! The workaround in the meantime is to generate a documentation file (elm-make --docs documentation.json) inside the package directory and copy that to the elmjutsu cache directory. For example, if you have msp-css, copy documentation.json to <elmjutsu-cache-directory>/docs/ep/msp-css/1.0.3/. You can set Cache Directory in the settings view.

Automatically generating the documentation.json may also be possible. How do we know where to run elm-make?

stejanse commented 7 years ago

@halohalospecial Thanks for the quick response and the workaround, that will work for now!

Don't have all packages the elm-package.json in the root of the package? Shouldn't that be the location to run elm-make --docs?

halohalospecial commented 7 years ago

@stejanse, the elm-make --docs approach did not work for packages that rely on other non-official packages. I tried a different approach with the latest version (v.5.6.0). Can you check if it satisfies your use cases :smiley_cat: Thanks!