Skip to content

Instantly share code, notes, and snippets.

@faithandbrave
Created November 26, 2019 08:40
Show Gist options
  • Select an option

  • Save faithandbrave/b3597f8cf608ad30a5f8535a056a92e9 to your computer and use it in GitHub Desktop.

Select an option

Save faithandbrave/b3597f8cf608ad30a5f8535a056a92e9 to your computer and use it in GitHub Desktop.
import glob
import re
for filename in glob.glob("site/**/*.md", recursive=True):
#print(filename)
data: str = ""
with open(filename, "r") as f:
data = f.read()
data = data.replace(", C++11 mode", "")
data = data.replace(", C++14 mode", "")
data = data.replace(", C++1y mode", "")
data = data.replace(", C++17 mode", "")
data = data.replace(", C++20 mode", "")
data = data.replace(" C++11 mode", "")
data = data.replace(" C++14 mode", "")
data = data.replace(" C++1y mode", "")
data = data.replace(" C++17 mode", "")
data = data.replace(" C++20 mode", "")
data = data.replace("- [Clang libc++]", "- [Clang]")
data = data.replace("- [GCC](/implementation.md#gcc): \n- [GCC](/implementation.md#gcc):", "- [GCC](/implementation.md#gcc):")
data = data.replace("- [GCC](/implementation.md#gcc):\n- [GCC](/implementation.md#gcc):", "- [GCC](/implementation.md#gcc):")
data = data.replace("- [GCC](/implementation.md#gcc): ??\n- [GCC](/implementation.md#gcc):", "- [GCC](/implementation.md#gcc):")
data = data.replace("- [GCC](/implementation.md#gcc): ?\n- [GCC](/implementation.md#gcc):", "- [GCC](/implementation.md#gcc):")
data = data.replace("- [GCC](/implementation.md#gcc): -\n- [GCC](/implementation.md#gcc):", "- [GCC](/implementation.md#gcc):")
with open(filename, "w") as f:
f.write(data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment