We first tried to display them directly, as we would do for (generated) figure. We also tried copying the generated gif file to the build directory. None of these methods work, though both solutions are properly displayed locally.
I’ve had no problems, treating animated GIF files exactly the same as PNGs and JPGs. I can create them beforehand, or have them created as part of the Documenter run: in the MarkDown source, I can save newly-created files into the docs/src/assets/ hierarchy:
Sorry for insisting, can you provide more details or a link? I haven’t been able to work it out.
For completeness, this is the @example block we have
@example
anim1 = @animate for i=1:20
...
end
gif(anim1, "anim1.gif", fps = 2)
I’ve tried with no success to include pathname inside the gif() clause when saving the animation, or saving it in the build/assets directory, which throws an error.
Note, you can’t save into the build/ folder, because that’s deleted each time you start the Documenter run. I assume that it looks in the docs/src/ folder.
I agree that the gif is created properly. The generation of the docs works fine on my local machine; the problem appears when the documentation is generated by travis.
I noticed that the gif files are (locally) saved in the build/ directory, but they do not make it into the gh-pages branch. Maybe the simplest solution is to save the gifs (statically) so they are in the repo, and link the displayed animation to those files.