Skip to content

Commit b53268f

Browse files
committed
Merge remote-tracking branch 'upstream/master'
* upstream/master: (29 commits) Transform/DDG: Support the script running outside the repository tree Gadgets/Stdrev: Add more tests Gadgets/Stdrev: Improve debug strings Gadgets/Stdrev: Refactor implicit "visibility map" into a separate type Headers: Fix definition of true_type Headers: Fix iterator types for map, unordered_{map,set} Headers: forward_list does not have crbegin/crend Headers: Use std:: when referring to things in std namespace Headers: Add dependent includes to headers to mix code completion Gadgets/Stdrev: Rename get_level to get_heading_level and improve docs Gadgets/Stdrev: Test single thing per test Release 20170409 Preprocess: Don't include MediaWiki source into distributed archives README: Update Preprocess: Replace '*' character in filenames (fixes #46) Preprocess: Refactor renaming due to invalid characters skins: Add common skins files Makefile: Also download the contents of the MediaWiki namespace Include the Mediawiki source into the distribution archive headers: Remove duplicate functions ...
2 parents 38cd9c9 + a1f944a commit b53268f

File tree

173 files changed

+5596
-604
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+5596
-604
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,3 +239,4 @@ source:
239239
http://en.cppreference.com/w/ ; \
240240
popd > /dev/null
241241

242+
./export.py --url=http://en.cppreference.com/mwiki reference/cppreference-export-ns0,4,8,10.xml 0 4 8 10

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ documentation formats are currently supported:
3333
3) QT Help documentation format (.qch). Can be generated using `make doc_qch`.
3434
`make install` installs the documentation into proper locations.
3535

36-
Simply running `make` will run generate documentation in all three formats.
36+
Simply running `make all` will generate documentation in all three formats.
37+
38+
Running `make release` will generate the release archives which are uploaded
39+
to <http://en.cppreference.com/w/Cppreference:Archives>.
3740

3841
Dependencies
3942
------------
@@ -45,7 +48,7 @@ See also
4548
--------
4649

4750
Debian packaging information for this package is maintained at
48-
<https://github.com/p12tic/cppreference-doc-debian>
51+
<https://github.com/p12tic/cppreference-doc_debian>
4952

5053
About this fork
5154
---------------

build_link_map.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def build_link_map(directory):
3838
link_map = LinkMap()
3939

4040
for fn in sorted(html_files):
41-
f = open(fn, "r")
41+
f = open(fn, "r", encoding='utf-8')
4242
text = f.read()
4343
f.close()
4444

