File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -156,22 +156,28 @@ epub:
156
156
@echo " Build finished. The epub file is in $( BUILDDIR) /epub."
157
157
158
158
latex :
159
+ $(PYTHON ) docs/prepare_readme_for_latex.py
159
160
$(SPHINXBUILD ) -b latex $(ALLSPHINXOPTS ) $(BUILDDIR ) /latex
161
+ mv README.rst.bak README.rst
160
162
@echo
161
163
@echo " Build finished; the LaTeX files are in $( BUILDDIR) /latex."
162
164
@echo " Run \` make' in that directory to run these through (pdf)latex" \
163
165
" (use \` make latexpdf' here to do that automatically)."
164
166
165
167
# seems to be malfunctioning
166
168
latexpdf :
169
+ $(PYTHON ) docs/prepare_readme_for_latex.py
167
170
$(SPHINXBUILD ) -b latex $(ALLSPHINXOPTS ) $(BUILDDIR ) /latex
171
+ mv README.rst.bak README.rst
168
172
@echo " Running LaTeX files through pdflatex..."
169
173
$(MAKE ) -C $(BUILDDIR ) /latex all-pdf
170
174
@echo " pdflatex finished; the PDF files are in $( BUILDDIR) /latex."
171
175
172
176
# seems to be malfunctioning
173
177
latexpdfja :
178
+ $(PYTHON ) docs/prepare_readme_for_latex.py
174
179
$(SPHINXBUILD ) -b latex $(ALLSPHINXOPTS ) $(BUILDDIR ) /latex
180
+ mv README.rst.bak README.rst
175
181
@echo " Running LaTeX files through platex and dvipdfmx..."
176
182
$(MAKE ) -C $(BUILDDIR ) /latex all-pdf-ja
177
183
@echo " pdflatex finished; the PDF files are in $( BUILDDIR) /latex."
Original file line number Diff line number Diff line change
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 )
You can’t perform that action at this time.
0 commit comments