1
1
diff --git a/Makefile b/Makefile
2
- index deadfe2..46abab2 100644
2
+ index deadfe2..be18286 100644
3
3
--- a/Makefile
4
4
+++ b/Makefile
5
5
@@ -230,7 +230,7 @@ indexes:
@@ -34,7 +34,7 @@ index deadfe2..46abab2 100644
34
34
- ./export.py --url=http://en.cppreference.com/mwiki reference/cppreference-export-ns0,4,8,10.xml 0 4 8 10
35
35
+ ./export.py --url=https://zh.cppreference.com/mwiki reference/cppreference-export-ns0,4,8,10.xml 0 4 8 10
36
36
diff --git a/commands/preprocess.py b/commands/preprocess.py
37
- index ed67174..ada56fe 100644
37
+ index ed67174..aec036c 100644
38
38
--- a/commands/preprocess.py
39
39
+++ b/commands/preprocess.py
40
40
@@ -40,15 +40,15 @@ def rearrange_archive(root):
@@ -66,6 +66,15 @@ index ed67174..ada56fe 100644
66
66
path = os.path.join(root, lang + ".cppreference.com/")
67
67
src_html_path = path + "w/"
68
68
src_data_path = path + "mwiki/"
69
+ @@ -77,7 +77,7 @@ def rearrange_archive(root):
70
+ shutil.copy(os.path.join(path, 'favicon.ico'), data_path)
71
+
72
+ # remove what's left
73
+ - shutil.rmtree(path)
74
+ + # shutil.rmtree(path)
75
+
76
+ # remove the XML source file
77
+ for fn in fnmatch.filter(os.listdir(root), 'cppreference-export*.xml'):
69
78
@@ -214,7 +214,7 @@ def has_class(el, classes_to_check):
70
79
return False
71
80
@@ -75,8 +84,19 @@ index ed67174..ada56fe 100644
75
84
html = etree.parse(fn, parser)
76
85
77
86
# remove non-printable elements
87
+ @@ -236,7 +236,9 @@ def preprocess_html_file(root, fn, rename_map):
88
+ for el in html.xpath('/html/body/script'):
89
+ if el.get('src') is not None and 'google-analytics.com/ga.js' in el.get('src'):
90
+ el.getparent().remove(el)
91
+ - elif el.text is not None and ('google-analytics.com/ga.js' in el.text or 'pageTracker' in el.text):
92
+ + elif el.text is not None and ('google-analytics.com/ga.js' in el.text or 'pageTracker' in el.text or '_trackPageview' in el.text):
93
+ + el.getparent().remove(el)
94
+ + elif el.get('src') is not None and 'carbonads.com/carbon.js' in el.get('src'):
95
+ el.getparent().remove(el)
96
+
97
+ # make custom footer
78
98
diff --git a/gadgets/standard_revisions-tests/base.py b/gadgets/standard_revisions-tests/base.py
79
- index 848d431..67d00f4 100644
99
+ index 848d431..91a0a99 100644
80
100
--- a/gadgets/standard_revisions-tests/base.py
81
101
+++ b/gadgets/standard_revisions-tests/base.py
82
102
@@ -27,7 +27,7 @@ import unittest, time, re
@@ -102,7 +122,7 @@ index 9aa3fc7..13294ec 100755
102
122
pywikibot.config2.step = 100
103
123
pywikibot.config2.put_throttle = 0
104
124
diff --git a/index2ddg.py b/index2ddg.py
105
- index 9789e56..7a3a3dc 100755
125
+ index 9789e56..8962791 100755
106
126
--- a/index2ddg.py
107
127
+++ b/index2ddg.py
108
128
@@ -447,7 +447,7 @@ def process_identifier(out, redirects, root, link, item_ident, item_type,
@@ -115,7 +135,7 @@ index 9789e56..7a3a3dc 100755
115
135
116
136
build_redirects(redirects, item_ident, item_type)
117
137
diff --git a/index_transform/browser.py b/index_transform/browser.py
118
- index d2e625c..82cb11f 100644
138
+ index d2e625c..11375f2 100644
119
139
--- a/index_transform/browser.py
120
140
+++ b/index_transform/browser.py
121
141
@@ -42,7 +42,7 @@ class Index2Browser(IndexTransform):
@@ -149,7 +169,7 @@ index cb6e8cc..a8ac18f 100755
149
169
rearrange_archive(root)
150
170
151
171
diff --git a/tests/test_preprocess.py b/tests/test_preprocess.py
152
- index e4aa687..d6f143f 100644
172
+ index e4aa687..4856f1b 100644
153
173
--- a/tests/test_preprocess.py
154
174
+++ b/tests/test_preprocess.py
155
175
@@ -6,23 +6,23 @@ from lxml import etree
0 commit comments