Cheat sheet: format_size fliter needs explanation

Created on 26 May 2023, over 1 year ago
Updated 27 May 2023, over 1 year ago

Problem/Motivation

I was reading the cheat sheet, and realized I don't know what a few features are -- for example, format_size.* After some poking around, I think format_size might just be a way to pass a string through the Drupal format_size function, is that correct? -- if no, I'd love to know what this filter does; if yes, I'm guessing that same concept is what the check_markup filter is, too (passing a string through a Drupal function)? (Maybe others, I'm not sure.)

*Maybe format_size is the only one -- I think all others that are missing explanations will be fixed by πŸ“Œ Update 3.x cheat sheet with details from 2.x cheat sheet Needs work ... Yeah, I'm changing the issue title to just be about format_size.

Proposed resolution

It'd be great to explain that in the cheat sheet, in great detail, or with minimal details and a link to the applicable Drupal API docs.
>> Decided: It's a cheat sheet, keep it brief.

Remaining tasks

  • Do it!
    1. In cheat sheet, add a brief explanation to format_size filter.
    2. In [docs/README.md or the top-level README??], add a brief note like "some functions and filters are simply wrappers for Drupal functions and services; for example: format_size, drupal_view_result."
      • (just to give a little clue for people who are more intermediate/less advanced PHP programmers, for whom it won't be obvious why some filters/functions don't have any "source code" in the twig_tweak module)
πŸ’¬ Support request
Status

Fixed

Version

3.0

Component

Documentation

Created by

πŸ‡ΊπŸ‡ΈUnited States alison

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024