From 79e7103f00c54ed89dfe698e488af9596255535b Mon Sep 17 00:00:00 2001 From: Steven Black Date: Thu, 21 Jul 2022 22:19:26 -0400 Subject: [PATCH] =?UTF-8?q?Issue=20#2104:=20fix=20=E2=80=94=20add=20the=20?= =?UTF-8?q?hosts=20file=20size=20history=20to=20the=20home=20readme=20only?= =?UTF-8?q?,=20for=20now.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- updateReadme.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/updateReadme.py b/updateReadme.py index cb65262d5..43da17cd1 100755 --- a/updateReadme.py +++ b/updateReadme.py @@ -30,7 +30,6 @@ def main(): data = json.load(f) keys = list(data.keys()) - # Sort by the number of en-dashes in the key # and then by the key string itself. keys.sort(key=lambda item: (item.count("-"), item)) @@ -63,7 +62,7 @@ def main(): "${name} |[link](${homeurl})" " | [raw](${url}) | ${license} | [issues](${issues})| ${description}" ) - + size_history_graph = "![Size history](https://raw.githubusercontent.com/StevenBlack/hosts/master/base_hosts_file_size.png)" for key in keys: extensions = key.replace("-", ", ") extensions_str = "* Extensions: **" + extensions + "**." @@ -98,6 +97,14 @@ def main(): ) line = line.replace("@TOCROWS@", toc_rows) line = line.replace("@SOURCEROWS@", source_rows) + # insert the size graph on the home readme only, for now. + if key == "base": + line = line.replace( + "@SIZEHISTORY@", size_history_graph + ) + else: + line = line.replace("@SIZEHISTORY@", "") + out.write(line)