79426373

Date: 2025-02-10 07:47:16
Score: 2.5
Natty:
Report link

You can generate your credits by creating this file somewhere on your computer:

generate-md-credits.php:

<?php
// Take in input the "composer fund --format=json" and generate
// a simple list of donations link in Markdown.
$stdin = file_get_contents('php://stdin', 'r');
$entries = json_decode($stdin);
foreach ($entries as $entry => $links) {
  foreach ($links as $link => $deps) {
    foreach ($deps as $dep) {
      echo "* [Donate to **$entry - $dep**]($link)\n";
    } 
  }
}

Then using this command from your command line:

composer fund --format=json | php generate-md-credits.php

(If you are not in GNU/Linux or similar environments, please add a comment to share how you do this in one command...)

It generates something like this this (rendered in Markdown):

So the script easily generates some Markdown, and from time to time you can easily update your README. You can also automate this a bit more, but it's still something.

I'm glad to see more solutions thought. Thanks for sharing.

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Blacklisted phrase (2): Thanks for sharing
  • Probably link only (1):
  • Long answer (-1):
  • Has code block (-0.5):
  • Self-answer (0.5):
Posted by: Valerio Bozz