1- From 938d6be7ebcb2a640ca67263847c07b1ac813c82 Mon Sep 17 00:00:00 2001
1+ From 2e3fffea44c3840974cd758ceb550adf1db8e6a0 Mon Sep 17 00:00:00 2001
22From: myfreeer <myfreeer@users.noreply.github.com>
3- Date: Fri, 31 Dec 2021 21:24:02 +0800
3+ Date: Sun, 23 Mar 2025 18:34:54 +0800
44Subject: [PATCH] source: use zh localized version
55
66---
7- Makefile | 58 ++++++++++++------------
7+ Makefile | 57 ++++++++++++------------
88 commands/preprocess.py | 21 +++++----
99 commands/preprocess_cssless.py | 4 +-
1010 gadgets/standard_revisions_tests/base.py | 2 +-
@@ -14,16 +14,16 @@ Subject: [PATCH] source: use zh localized version
1414 preprocess.py | 8 ++--
1515 tests/test_preprocess.py | 2 +-
1616 tests/test_preprocess_cssless.py | 2 +-
17- 10 files changed, 54 insertions(+), 51 deletions(-)
17+ 10 files changed, 54 insertions(+), 50 deletions(-)
1818
1919diff --git a/Makefile b/Makefile
20- index 798b79e..e1b4e96 100644
20+ index 6c4ce10..327b404 100644
2121--- a/Makefile
2222+++ b/Makefile
23- @@ -100,18 +100,18 @@ install: all
23+ @@ -104,14 +104,14 @@ install_html: doc_html
2424 popd > /dev/null
2525
26- # install the devhelp documentation
26+ install_devhelp: doc_devhelp
2727- install -DT -m 644 "output/cppreference-doc-en-c.devhelp2" \
2828- "$(DESTDIR)$(bookdir)/cppreference-doc-en-c/cppreference-doc-en-c.devhelp2"
2929- install -DT -m 644 "output/cppreference-doc-en-cpp.devhelp2" \
@@ -32,20 +32,16 @@ index 798b79e..e1b4e96 100644
3232+ "$(DESTDIR)$(bookdir)/cppreference-doc-zh-c/cppreference-doc-zh-c.devhelp2"
3333+ install -DT -m 644 "output/cppreference-doc-zh-cpp.devhelp2" \
3434+ "$(DESTDIR)$(bookdir)/cppreference-doc-zh-cpp/cppreference-doc-zh-cpp.devhelp2"
35- install -DT -m 644 "output/cppreference-doxygen-local.tag.xml" \
36- "$(DESTDIR)$(bookdir)/cppreference-doxygen-local.tag.xml"
37- install -DT -m 644 "output/cppreference-doxygen-web.tag.xml" \
38- "$(DESTDIR)$(bookdir)/cppreference-doxygen-web.tag.xml"
3935
40- # install the .qch (Qt Help) documentation
36+ install_qch: doc_qch
4137- install -DT -m 644 "output/cppreference-doc-en-cpp.qch" \
4238- "$(DESTDIR)$(docdir)/qch/cppreference-doc-en-cpp.qch"
4339+ install -DT -m 644 "output/cppreference-doc-zh-cpp.qch" \
4440+ "$(DESTDIR)$(docdir)/qch/cppreference-doc-zh-cpp.qch"
4541
46- uninstall:
47- rm -rf "$(DESTDIR)$(docdir)"
48- @@ -138 ,16 +138 ,16 @@ release: all
42+ install_doxygen: doc_doxygen
43+ install -DT -m 644 "output/cppreference-doxygen-local.tag.xml" \
44+ @@ -144 ,16 +144 ,16 @@ release: all
4945
5046 # zip qch
5147 pushd "output"; \
@@ -66,7 +62,7 @@ index 798b79e..e1b4e96 100644
6662
6763 doc_doxygen: output/cppreference-doxygen-web.tag.xml output/cppreference-doxygen-local.tag.xml
6864
69- @@ -156 ,32 +156 ,32 @@ output/link-map.xml: output/reference
65+ @@ -162 ,32 +162 ,32 @@ output/link-map.xml: output/reference
7066 ./build_link_map.py
7167
7268 #build the .devhelp2 index
@@ -108,7 +104,7 @@ index 798b79e..e1b4e96 100644
108104 #build the file list
109105 echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?><files>" > "output/qch-files.xml"
110106
111- @@ -193 ,7 +193 ,7 @@ output/qch-help-project-cpp.xml: output/cppreference-doc-en-cpp.devhelp2 output/
107+ @@ -199 ,7 +199 ,7 @@ output/qch-help-project-cpp.xml: output/cppreference-doc-en-cpp.devhelp2 output/
112108 echo "</files>" >> "output/qch-files.xml"
113109
114110 #create the project (copies the file list)
@@ -117,7 +113,7 @@ index 798b79e..e1b4e96 100644
117113 --dst=output/qch-help-project-cpp.xml \
118114 --virtual_folder=cpp --file_list=output/qch-files.xml
119115
120- @@ -229 ,7 +229 ,7 @@ indexes:
116+ @@ -235 ,7 +235 ,7 @@ indexes:
121117 ./index2autolinker.py index-functions-c.xml output/indexes/autolink-c
122118 ./index2autolinker.py index-functions-cpp.xml output/indexes/autolink-cpp
123119
@@ -126,7 +122,7 @@ index 798b79e..e1b4e96 100644
126122 source:
127123 rm -rf "reference"
128124 mkdir "reference"
129- @@ -238 ,15 +238,15 @@ source:
125+ @@ -244 ,15 +244,16 @@ source:
130126 regex=".*index\\.php.*|.*/Special:.*|.*/Talk:.*" \
131127 regex+="|.*/Help:.*|.*/File:.*|.*/Cppreference:.*" \
132128 regex+="|.*/WhatLinksHere:.*|.*/Template:.*|.*/Category:.*" \
@@ -144,13 +140,14 @@ index 798b79e..e1b4e96 100644
144140- https://en.cppreference.com/w/ ; \
145141+ --timeout=5 --tries=180 --no-verbose \
146142+ --retry-connrefused --waitretry=2 --read-timeout=13 \
143+ + --trust-server-names \
147144+ https://zh.cppreference.com/w/ ; \
148145 popd > /dev/null
149146
150147- ./export.py --url=https://en.cppreference.com/mwiki reference/cppreference-export-ns0,4,8,10.xml 0 4 8 10
151148+ ./export.py --url=https://zh.cppreference.com/mwiki reference/cppreference-export-ns0,4,8,10.xml 0 4 8 10
152149diff --git a/commands/preprocess.py b/commands/preprocess.py
153- index f6627ef..6785463 100644
150+ index e745b8e..4529c6a 100644
154151--- a/commands/preprocess.py
155152+++ b/commands/preprocess.py
156153@@ -43,23 +43,23 @@ def rearrange_archive(root):
@@ -196,7 +193,7 @@ index f6627ef..6785463 100644
196193
197194 # make custom footer
198195 def add_footer(html, root, fn):
199- - footer = html.xpath(' //*[@id=\ 'footer\']' )[0]
196+ - footer = html.xpath(" //*[@id='footer']" )[0]
200197+ footers = html.xpath('//*[@id=\'footer\']')
201198+ if len(footers) == 0:
202199+ return
@@ -338,5 +335,5 @@ index 64864cc..b48628b 100644
338335
339336 root = function(root)
340337- -
341- 2.30.0
338+ 2.39.5
342339
0 commit comments