Skip to content

Commit 4663b3f

Browse files
committed
add the prepare readme python script
1 parent 618e335 commit 4663b3f

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

docs/prepare_readme_for_latex.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import shutil
2+
3+
with open("README.rst", "r") as f:
4+
readme_content = f.read()
5+
6+
shutil.copyfile("README.rst", "README.rst.bak")
7+
8+
# turn badge into text only
9+
modified_readme_content = readme_content.replace("|Weblate|", "Weblate", 1)
10+
11+
# remove image link
12+
badge_link_lines = """.. |Weblate| image:: https://hosted.weblate.org/widgets/circuitpython/-/svg-badge.svg
13+
:target: https://hosted.weblate.org/engage/circuitpython/?utm_source=widget"""
14+
15+
modified_readme_content = modified_readme_content.replace(badge_link_lines, "")
16+
17+
with open("README.rst", "w") as f:
18+
f.write(modified_readme_content)

0 commit comments

Comments
 (0)