Learn R Programming

figma (version 0.2.0)

quarto_website: A representation of a Quarto Website home webpage

Description

The `quarto_website` object contain the data of the homepage for a Quarto Website that was drawn in a Figma file. In other words, a homepage was drawn in Figma, and then, it was imported to R trough the figma package.

Usage

quarto_website

Arguments

Format

An object of class response, produced by httr HTTP methods (e.g. httr::GET());

Details

This Figma file contains a single page/canvas, and each HTML component is a separate object in the Figma file. The name of each object in the page/canvas correspond to the CSS selector used to style this HTML component in a real Quarto Website.

This is a interesting structure, because you can use the name and the attributes of each object to build custom CSS code, that maybe matches the style of a webpage.

Is worth mentioning, that the quarto_website object is a httr::response object returned by figma::get_figma_file(). This httr::response object is just a simple R list with class response. The elements of this list and their description are:

  • url: The URL used in the HTTP request made to the Figma API;

  • status_code: The HTTP status code returned by the Figma API;

  • headers and all_headers: The list of headers returned by the Figma API;

  • cookies: A named list of cookies returned by the Figma API;

  • content: The body of the response, as raw vector. See httr::content() for various ways to parse this content;

  • date and times: Timing information about the HTTP request made to the Figma API;

  • handle: The handle associated with the url;

  • request: The URL, HTTP method and options used in the HTTP request made to the Figma API;

All data of the Figma file is stored in the content element. However, this data is in raw format (i.e. in raw bytes). To convert these raw bytes into a useful format like a R list, or a string, you should use the httr::content() function. See vignette("figma") for a detailed description of the data present in this content element;

Examples

Run this code
library(figma)
str(quarto_website)

Run the code above in your browser using DataLab