export.py

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
#!/usr/bin/env python3
2+
'''
3+
Copyright (C) 2017 Povilas Kanapickas <povilas@radix.lt>
4+
5+
This file is part of cppreference-doc
6+
7+
This program is free software: you can redistribute it and/or modify
8+
it under the terms of the GNU General Public License as published by
9+
the Free Software Foundation, either version 3 of the License, or
10+
(at your option) any later version.
11+
12+
This program is distributed in the hope that it will be useful,
13+
but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
GNU General Public License for more details.
16+
17+
You should have received a copy of the GNU General Public License
18+
along with this program. If not, see http://www.gnu.org/licenses/.
19+
'''
20+
21+
import argparse
22+
import urllib.parse
23+
import urllib.request
24+
import json
25+
26+
def retrieve_page_names(root, ns_index):
27+
28+
begin = None
29+
pages = []
30+
31+
while True:
32+
params = {
33+
'action' : 'query',
34+
'list' : 'allpages',
35+
'apnamespace' : ns_index,
36+
'aplimit' : 500,
37+
'format' : 'json'
38+
}
39+
if begin is not None:
40+
params['apcontinue'] = begin
41+
42+
url = "{0}/api.php?{1}".format(root, urllib.parse.urlencode(params))
43+
44+
with urllib.request.urlopen(url) as f:
45+
data = json.loads(f.read().decode('utf-8'))
46+
pages += [ p['title'] for p in data['query']['allpages'] ]
47+
48+
if ('query-continue' in data and 'allpages' in data['query-continue'] and
49+
'apcontinue' in data['query-continue']['allpages']):
50+
begin = data['query-continue']['allpages']['apcontinue']
51+
else:
52+
return pages
53+
54+
def export_pages(root, pages, output_path):
55+
params = {
56+
'wpDownload' : '',
57+
'curonly' : 1,
58+
'pages' : '\n'.join(pages)
59+
}
60+
61+
data = urllib.parse.urlencode(params)
62+
data = data.encode('ascii')
63+
url = "{0}/index.php?title=Special:Export&action=submit".format(root)
64+
65+
urllib.request.urlretrieve(url, output_path, data=data)
66+
67+
def main():
68+
parser = argparse.ArgumentParser(prog='export.py')
69+
parser.add_argument('--url', type=str, help='The URL to the root of the MediaWiki installation')
70+
parser.add_argument('output_path', type=str, help='The path to the XML file to save output to')
71+
parser.add_argument('ns_index', type=str, nargs='+', help='The indices of the namespaces to retrieve')
72+
args = parser.parse_args()
73+
74+
pages = []
75+
for ns_index in args.ns_index:
76+
new_pages = retrieve_page_names(args.url, ns_index)
77+
print("Retrieved {0} pages for namespace {1}".format(len(new_pages), ns_index))
78+
pages += new_pages
79+
80+
pages = sorted(pages)
81+
export_pages(args.url, pages, args.output_path)
82+
83+
if __name__ == "__main__":
84+
main()

fix_devhelp-links.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
target = '404'
4646
el.set('link', target)
4747

48-
out_f = open(out_fn, 'w')
48+
out_f = open(out_fn, 'w', encoding='utf-8')
4949
out_f.write(e.tostring(root, encoding='unicode', pretty_print=True))
5050
out_f.close()
5151

gadgets/standard_revisions-tests/cpp-container-visibility.html

Lines changed: 0 additions & 101 deletions
This file was deleted.

