Issue #2104: fix — add the hosts file size history to the home readme only, for now.
authorSteven Black <redacted>
Fri, 22 Jul 2022 02:19:26 +0000 (22:19 -0400)
committerSteven Black <redacted>
Fri, 22 Jul 2022 02:19:26 +0000 (22:19 -0400)
updateReadme.py

index cb65262d50698d4057fa81da25579f60b0cd68b5..43da17cd1dcf5fcfb8b623a0258c7e22dd7d1ee9 100755 (executable)
@@ -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)
 
 
git clone https://git.99rst.org/PROJECT