public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Remi Collet <remi@fedoraproject.org>
To: git-commits@fedoraproject.org
Subject: [rpms/php] private-php86: add help to create mardown version of the NEWS file
Date: Fri, 27 Nov 2026 07:27:51 GMT	[thread overview]
Message-ID: <179576447182.1.12852734820721174339.rpms-php-a34b2835e1d3@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/php
Branch : private-php86
Commit : a34b2835e1d355ad3b9b59cf73af6231628aa095
Author : Remi Collet <remi@fedoraproject.org>
Date   : 2016-09-14T09:12:22+02:00
Stats  : +36/-0 in 1 file(s)
URL    : https://src.fedoraproject.org/rpms/php/c/a34b2835e1d355ad3b9b59cf73af6231628aa095?branch=private-php86

Log:
add help to create mardown version of the NEWS file

---
diff --git a/news2markdown.php b/news2markdown.php
new file mode 100755
index 0000000..f14b5fa
--- /dev/null
+++ b/news2markdown.php
@@ -0,0 +1,36 @@
+#!/usr/bin/env php
+<?php
+if ($_SERVER['argc'] < 2) {
+	die("Usage {$_SERVER['argv'][0]} /path/to/NEWS\n");
+}
+
+$text = file_get_contents($_SERVER['argv'][1]);
+if (!$text) {
+	die("Can't read {$_SERVER['argv'][1]}\n");
+}
+
+$text = explode("\n", $text);
+$in=false;
+foreach ($text as $line) {
+	if (preg_match('/(^[0-9][0-9] ... 20[0-9][0-9]) PHP (.*)$/', $line, $reg)) {
+		if ($in) {
+			break;
+		}
+		printf("%s **PHP version %s**", $reg[1], $reg[2]);
+		$in = true;
+		continue;
+	} else if (!$in) {
+		continue;
+	}
+	$line = preg_replace('/(#[0-9])+/', 'php\1', $line);
+	if (empty($line)) {
+		echo "\n\n";
+	} else if (substr($line, 0, 2) == '- ') {
+		echo "**" . substr($line, 2) . "**\n";
+	} else if (substr($line, 0, 4) == '  . ') {
+		echo "\n* " . substr($line, 4);
+	} else {
+		echo " ".trim($line);
+	}
+}
+

                 reply	other threads:[~2026-11-27  7:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179576447182.1.12852734820721174339.rpms-php-a34b2835e1d3@fedoraproject.org \
    --to=remi@fedoraproject.org \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox