mirror of
https://github.com/StevenBlack/hosts.git
synced 2024-06-28 16:45:46 +02:00
Issue #2104: fix — add the hosts file size history to the home readme only, for now.
This commit is contained in:
parent
35e6719e72
commit
79e7103f00
|
@ -30,7 +30,6 @@ def main():
|
||||||
data = json.load(f)
|
data = json.load(f)
|
||||||
|
|
||||||
keys = list(data.keys())
|
keys = list(data.keys())
|
||||||
|
|
||||||
# Sort by the number of en-dashes in the key
|
# Sort by the number of en-dashes in the key
|
||||||
# and then by the key string itself.
|
# and then by the key string itself.
|
||||||
keys.sort(key=lambda item: (item.count("-"), item))
|
keys.sort(key=lambda item: (item.count("-"), item))
|
||||||
|
@ -63,7 +62,7 @@ def main():
|
||||||
"${name} |[link](${homeurl})"
|
"${name} |[link](${homeurl})"
|
||||||
" | [raw](${url}) | ${license} | [issues](${issues})| ${description}"
|
" | [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:
|
for key in keys:
|
||||||
extensions = key.replace("-", ", ")
|
extensions = key.replace("-", ", ")
|
||||||
extensions_str = "* Extensions: **" + extensions + "**."
|
extensions_str = "* Extensions: **" + extensions + "**."
|
||||||
|
@ -98,6 +97,14 @@ def main():
|
||||||
)
|
)
|
||||||
line = line.replace("@TOCROWS@", toc_rows)
|
line = line.replace("@TOCROWS@", toc_rows)
|
||||||
line = line.replace("@SOURCEROWS@", source_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)
|
out.write(line)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user