From 64c5d52afe49ccabfada7eebfa3dcc0ad299cb42 Mon Sep 17 00:00:00 2001 From: mappu Date: Mon, 4 May 2020 18:07:53 +1200 Subject: [PATCH] codesite2git: README.md: add 'Written in' shields.io badge --- codesite2git | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/codesite2git b/codesite2git index 3976579..31940c4 100755 --- a/codesite2git +++ b/codesite2git @@ -28,8 +28,14 @@ class CProjectGitExporter extends CProject { $this->longdesc = str_replace("\xEF\xBB\xBF", "", $this->longdesc); // Remove interior UTF-8 BOM markers $this->longdesc = str_replace("\r", "", $this->longdesc); // dos2unix + // Add main header and "written in" badge $lines = explode("\n", $this->longdesc); - $lines = array_merge(["# ".$this->projname, ""], $lines); + $header = ["# ".$this->projname, ""]; + if (strlen($this->subtag) > 0) { + $header[] = "![](https://img.shields.io/badge/written%20in-" . rawurlencode($this->subtag) . "-blue)"; + $header[] = ""; + } + $lines = array_merge($header, $lines); // Modify some lines to standard markdown format: foreach($lines as $i => $line) {