gadgets/standard_revisions-tests/cpp-io-basic_iostream.html renamed to gadgets/standard_revisions-tests/hides-dcl-items-in-member.html

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,32 @@
44
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
55
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
66
<link rel="selenium.base" href="http://en.cppreference.com/" />
7-
<title>cpp-io-basic_iostream</title>
7+
<title>hides-dcl-items-in-member</title>
88
</head>
99
<body>
1010
<table cellpadding="1" cellspacing="1" border="1">
1111
<thead>
12-
<tr><td rowspan="1" colspan="3">cpp-io-basic_iostream</td></tr>
12+
<tr><td rowspan="1" colspan="3">hides-dcl-items-in-member</td></tr>
1313
</thead><tbody>
1414
<tr>
1515
<td>open</td>
16-
<td>/w/cpp/io/basic_iostream</td>
16+
<td>/w/test-gadget-stdrev/hides-dcl-items-in-member</td>
1717
<td></td>
1818
</tr>
1919
<tr>
20-
<td>assertText</td>
21-
<td>id=firstHeading</td>
22-
<td>std::basic_iostream</td>
23-
</tr>
24-
<tr>
25-
<td>select</td>
26-
<td>css=select</td>
27-
<td>label=Diff</td>
20+
<td>verifyText</td>
21+
<td>//body</td>
22+
<td>glob:*void always_visible*</td>
2823
</tr>
2924
<tr>
3025
<td>verifyText</td>
31-
<td>//*[span/@id='Member_functions_4']/following-sibling::table[1]</td>
32-
<td>glob:*operator void*</td>
26+
<td>//body</td>
27+
<td>glob:*void not_visible_in_cxx98*</td>
3328
</tr>
3429
<tr>
3530
<td>verifyText</td>
36-
<td>//*[span/@id='Member_functions_4']/following-sibling::table[1]</td>
37-
<td>glob:*operator bool*</td>
31+
<td>//body</td>
32+
<td>glob:*void not_visible_in_cxx11*</td>
3833
</tr>
3934
<tr>
4035
<td>select</td>
@@ -43,30 +38,39 @@
4338
</tr>
4439
<tr>
4540
<td>verifyText</td>
46-
<td>//*[span/@id='Member_functions_4']/following-sibling::table[1]</td>
47-
<td>glob:*operator void*</td>
41+
<td>//body</td>
42+
<td>glob:*void always_visible*</td>
4843
</tr>
4944
<tr>
5045
<td>verifyNotText</td>
51-
<td>//*[span/@id='Member_functions_4']/following-sibling::table[1]</td>
52-
<td>glob:*operator bool*</td>
46+
<td>//body</td>
47+
<td>glob:*void not_visible_in_cxx98*</td>
48+
</tr>
49+
<tr>
50+
<td>verifyText</td>
51+
<td>//body</td>
52+
<td>glob:*void not_visible_in_cxx11*</td>
5353
</tr>
5454
<tr>
5555
<td>select</td>
5656
<td>css=select</td>
5757
<td>label=C++11</td>
5858
</tr>
5959
<tr>
60-
<td>verifyNotText</td>
61-
<td>//*[span/@id='Member_functions_4']/following-sibling::table[1]</td>
62-
<td>glob:*operator void*</td>
60+
<td>verifyText</td>
61+
<td>//body</td>
62+
<td>glob:*void always_visible*</td>
6363
</tr>
6464
<tr>
6565
<td>verifyText</td>
66-
<td>//*[span/@id='Member_functions_4']/following-sibling::table[1]</td>
67-
<td>glob:*operator bool*</td>
66+
<td>//body</td>
67+
<td>glob:*void not_visible_in_cxx98*</td>
68+
</tr>
69+
<tr>
70+
<td>verifyNotText</td>
71+
<td>//body</td>
72+
<td>glob:*void not_visible_in_cxx11*</td>
6873
</tr>
69-
7074
</tbody></table>
7175
</body>
7276
</html>
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4+
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
5+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6+
<link rel="selenium.base" href="http://en.cppreference.com/" />
7+
<title>hides-dsc-items-with-explicit-mark</title>
8+
</head>
9+
<body>
10+
<table cellpadding="1" cellspacing="1" border="1">
11+
<thead>
12+
<tr><td rowspan="1" colspan="3">hides-dsc-items-with-explicit-mark</td></tr>
13+
</thead><tbody>
14+
<tr>
15+
<td>open</td>
16+
<td>/w/test-gadget-stdrev/hides-dsc-items-with-explicit-mark</td>
17+
<td></td>
18+
</tr>
19+
<tr>
20+
<td>verifyText</td>
21+
<td>//body</td>
22+
<td>glob:*std::not_visible_in_cxx98*</td>
23+
</tr>
24+
<tr>
25+
<td>verifyText</td>
26+
<td>//body</td>
27+
<td>glob:*std::not_visible_in_cxx11*</td>
28+
</tr>
29+
<tr>
30+
<td>select</td>
31+
<td>css=select</td>
32+
<td>label=C++98/03</td>
33+
</tr>
34+
<tr>
35+
<td>verifyNotText</td>
36+
<td>//body</td>
37+
<td>glob:*std::not_visible_in_cxx98*</td>
38+
</tr>
39+
<tr>
40+
<td>verifyText</td>
41+
<td>//body</td>
42+
<td>glob:*std::not_visible_in_cxx11*</td>
43+
</tr>
44+
<tr>
45+
<td>select</td>
46+
<td>css=select</td>
47+
<td>label=C++11</td>
48+
</tr>
49+
<tr>
50+
<td>verifyText</td>
51+
<td>//body</td>
52+
<td>glob:*std::not_visible_in_cxx98*</td>
53+
</tr>
54+
<tr>
55+
<td>verifyNotText</td>
56+
<td>//body</td>
57+
<td>glob:*std::not_visible_in_cxx11*</td>
58+
</tr>
59+
</tbody></table>
60+
</body>
61+
</html>

0 commit comments

Comments
 (0)