rmsrosa/booksjl-franklin-template

wrong figure path when filename has dot

rmsrosa opened this issue · 9 comments

Franklin is not resolving properly the path to a generated figure when the filename contains an extra dot.

For instance, in https://rmsrosa.github.io/booksjl-franklin-template/pages/1.franklinmd/ , the final plot is not loaded, and the path is missing a slash. The figure is generated properly and in the correct place, but the path is wrong. The filename is 1.franklinmd.md. When it is just franklinmd.md, the path is fine.

That is apparently a bug in Franklin. I should file an issue there.

Can you try adding .svg so \fig{sin.svg} and report?

Assuming that fixes it, I'll try to see if we can add guards against this, note however that having dots in a file path is generally not a great thing to do as the behaviour of things like Julia's splitext becomes less predictable, so I'll probably also add a note in the docs encouraging users not to that.

Same problem with \fig{sin.svg}.

Yeah, I can just avoid extra dots.

But I do have to say that I didn't expect it to be a problem, as, for instance, there is foo.tar.gz; files with version numbers, like julia-1.8.0-beta1-macaarch64.dmg; and section numbering, like I had in 01.00-Introduction.ipynb. And splitext works just fine with that:

julia> splitext("1.franklinmd.md")
("1.franklinmd", ".md")

Splitext is not the problem, rather what \fig does in terms of assumptions when there does or does not seem to be an explicit extension (and these assumptions are based on the use of splitext).

However, the fact that giving .svg explicitly doesn't help might mean it's something else going on, I'm away from computer but will check this out. Thanks for reporting

This should be fixed on master, could you please try it and report if there's an issue? assuming the issue is fixed I'll do a patch release.

Thanks a lot for the bug report

Yeah, It works fine with the version in master!

Well, Manifest.toml is ignored, so I guess the gh-action will not use master and it won't work properly, but locally it is working fine.

Yes I'll release a patch today

Fixed in the new version 0.10.71 of Franklin. Thanks!