Title: | Create a tile of logos for loaded packages |
---|---|
Description: | Creates a responsive HTML file with tiled hex logos for all loaded packages in a session, which can be saved as a static screenshot in png format. |
Authors: | Luis D. Verde Arregoitia [aut, cre] |
Maintainer: | Luis D. Verde Arregoitia <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.0.0.9000 |
Built: | 2025-01-15 18:42:20 UTC |
Source: | https://github.com/luisdva/hexsession |
Encode image to Base64
encode_image(file_path)
encode_image(file_path)
file_path |
Path to an image file |
Base64 encoded string of the image
Find image paths
find_imgpaths(pkgnames)
find_imgpaths(pkgnames)
pkgnames |
Character vector of package names |
Images in svg format will be converted to png. When no image matches 'logo' in the file name the used is will be prompted to select likely logos.
A list of image file paths for each package
Find logo paths
find_logopaths(imagepaths, pkgnames)
find_logopaths(imagepaths, pkgnames)
imagepaths |
List of image paths |
pkgnames |
Character vector of package names |
A vector of logo paths
Generate JavaScript file for hexsession
generate_hexsession_js(logopaths, urls, dark_mode, output_js)
generate_hexsession_js(logopaths, urls, dark_mode, output_js)
logopaths |
Vector of image paths |
urls |
Vector of URLs |
dark_mode |
Use dark mode, inherited from make_tile |
output_js |
Path to save the JavaScript file |
Get package data
get_pkg_data(packages = NULL)
get_pkg_data(packages = NULL)
packages |
Character vector of package names (default is NULL, uses loaded packages) |
A list containing logopaths and urls for the packages
Get loaded packages
getLoaded()
getLoaded()
A character vector of the attached packages (excludes base packages)
Create missing logos
make_missingLogos(attached_pkgs, logopaths)
make_missingLogos(attached_pkgs, logopaths)
attached_pkgs |
Character vector of attached package names |
logopaths |
Vector of existing logo paths |
Vector of paths to new logos
Generate tile of package logos
make_tile(packages = NULL, local_images = NULL, dark_mode = FALSE)
make_tile(packages = NULL, local_images = NULL, dark_mode = FALSE)
packages |
Character vector of package names to include (default: NULL, which uses loaded packages) |
local_images |
Optional character vector of local image paths to add to the tile |
dark_mode |
Draw the tile on a dark background? |
local_urls |
Optional character vector of URLs for each of the local images passed |
Path to the output file
Get package URLs
pkgurls(pkgnames)
pkgurls(pkgnames)
pkgnames |
Character vector of package names |
A vector of package URLs
Take screenshot of html image tile
snap_tile( output_path, screen_width = 800, screen_height = 700, dark_mode = FALSE )
snap_tile( output_path, screen_width = 800, screen_height = 700, dark_mode = FALSE )
output_path |
Path to image file |
screen_width |
Width of the browser window |
screen_height |
Height of the browser window |
dark_mode |
Is the tile being saved dark or light mode? |
Path to the saved image