1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00

$version_number

This commit is contained in:
gnosygnu
2016-04-30 23:47:16 -04:00
parent eb72d05541
commit 8da3c512e5
21 changed files with 2243 additions and 30 deletions

View File

@@ -0,0 +1,293 @@
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Dev/Command-line - XOWA</title>
<link rel="shortcut icon" href="https://gnosygnu.github.io/xowa/xowa_logo.png" />
<link rel="stylesheet" href="https://gnosygnu.github.io/xowa/xowa_common.css" type="text/css">
<style>
.console {font-family: monospace; color: #EEEEEE ; background-color: black ; border: medium solid black;}
.code
,.path
,.url {font-family: monospace; color: black ; background-color: #f9f9f9 ; border: medium solid #f9f9f9;}
.bold {font-weight: 900;}
</style>
<style>
.console {font-family: monospace; color: #EEEEEE ; background-color: black ; border: medium solid black;}
.code
,.path
,.url {font-family: monospace; color: black ; background-color: #f9f9f9 ; border: medium solid #f9f9f9;}
.bold {font-weight: 900;}
</style>
</head>
<body class="mediawiki ltr sitedir-ltr ns-0 ns-subject skin-vector action-submit vector-animateLayout" spellcheck="false">
<div id="mw-page-base" class="noprint"></div>
<div id="mw-head-base" class="noprint"></div>
<div id="content" class="mw-body">
<h1 id="firstHeading" class="firstHeading"><span>Dev/Command-line</span></h1>
<div id="bodyContent" class="mw-body-content">
<div id="siteSub">From XOWA: the free, open-source, offline wiki application</div>
<div id="contentSub"></div>
<div id="mw-content-text" lang="en" dir="ltr" class="mw-content-ltr">
<p>
XOWA can import a wiki using a plain text file and a command-line.
</p>
<div id="toc" class="toc">
<div id="toctitle">
<h2>
Contents
</h2>
</div>
<ul>
<li class="toclevel-1 tocsection-1">
<a href="#Import_simple.wikipedia.org_through_the_command-line"><span class="tocnumber">1</span> <span class="toctext">Import simple.wikipedia.org through the command-line</span></a>
</li>
<li class="toclevel-1 tocsection-2">
<a href="#Import_a_different_wiki_by_editing_the_build_script"><span class="tocnumber">2</span> <span class="toctext">Import a different wiki by editing the build script</span></a>
</li>
<li class="toclevel-1 tocsection-3">
<a href="#Import_a_wiki_with_a_manual_download"><span class="tocnumber">3</span> <span class="toctext">Import a wiki with a manual download</span></a>
<ul>
<li class="toclevel-2 tocsection-4">
<a href="#Download_the_wiki_dump"><span class="tocnumber">3.1</span> <span class="toctext">Download the wiki dump</span></a>
</li>
<li class="toclevel-2 tocsection-5">
<a href="#Specify_location_of_the_wiki_dump"><span class="tocnumber">3.2</span> <span class="toctext">Specify location of the wiki dump</span></a>
</li>
</ul>
</li>
<li class="toclevel-1 tocsection-6">
<a href="#Script"><span class="tocnumber">4</span> <span class="toctext">Script</span></a>
</li>
</ul>
</div>
<h2>
<span class="mw-headline" id="Import_simple.wikipedia.org_through_the_command-line">Import simple.wikipedia.org through the command-line</span>
</h2>
<ul>
<li>
Open up a command-line. For example, on Windows, run <span class='bold'>cmd</span>
</li>
<li>
Run the following: <span class='console'>java -jar C:\000\200_dev\110_java\400_xowa\bin\ --cmd_file C:\xowa\xowa_build.gfs --app_mode cmd</span>
</li>
<li>
Wait about 10 minutes for the script to complete
</li>
<li>
Launch XOWA and enter <span class='url'>simple.wikipedia.org</span> in the URL bar
</li>
</ul>
<h2>
<span class="mw-headline" id="Import_a_different_wiki_by_editing_the_build_script">Import a different wiki by editing the build script</span>
</h2>
<ul>
<li>
Open the following file in a <a href="http://xowa.org/home/wiki/Dev/Environment/Text_editor.html" id="xolnki_2" title="Dev/Environment/Text editor">text editor</a>: <span class='path'>C:\xowa\xowa_build.gfs</span>. See Script below for the full text.
</li>
<li>
Replace all instances of <span class='bold'>simple.wikipedia.org</span> with the domain name. For example, for English Wikipedia, use <span class='bold'>en.wikipedia.org</span>
</li>
<li>
Run the command-line import again.
</li>
<li>
Launch XOWA and enter in the domain name in the the URL bar.
</li>
</ul>
<h2>
<span class="mw-headline" id="Import_a_wiki_with_a_manual_download">Import a wiki with a manual download</span>
</h2>
<h3>
<span class="mw-headline" id="Download_the_wiki_dump">Download the wiki dump</span>
</h3>
<ul>
<li>
Navigate to <a href="https://dumps.wikimedia.org/enwiki" rel="nofollow" class="external free">https://dumps.wikimedia.org/enwiki</a>
</li>
<li>
Click on the <b>latest</b> directory
</li>
<li>
Download the file just under "<b>Articles, templates, media/file descriptions, and primary meta-pages.</b>". It should read <b>enwiki-latest-pages-articles.xml.bz2</b>
</li>
</ul>
<dl>
<dd>
The download is 11+ GB and may take anywhere between 2 and 5 hours to complete.
</dd>
<dd>
If you also want talk pages, you should download the "<b>Recombine all pages, current versions only.</b>" version. It should read <b>enwiki-latest-pages-meta-current.xml.bz2</b>. Note that this dump is twice the size of the regular dump.
</dd>
</dl>
<h3>
<span class="mw-headline" id="Specify_location_of_the_wiki_dump">Specify location of the wiki dump</span>
</h3>
<ul>
<li>
In the build script, replace the following line:
</li>
</ul>
<dl>
<dd>
<span class='code'>add ('simple.wikipedia.org', 'text.init') {src_bz2_fil = '/your_directory/simplewiki-20130103-pages-articles.xml.bz2';}</span>
</dd>
</dl>
<h2>
<span class="mw-headline" id="Script">Script</span>
</h2>
<pre class='code'>
// do not show a "Press enter to continue" at the end of the script
app.bldr.pause_at_end = 'n';
// run xowa.gfs
app.scripts.run_file_by_type('xowa_cfg_app');
// import wiki; for more info see [[Dev/Command-line]]
app.bldr.cmds {
// delete all files in directory; note that subdirectories and file databases ("-file.xowa") will not be deleted
add ('simple.wikipedia.org' , 'util.cleanup') {delete_all = 'y';}
// download main dump file; contains all articles
add ('simple.wikipedia.org' , 'util.download') {dump_type = 'pages-articles';}
// download categorylinks file; contains links from category to pages
add ('simple.wikipedia.org' , 'util.download') {dump_type = 'categorylinks';}
// download page_props file; contains information on hidden categories
add ('simple.wikipedia.org' , 'util.download') {dump_type = 'page_props';}
// start wiki import
add ('simple.wikipedia.org' , 'text.init');
// import articles
add ('simple.wikipedia.org' , 'text.page');
// generate search data
add ('simple.wikipedia.org' , 'text.search');
// generate main category data
add ('simple.wikipedia.org' , 'text.cat.core');
// import category links
add ('simple.wikipedia.org' , 'text.cat.link');
// apply hidden categories
add ('simple.wikipedia.org' , 'text.cat.hidden');
// end import
add ('simple.wikipedia.org' , 'text.term');
// import css into wiki
add ('simple.wikipedia.org' , 'text.css');
// cleanup temp files; delete xml and bz2
add ('simple.wikipedia.org' , 'util.cleanup') {delete_tmp = 'y'; delete_by_match('*.xml|*.sql|*.bz2|*.gz');}
}
// run cmds
app.bldr.run;
</pre>
</div>
</div>
</div>
<div id="mw-head" class="noprint">
<div id="left-navigation">
<div id="p-namespaces" class="vectorTabs">
<h3>Namespaces</h3>
<ul>
<li id="ca-nstab-main" class="selected"><span><a id="ca-nstab-main-href" href="index.html">Page</a></span></li>
</ul>
</div>
</div>
</div>
<div id='mw-panel' class='noprint'>
<div id='p-logo'>
<a style="background-image: url(https://gnosygnu.github.io/xowa/xowa_logo.png);" href="http://xowa.org/" title="Visit the main page"></a>
</div>
<div class="portal" id='xowa-portal-home'>
<h3>XOWA</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/index.html" title='Visit the main page'>Main page</a></li>
<li><a href="http://xowa.org/screenshots.html" title='See screenshots of XOWA'>Screenshots</a></li>
<li><a href="http://xowa.org/home/wiki/Help/Download_XOWA.html" title='Download the XOWA application'>Download XOWA</a></li>
<li><a href="http://xowa.org/home/wiki/Dashboard/Image_databases.html" title='Download offline wikis and image databases'>Download wikis</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-started'>
<h3>Getting started</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/home/wiki/App/Setup/System_requirements.html" title='Get XOWA&apos;s system requirements'>Requirements</a></li>
<li><a href="http://xowa.org/home/wiki/App/Setup/Installation.html" title='Get instructions for installing XOWA'>Installation</a></li>
<li><a href="http://xowa.org/home/wiki/App/Import/Simple_Wikipedia.html" title='Learn how to set up Simple Wikipedia'>Simple Wikipedia</a></li>
<li><a href="http://xowa.org/home/wiki/App/Import/English_Wikipedia.html" title='Learn how to set up English Wikipedia'>English Wikipedia</a></li>
<li><a href="http://xowa.org/home/wiki/App/Import/Other_wikis.html" title='Learn how to set up other Wikipedias'>Other Wikipedias</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-android'>
<h3>Android</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/home/wiki/Android/Setup.html" title='Setup XOWA on your Android device'>Setup</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-help'>
<h3>Help</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/home/wiki/Help/About.html" title='Get more information about XOWA'>About</a></li>
<li><a href="http://xowa.org/home/wiki/Help/Contents.html" title='View a list of help topics'>Contents</a></li>
<li><a href="http://xowa.org/home/wiki/Help/Media.html" title='Read what others have written about XOWA'>Media</a></li>
<li><a href="http://xowa.org/home/wiki/Help/Feedback.html" title='Questions? Comments? Leave feedback for XOWA'>Feedback</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-blog'>
<h3>Blog</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/home/wiki/Blog.html" title='Follow XOWA''s development process'>Current</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-links'>
<h3>Links</h3>
<div class="body">
<ul>
<li><a href="http://dumps.wikimedia.org/backup-index.html" title="Get wiki datababase dumps directly from Wikimedia">Wikimedia dumps</a></li>
<li><a href="https://archive.org/search.php?query=xowa" title="Search archive.org for XOWA files">XOWA @ archive.org</a></li>
<li><a href="http://en.wikipedia.org" title="Visit Wikipedia (and compare to XOWA!)">English Wikipedia</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-donate'>
<h3>Donate</h3>
<div class="body">
<ul>
<li><a href="https://archive.org/donate/index.php" title="Support archive.org!">archive.org</a></li><!-- listed first due to recent fire damages: http://blog.archive.org/2013/11/06/scanning-center-fire-please-help-rebuild/ -->
<li><a href="https://donate.wikimedia.org/wiki/Special:FundraiserRedirector" title="Support Wikipedia!">Wikipedia</a></li>
<!-- <li><a href="" title="Support XOWA! (but only after you've supported archive.org and Wikipedia)">XOWA</a></li> -->
</ul>
</div>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,180 @@
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Dev/Config files - XOWA</title>
<link rel="shortcut icon" href="https://gnosygnu.github.io/xowa/xowa_logo.png" />
<link rel="stylesheet" href="https://gnosygnu.github.io/xowa/xowa_common.css" type="text/css">
</head>
<body class="mediawiki ltr sitedir-ltr ns-0 ns-subject skin-vector action-submit vector-animateLayout" spellcheck="false">
<div id="mw-page-base" class="noprint"></div>
<div id="mw-head-base" class="noprint"></div>
<div id="content" class="mw-body">
<h1 id="firstHeading" class="firstHeading"><span>Dev/Config files</span></h1>
<div id="bodyContent" class="mw-body-content">
<div id="siteSub">From XOWA: the free, open-source, offline wiki application</div>
<div id="contentSub"></div>
<div id="mw-content-text" lang="en" dir="ltr" class="mw-content-ltr">
<h2>
<span class="mw-headline" id="Overview_.28and_disclaimer.29">Overview (and disclaimer)</span>
</h2>
<p>
XOWA uses a custom text format called gfs (an acronym for the gfs flexible script). It is a plain-text config file with a Java-like syntax.
</p>
<p>
Please note that gfs was an early personal project, dating back over five years ago. Although there are considerable flaws in the project, it was incorporated into XOWA for reasons of expedience.
</p>
<p>
Unfortunately, although the script is flexible for my purposes, the format is very easy to break and the resulting error messages can be cryptic and indecipherable.
</p>
<p>
As such, please follow these guidelines when working with a gfs file.
</p>
<ul>
<li>
Always have a backup.
</li>
<li>
Add changes in small steps.
</li>
<li>
Do not stray far from the provided file.
</li>
<li>
Do not be clever. You will outsmart the library.
</li>
</ul>
<h2>
<span class="mw-headline" id="Recommended_procedure_for_changes">Recommended procedure for changes</span>
</h2>
<p>
Please follow the steps below when changing config files. Windows instructions are provided in parentheses.
</p>
<p>
Note that you can keep XOWA open while making changes to the .gfs file. (for example, while reading this help page). However, in order for the changes to take effect, you must restart XOWA.
</p>
<ul>
<li>
Open up the config file in a text editor. (launch jEdit or Notepad++).
</li>
<li>
Make the desired change. (see <a href="http://xowa.org/home/wiki/Dev/Config_files/Examples.html" id="xolnki_2" title="Dev/Config files/Examples" class="xowa-visited">Dev/Config_files/Examples</a> for examples.)
</li>
<li>
Save and close the file.
</li>
<li>
Run XOWA (<code>java -jar xowa_windows.jar</code>)
</li>
</ul>
<dl>
<dd>
If it works, then XOWA will launch normally.
</dd>
<dd>
If it fails, then a message box will display an error. Note that the log will also have the same information: <b>/xowa/user/anonymous/app/tmp/log/current</b>.
</dd>
</dl>
</div>
</div>
</div>
<div id="mw-head" class="noprint">
<div id="left-navigation">
<div id="p-namespaces" class="vectorTabs">
<h3>Namespaces</h3>
<ul>
<li id="ca-nstab-main" class="selected"><span><a id="ca-nstab-main-href" href="index.html">Page</a></span></li>
</ul>
</div>
</div>
</div>
<div id='mw-panel' class='noprint'>
<div id='p-logo'>
<a style="background-image: url(https://gnosygnu.github.io/xowa/xowa_logo.png);" href="http://xowa.org/" title="Visit the main page"></a>
</div>
<div class="portal" id='xowa-portal-home'>
<h3>XOWA</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/index.html" title='Visit the main page'>Main page</a></li>
<li><a href="http://xowa.org/screenshots.html" title='See screenshots of XOWA'>Screenshots</a></li>
<li><a href="http://xowa.org/home/wiki/Help/Download_XOWA.html" title='Download the XOWA application'>Download XOWA</a></li>
<li><a href="http://xowa.org/home/wiki/Dashboard/Image_databases.html" title='Download offline wikis and image databases'>Download wikis</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-started'>
<h3>Getting started</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/home/wiki/App/Setup/System_requirements.html" title='Get XOWA&apos;s system requirements'>Requirements</a></li>
<li><a href="http://xowa.org/home/wiki/App/Setup/Installation.html" title='Get instructions for installing XOWA'>Installation</a></li>
<li><a href="http://xowa.org/home/wiki/App/Import/Simple_Wikipedia.html" title='Learn how to set up Simple Wikipedia'>Simple Wikipedia</a></li>
<li><a href="http://xowa.org/home/wiki/App/Import/English_Wikipedia.html" title='Learn how to set up English Wikipedia'>English Wikipedia</a></li>
<li><a href="http://xowa.org/home/wiki/App/Import/Other_wikis.html" title='Learn how to set up other Wikipedias'>Other Wikipedias</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-android'>
<h3>Android</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/home/wiki/Android/Setup.html" title='Setup XOWA on your Android device'>Setup</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-help'>
<h3>Help</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/home/wiki/Help/About.html" title='Get more information about XOWA'>About</a></li>
<li><a href="http://xowa.org/home/wiki/Help/Contents.html" title='View a list of help topics'>Contents</a></li>
<li><a href="http://xowa.org/home/wiki/Help/Media.html" title='Read what others have written about XOWA'>Media</a></li>
<li><a href="http://xowa.org/home/wiki/Help/Feedback.html" title='Questions? Comments? Leave feedback for XOWA'>Feedback</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-blog'>
<h3>Blog</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/home/wiki/Blog.html" title='Follow XOWA''s development process'>Current</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-links'>
<h3>Links</h3>
<div class="body">
<ul>
<li><a href="http://dumps.wikimedia.org/backup-index.html" title="Get wiki datababase dumps directly from Wikimedia">Wikimedia dumps</a></li>
<li><a href="https://archive.org/search.php?query=xowa" title="Search archive.org for XOWA files">XOWA @ archive.org</a></li>
<li><a href="http://en.wikipedia.org" title="Visit Wikipedia (and compare to XOWA!)">English Wikipedia</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-donate'>
<h3>Donate</h3>
<div class="body">
<ul>
<li><a href="https://archive.org/donate/index.php" title="Support archive.org!">archive.org</a></li><!-- listed first due to recent fire damages: http://blog.archive.org/2013/11/06/scanning-center-fire-please-help-rebuild/ -->
<li><a href="https://donate.wikimedia.org/wiki/Special:FundraiserRedirector" title="Support Wikipedia!">Wikipedia</a></li>
<!-- <li><a href="" title="Support XOWA! (but only after you've supported archive.org and Wikipedia)">XOWA</a></li> -->
</ul>
</div>
</div>
</div>
</body>
</html>

View File

@@ -22,10 +22,10 @@
</p>
<ul>
<li>
<a href="http://xowa.org/home/wiki/Dev/Config_files/Overview.html" id="xolnki_2" title="Dev/Config files/Overview">Overview</a>
<a href="http://xowa.org/home/wiki/Dev/Config_files.html" id="xolnki_2" title="Dev/Config files">Overview</a>
</li>
<li>
<a href="http://xowa.org/home/wiki/Dev/Config_files/Examples.html" id="xolnki_3" title="Dev/Config files/Examples">Examples</a>
<a href="http://xowa.org/home/wiki/Dev/Config_files/Examples.html" id="xolnki_3" title="Dev/Config files/Examples" class="xowa-visited">Examples</a>
</li>
<li>
<a href="http://xowa.org/home/wiki/Dev/Config_files/Files.html" id="xolnki_4" title="Dev/Config files/Files">Files</a>