Documentation: Image file cleanup

Bug #1374453 reported by Josh Stompro on 2014-09-26
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Undecided
Unassigned

Bug Description

I would like to rename all image files so that the file extensions are lower case to avoid issues in the future on systems that are case sensitive.

I also noticed that there are many orphan images under docs/media/.

If I list all the images that have uppercase extensions I find 39 results.
find ./ |egrep ".*\.(PNG|JPG)$" |wc

If I list all the images that are linked to in the documentation with uppercase extensions I find 15 results.
egrep -r "::media.*\.(JPG|PNG)" |less

So there are 24 images that are not referenced in the docs.

Unless there is a good reason to keep these around I would like to remove them. Or maybe just move them to /media/old.

Josh

I did a search to find all the images that were not referenced in the documentation and found 400 images that were not being used.

I moved them to /media/unused/ to keep them out of the way, but still available.

I renamed all uppercase image extensions to lowercase and fixed the doc links.

Pull request with two commits on github.
https://github.com/evergreen-library-system/Evergreen/pull/30

Copying the comments on Github to here to keep them in one spot.

remocrevo commented on Oct 3rd 2014
Thanks for your work on the docs, Josh. I appreciate the intention here. Since this commit is just "cleanup", I want to make sure we don't throw out any babies with the bath water. Robert Soulliere alerted me that some of these images may be automatically used in processing the docs, even though they aren't referenced in any AsciiDoc files. So we would need to confirm with Robert which are which before merging these commits. Some may be fairly obvious based on the filename, so I'm not opposed to moving those first and checking on the rest later. But that would require changing the commit and submitting it again. Let us know what you'd like to do.

 stompro commented on Oct 3rd 2014
Could you check with Robert to see what he would prefer? If he could tell me which images to leave alone I would exclude those and resubmit. But if that would take too much time, I'm open to a solution that would allow me to do more of the work. If the full docs build was documented somewhere I would be happy to run it and look for the images that get pulled in... or if he could give me a tar of the built documentation I could search through it for images... although that wouldn't help for the epub and pdf versions. Or I could take this in chunks and just remove images that are obvious, like you suggested and break this up into chunks.

I wonder if commit bae5856 is fine though.. that just renamed images that were listed in the docs that had uppercase extensions, and fixes the links. That shouldn't effect the build images.

Remington Steed (rjs7) wrote :

Josh, great idea! I'm sorry it took me 5 years to look into this. Here's a branch inspired by yours, which actually deletes media files that seem to be unused (including by the HTML template stuff).

https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/rsteed/docs_delete_unused_images_and_docs

This branch has three commits. The first removes images not referenced in any adoc file. I'd like more eyes on this very long list of images, but I'm fairly confident that these really aren't used.

The second commit removes some adoc files that aren't included in any other adoc files (such as root.adoc), and thus aren't included in any of the public docs. The third commit removes image files that were only referenced in those deleted adoc files. Both of these two commits need more review, since they may represent content that we've accidentally excluded from the public docs.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers