fredrikekre / Literate.jl

Simple package for literate programming in Julia
https://fredrikekre.github.io/Literate.jl
Other
543 stars 64 forks source link

consecutive (or custom) image filenames #204

Closed tpapp closed 2 years ago

tpapp commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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

fredrikekre commented 2 years ago

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

tpapp commented 2 years ago

Yes, that would be perfect for my purposes.

fredrikekre commented 2 years ago

Fixed in https://github.com/fredrikekre/Literate.jl/pull/205, released in 2.14.0 (https://github.com/JuliaRegistries/General/pull/68765).