source: gs2-extensions/ngramj/src/wiki/wikipedia2text/wiki2xml/php/README@ 25141

Last change on this file since 25141 was 25141, checked in by papitha, 12 years ago

NGRAMJ PERL MODULE ADDED /MAORI LANGUAGE GUESSING WORKING WELL!!

File size: 3.2 KB
Line 
1=pod
2
3=head1 INTRODUCTION
4
5You can read this document better with:
6
7 perldoc README
8
9Otherwise, please just ignore the funny characters.
10
11=head1 NAME
12
13WIKI2XML - Wikitext to XML converter
14
15=head1 INSTALLATION
16
17=head2 Download/Checkout
18
19Check out the current release from SVN:
20
21 svn co http://svn.wikimedia.org/svnroot/mediawiki/trunk/wiki2xml
22
23=head2 Extension or cgi-bin?
24
25There are two ways to install wiki2xml:
26
27 As extension: Special::Wiki2XML
28 As cgi-bin: http://example.com/wiki/wiki2xml/w2x
29
30The former should be prefered.
31
32=head2 As Extension
33
34To enable wiki2xml as extension, put all files in the C<< php >> directory into a
35C<< wiki2xml >> subdirectory of your MediaWiki extensions directory.
36
37 htdocs
38 \- wiki
39 \- extensions
40 \- wiki2xml <-- create this directory
41 \- w2x.php <-- copy files here
42 \- wiki2xml.php etc.
43
44Then add
45
46 require_once ("extensions/wiki2xml/extension.php");
47
48to your C<< LocalSettings.php >>. The extension can then be accessed as
49C<< [[Special:Wiki2XML]] >>.
50
51=head2 cgi-bin - Copy files
52
53The alternative method is to install wiki2xml as cgi-bin script:
54
55Copy the subdirectory C<< ./php/ >> to your server's C<< wiki/ >>
56directory as a subdirectory named C<< w2x >>:
57
58 htdocs
59 \- wiki
60 \- w2x <-- here
61 \- w2x.php
62 \- wiki2xml.php etc
63
64Access it as C<< http://example.com/wiki/w2x/w2x.php >>.
65
66=head2 Configuration
67
68The configuration is stored in C<< default.php >> and C<< local.php >>.
69
70There is a C<< sample_local.php >> file, copy it to C<< local.php >>
71and then edit it to match your configuration.
72
73On a Unix/Linux server the following can be used as a starting point:
74
75 # Directory for temporary files:
76 $xmlg["temp_dir"] = "/tmp";
77
78 # Path to the zip/unzip programs; can be omitted if in default
79 # executable path:
80 #$xmlg["zip_odt_path"] = "";
81
82 # Command to zip directory $1 to file $2:
83 $xmlg["zip_odt"] = 'zip -r9 $1 $2';
84
85 # Command to unzip file $1 to directory $2:
86 $xmlg["unzip_odt"] = 'unzip -x $1 -d $2';
87
88=head1 USAGE
89
90Open the correct URL (depending on install type, see above) in your browser.
91
92Wiki2xml should present you with a form with a textarea and several buttons.
93
94=head2 Using URL parameters
95
96Parameters:
97
98 doit=1
99 text=lines_of_text_or_titles
100 whatsthis=wikitext/articlelist
101 site=en.wikipedia.org/w
102 output_format=xml/text/xhtml/docbook_xml/odt_xml/odt
103
104Optional:
105
106 use_templates=all/none/these/notthese
107 templates=lines_of_templates
108 document_title=
109 add_gfdl=1
110 keep_categories=1
111 keep_interlanguage=1
112
113
114
115=head1 TROUBLESHOOTING
116
117If you get errors like the following:
118
119 Warning: fopen(/tmp/ODD6Rq1qt-DIR/content.xml): failed to open stream:
120 No such file or directory in /.../wiki/wiki2xml/w2x.php on line 112
121
122then make sure that the tmp directory you selected is really writable by
123your webserver.
124
125=head2 OpenOffice Output
126
127For OpenOffice output, the converter will extract a file called C<< template.odt >>
128into the temp directory. It will then replace/modify the files in it, zip it
129up again and then offer the browser the resulting file as a download.
130
131=head1 AUTHOR
132
133Copyright 2005-2006 by Magnus Manske <[email protected]>
134
135Released under the GPL.
136
137=cut
138
Note: See TracBrowser for help on using the repository browser.