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

doc: replace large image files with external URLs #818

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

trueNAHO
Copy link
Collaborator

@trueNAHO trueNAHO commented Jan 28, 2025

Replace large image files in the repository with external URLs to reduce
repository size and encourage future large assets to be added
externally.

The images were uploaded to GitHub with its drag-and-drop functionality.

Although the images can no longer be viewed offline, this is a
worthwhile trade-off given the rarity of this use-case.

@trueNAHO trueNAHO requested a review from danth January 28, 2025 19:06
@trueNAHO trueNAHO force-pushed the doc-replace-large-image-files-with-external-urls branch 3 times, most recently from f2e333c to 46bc175 Compare January 28, 2025 19:09
Replace large image files in the repository with external URLs to reduce
repository size and encourage future large assets to be added
externally.

The images were uploaded to GitHub with its drag-and-drop functionality.

Although the images can no longer be viewed offline, this is a
worthwhile trade-off given the rarity of this use-case.
@trueNAHO trueNAHO force-pushed the doc-replace-large-image-files-with-external-urls branch from 46bc175 to 2da7c29 Compare January 28, 2025 20:46
Copy link
Owner

@danth danth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mixed opinions on this:

  • Keeping the images in the repository might be useful for doc: install Stylix documentation as manpage  #635 or similar: for example NixOS has an option to install the HTML manual locally.
  • Removing them makes it more likely for the links to break in the future, if the repository is moved from GitHub to another service, or in archival programs such as Arctic Code Vault.
  • The files will be retained in the Git history, so doing a full clone will still need to download them.
  • On the other hand, this will reduce bandwidth by a couple of megabytes for the average user fetching the repository as a flake input.

Comment on lines -58 to -59
cp ${../gnome.png} src/gnome.png
cp ${../kde.png} src/kde.png
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a workaround to keep support for viewing documentation offline, we could fetch the images here using fetchurl and copy them into the package. This would also require patching the Markdown files to reference the local image.

  • This requires more maintenance effort.
  • This still relies on the GitHub links being accessible, at least at build time.

@trueNAHO
Copy link
Collaborator Author

trueNAHO commented Jan 30, 2025

My main concern with keeping these "non-essential" documentation assets in the repository makes it very tempting to override them when updating them. In the future for example, this would cause the Git repo to be 100MB large with over 90% attributed to non-essential visualizations, where we essentially never care about anything other than the latest version of the visualizations, unlike the source code where history is valuable.

Working with such a bloated Git repo would be rather annoying. The fact that the .tar.gz is smaller is merely a side-effect.

For reference, I have thought about implementing something in the future where demonstrations could be automatically generated, which would keep the documentation in sync with the functionality and this could be used in PRs and issues to find color inconsistencies. In that case, somewhat frequent changes to these visualizations would merely bloat the repository size.

@danth
Copy link
Owner

danth commented Feb 9, 2025

I have thought about implementing something in the future where demonstrations could be automatically generated

Same - just automatically screenshot the testbeds once the target is fully loaded. The NixOS testing framework already has the functionality for this.

In this case the screenshots could just be dependencies of the docs derivation, and built when required.

However it would only show the initial page, which in some cases is not as interesting as a page further into the interaction. For example, the initial page of VSCode is not as interesting as having a file open. Also, we would have to maintain code to detect when the target is fully loaded.

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 this pull request may close these issues.

2 participants