Package 'hexsession'

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

Help Index


Encode image to Base64

Description

Encode image to Base64

Usage

encode_image(file_path)

Arguments

file_path

Path to an image file

Value

Base64 encoded string of the image


Find image paths

Description

Find image paths

Usage

find_imgpaths(pkgnames)

Arguments

pkgnames

Character vector of package names

Details

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.

Value

A list of image file paths for each package


Find logo paths

Description

Find logo paths

Usage

find_logopaths(imagepaths, pkgnames)

Arguments

imagepaths

List of image paths

pkgnames

Character vector of package names

Value

A vector of logo paths


Generate JavaScript file for hexsession

Description

Generate JavaScript file for hexsession

Usage

generate_hexsession_js(logopaths, urls, dark_mode, output_js)

Arguments

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

Description

Get package data

Usage

get_pkg_data(packages = NULL)

Arguments

packages

Character vector of package names (default is NULL, uses loaded packages)

Value

A list containing logopaths and urls for the packages


Get loaded packages

Description

Get loaded packages

Usage

getLoaded()

Value

A character vector of the attached packages (excludes base packages)


Create missing logos

Description

Create missing logos

Usage

make_missingLogos(attached_pkgs, logopaths)

Arguments

attached_pkgs

Character vector of attached package names

logopaths

Vector of existing logo paths

Value

Vector of paths to new logos


Generate tile of package logos

Description

Generate tile of package logos

Usage

make_tile(packages = NULL, local_images = NULL, dark_mode = FALSE)

Arguments

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

Value

Path to the output file


Get package URLs

Description

Get package URLs

Usage

pkgurls(pkgnames)

Arguments

pkgnames

Character vector of package names

Value

A vector of package URLs


Take screenshot of html image tile

Description

Take screenshot of html image tile

Usage

snap_tile(
  output_path,
  screen_width = 800,
  screen_height = 700,
  dark_mode = FALSE
)

Arguments

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?

Value

Path to the saved image