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

consecutive (or custom) image filenames #204

Closed
tpapp opened this issue Sep 21, 2022 · 6 comments · Fixed by #205
Closed

consecutive (or custom) image filenames #204

tpapp opened this issue Sep 21, 2022 · 6 comments · Fixed by #205

Comments

@tpapp
Copy link
Contributor

tpapp commented Sep 21, 2022

Currently image filenames are calculated using a hash. This is useful, but when working on a document incrementally, the directory gets cluttered with a bunch of files that are no longer used.

Would it make sense to have an option to consecutively generates filenames with a counter? Eg 1.svg, 2.svg, etc.

@fredrikekre
Copy link
Owner

Sure, that is maybe better anyway. The idea with the hash was that you would have some connection between the code that generated the file, but not sure that is so useful.

@fredrikekre
Copy link
Owner

If you run multiple Literate files in the same directory you would get name-clashes though, which the current approach minimizes I guess. Documenter just uses a random number, but not sure that is much better than the current hash method.

@tpapp
Copy link
Contributor Author

tpapp commented Sep 22, 2022

Yes, I would prefer the clashing filenames to be silently overwritten. I would not recommend this as the default though.

@fredrikekre
Copy link
Owner

The names could perhaps be ${outputfilename}-${blocknumber}.svg, that would avoid clashes.

@tpapp
Copy link
Contributor Author

tpapp commented Sep 22, 2022

Yes, that would be perfect for my purposes.

fredrikekre added a commit that referenced this issue Sep 22, 2022
When executing markdown (Literate.markdown(...; execute=true) images
where previously saved to files where the name was based on the hash of
the source block. This patch changes this such that files instead follow
the format {name}-{blocknumber}.(svg|png|...). Closes #204.
fredrikekre added a commit that referenced this issue Sep 22, 2022
When executing markdown (Literate.markdown(...; execute=true) images
where previously saved to files where the name was based on the hash of
the source block. This patch changes this such that files instead follow
the format {name}-{blocknumber}.(svg|png|...). Closes #204.
@fredrikekre
Copy link
Owner

Fixed in #205, released in 2.14.0 (JuliaRegistries/General#68765).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants