Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong figure path when filename has dot #7

Closed
rmsrosa opened this issue Mar 6, 2022 · 9 comments
Closed

wrong figure path when filename has dot #7

rmsrosa opened this issue Mar 6, 2022 · 9 comments
Labels
bug Something isn't working

Comments

@rmsrosa
Copy link
Owner

rmsrosa commented Mar 6, 2022

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.

@rmsrosa rmsrosa added the bug Something isn't working label Mar 6, 2022
@rmsrosa
Copy link
Owner Author

rmsrosa commented Mar 6, 2022

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

@tlienart
Copy link
Collaborator

tlienart commented Mar 6, 2022

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.

@rmsrosa
Copy link
Owner Author

rmsrosa commented Mar 6, 2022

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")

@tlienart
Copy link
Collaborator

tlienart commented Mar 6, 2022

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

@tlienart
Copy link
Collaborator

tlienart commented Mar 7, 2022

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

@rmsrosa
Copy link
Owner Author

rmsrosa commented Mar 7, 2022

Yeah, It works fine with the version in master!

@rmsrosa
Copy link
Owner Author

rmsrosa commented Mar 7, 2022

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.

@tlienart
Copy link
Collaborator

tlienart commented Mar 8, 2022

Yes I'll release a patch today

@rmsrosa
Copy link
Owner Author

rmsrosa commented Mar 9, 2022

Fixed in the new version 0.10.71 of Franklin. Thanks!

@rmsrosa rmsrosa closed this as completed Mar 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants