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

'v3.4.2.6'

This commit is contained in:
gnosygnu
2016-04-15 16:19:00 -04:00
parent 574451bd93
commit cc5b49c7c4
225 changed files with 111023 additions and 0 deletions

428
Dev/Code.html Normal file
View File

@@ -0,0 +1,428 @@
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Dev/Code - XOWA</title>
<link rel="shortcut icon" href="http://xowa.org/xowa_logo.png" />
<link rel="stylesheet" href="http://xowa.org/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/Code</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">
<div id="toc" class="toc">
<div id="toctitle">
<h2>
Contents
</h2>
</div>
<ul>
<li class="toclevel-1 tocsection-1">
<a href="#Overview"><span class="tocnumber">1</span> <span class="toctext">Overview</span></a>
</li>
<li class="toclevel-1 tocsection-2">
<a href="#License"><span class="tocnumber">2</span> <span class="toctext">License</span></a>
</li>
<li class="toclevel-1 tocsection-3">
<a href="#Operating_Systems"><span class="tocnumber">3</span> <span class="toctext">Operating Systems</span></a>
</li>
<li class="toclevel-1 tocsection-4">
<a href="#Software_Requirements"><span class="tocnumber">4</span> <span class="toctext">Software Requirements</span></a>
</li>
<li class="toclevel-1 tocsection-5">
<a href="#Compilation_instructions_.28ANT_command-line.29"><span class="tocnumber">5</span> <span class="toctext">Compilation instructions (ANT command-line)</span></a>
<ul>
<li class="toclevel-2 tocsection-6">
<a href="#Setup_the_XOWA_app"><span class="tocnumber">5.1</span> <span class="toctext">Setup the XOWA app</span></a>
</li>
<li class="toclevel-2 tocsection-7">
<a href="#Setup_the_XOWA_source"><span class="tocnumber">5.2</span> <span class="toctext">Setup the XOWA source</span></a>
</li>
<li class="toclevel-2 tocsection-8">
<a href="#Run_the_ant_file"><span class="tocnumber">5.3</span> <span class="toctext">Run the ant file</span></a>
</li>
</ul>
</li>
<li class="toclevel-1 tocsection-9">
<a href="#IDE_instructions_.28Eclipse.29"><span class="tocnumber">6</span> <span class="toctext">IDE instructions (Eclipse)</span></a>
<ul>
<li class="toclevel-2 tocsection-10">
<a href="#Environment"><span class="tocnumber">6.1</span> <span class="toctext">Environment</span></a>
</li>
<li class="toclevel-2 tocsection-11">
<a href="#Setup"><span class="tocnumber">6.2</span> <span class="toctext">Setup</span></a>
</li>
<li class="toclevel-2 tocsection-12">
<a href="#Eclipse-specific_settings"><span class="tocnumber">6.3</span> <span class="toctext">Eclipse-specific settings</span></a>
<ul>
<li class="toclevel-3 tocsection-13">
<a href="#Project_properties"><span class="tocnumber">6.3.1</span> <span class="toctext">Project properties</span></a>
</li>
<li class="toclevel-3 tocsection-14">
<a href="#Preferences"><span class="tocnumber">6.3.2</span> <span class="toctext">Preferences</span></a>
</li>
<li class="toclevel-3 tocsection-15">
<a href="#Configuration_arguments"><span class="tocnumber">6.3.3</span> <span class="toctext">Configuration arguments</span></a>
</li>
</ul>
</li>
</ul>
</li>
<li class="toclevel-1 tocsection-16">
<a href="#Coding_style"><span class="tocnumber">7</span> <span class="toctext">Coding style</span></a>
</li>
</ul>
</div>
<h2>
<span class="mw-headline" id="Overview">Overview</span>
</h2>
<p>
XOWA is an offline Wikipedia application. It can run an offline copy of Wikipedia on your computer by using any of the dumps at <a href="https://dumps.wikimedia.org" rel="nofollow" class="external free">https://dumps.wikimedia.org</a> It can run as a standalone GUI application, as a Firefox addon, or as a HTTP server.
</p>
<h2>
<span class="mw-headline" id="License">License</span>
</h2>
<p>
XOWA is released under the AGPLv3 license. See LICENSE.txt for more information.
</p>
<h2>
<span class="mw-headline" id="Operating_Systems">Operating Systems</span>
</h2>
<p>
XOWA runs on Linux, Windows, and Mac OS X. These instructions will assume the user is on a 64-bit Linux system. However, if you're on a different system, the same instructions still apply. Simply substitute "linux_64" with the appropriate XOWA operating system name from below:
</p>
<ul>
<li>
Linux 64-bit : "linux_64"
</li>
<li>
Linux 32-bit : "linux"
</li>
<li>
Windows 64-bit : "windows_64"
</li>
<li>
Windows 32-bit : "windows"
</li>
<li>
Mac OS X 64-bit : "macosx_64"
</li>
<li>
Mac OS X 32-bit : "macosx"
</li>
</ul>
<h2>
<span class="mw-headline" id="Software_Requirements">Software Requirements</span>
</h2>
<p>
XOWA is written in Java and requires 1.6 or above. It has seven dependencies:
</p>
<ol>
<li>
JUnit 4.8.2 (default version with Eclipse)
</li>
<li>
<a href="https://download.eclipse.org/eclipse/downloads/drops4/R-4.2.1-201209141800/#SWT" rel="nofollow" class="external text">SWT 4.2.1</a>: GUI library
</li>
<li>
<a href="https://github.com/gnosygnu/luaj_xowa" rel="nofollow" class="external text">luaj_xowa.jar</a>: Lua library
</li>
<li>
<a href="https://github.com/gnosygnu/jtidy_xowa" rel="nofollow" class="external text">jtidy_xowa.jar</a>: HTML tidy library
</li>
<li>
<a href="https://bitbucket.org/xerial/sqlite-jdbc/downloads" rel="nofollow" class="external text">sqlite-jdbc-3.7.15-SNAPSHOT-2.jar</a>: Database library
</li>
<li>
<a href="https://dev.mysql.com/downloads/connector/j/" rel="nofollow" class="external text">mysql-connector-java-5.1.12-bin.jar</a>: Database library
</li>
<li>
<a href="https://jdbc.postgresql.org/download.html" rel="nofollow" class="external text">postgresql-8.4-701.jdbc4.jar</a>: Database library
</li>
</ol>
<p>
Note that the last two libraries are not currently used in XOWA.
</p>
<h2>
<span class="mw-headline" id="Compilation_instructions_.28ANT_command-line.29">Compilation instructions (ANT command-line)</span>
</h2>
<h3>
<span class="mw-headline" id="Setup_the_XOWA_app">Setup the XOWA app</span>
</h3>
<ul>
<li>
Download the latest XOWA app package for your operating system. For example, if you're on a 64-bit Linux system, "xowa_app_linux_64_v1.9.5.1.zip".
</li>
<li>
Unzip the XOWA app package to a directory. For the sake of simplicity, these instructions assume this directory is "/xowa/"
</li>
<li>
Review your directories. You should have the following:
<ul>
<li>
An XOWA jar: "/xowa/xowa_linux_64.jar"
</li>
<li>
An XOWA "/bin/any/" directory with several jar files. For example, "/xowa/bin/any/java/apache/commons-compress-1.5.jar"
</li>
<li>
An XOWA "/bin/linux_64/" directory with an SWT jar: "/xowa/bin/linux_64/swt/swt.jar"
</li>
</ul>
</li>
</ul>
<h3>
<span class="mw-headline" id="Setup_the_XOWA_source">Setup the XOWA source</span>
</h3>
<ul>
<li>
Download the latest XOWA source archive. For example: "xowa_source_v1.9.5.1.7z"
</li>
<li>
Unzip the source to "/xowa/dev". When you're done, you'll have a file called "/xowa/dev/build.xml" as well as others
</li>
</ul>
<dl>
<dd>
NOTE: if you're not on a Linux 64-bit system, overwrite the swt jar at "/xowa/dev/150_gfui/lib/swt.jar" with the copy from your "/bin/OS" directory. For example, if you're on a 64 bit Windows system, replace "/xowa/dev/150_gfui/lib/swt.jar" with "/bin/windows_64/swt/swt/jar"
</dd>
</dl>
<h3>
<span class="mw-headline" id="Run_the_ant_file">Run the ant file</span>
</h3>
<ul>
<li>
Open up a console, and run "ant -buildfile build.xml -Dplat_name=linux_64"
</li>
</ul>
<h2>
<span class="mw-headline" id="IDE_instructions_.28Eclipse.29">IDE instructions (Eclipse)</span>
</h2>
<h3>
<span class="mw-headline" id="Environment">Environment</span>
</h3>
<p>
The <b>xowa_source.7z</b> was built with Eclipse Indigo. There are no OS dependencies, nor are there dependencies on Eclipse.
</p>
<h3>
<span class="mw-headline" id="Setup">Setup</span>
</h3>
<ul>
<li>
Follow the steps in these two sections from above:
<ul>
<li>
Setup the XOWA app
</li>
<li>
Setup the XOWA source
</li>
</ul>
</li>
<li>
Launch Eclipse. Choose a workbench folder of "/xowa/dev"
</li>
<li>
If the projects don't load, do File -&gt; Import -&gt; Existing Projects Into Workspace
</li>
<li>
Select all projects. Do File -&gt; Refresh.
</li>
<li>
Right-click on 400_xowa in the Package Explorer. Select Debug As -&gt; Java Application. Select Xowa_main. XOWA should launch.
</li>
<li>
Right-click on 400_xowa in the Package Explorer. Select Debug As -&gt; JUnit Test. All tests should pass.
</li>
</ul>
<h3>
<span class="mw-headline" id="Eclipse-specific_settings">Eclipse-specific settings</span>
</h3>
<p>
This section documents specific project customizations that differ from the standard Eclipse defaults.
</p>
<h4>
<span class="mw-headline" id="Project_properties">Project properties</span>
</h4>
<p>
Resource -&gt; Text file encoding -&gt; Other -&gt; UTF-8
</p>
<h4>
<span class="mw-headline" id="Preferences">Preferences</span>
</h4>
<p>
These settings are available under Window -&gt; Preferences
</p>
<ul>
<li>
Disable Spelling
</li>
</ul>
<dl>
<dd>
General -&gt; Editors -&gt; Text Editors -&gt; Spelling
</dd>
</dl>
<ul>
<li>
Ignore Warnings
</li>
</ul>
<dl>
<dd>
Java -&gt; Compiler -&gt; Errors/Warnings
<dl>
<dd>
Annotations -&gt; Unhandled token in '@SuppressWarnings'
</dd>
<dd>
Potential programming problems -&gt; Serializable class without serialVersionUID
</dd>
<dd>
Generic Types -&gt; Unnecessary generic type operation (In Eclipse Luna: "Unchecked generic type operation")
</dd>
<dd>
Generic Types -&gt; Usage of a raw type
</dd>
<dd>
Unnecessary Code -&gt; Unused import
</dd>
</dl>
</dd>
</dl>
<h4>
<span class="mw-headline" id="Configuration_arguments">Configuration arguments</span>
</h4>
<ul>
<li>
Configuration arguments
</li>
</ul>
<dl>
<dd>
Run -&gt; Debug Configurations -&gt; Arguments
<dl>
<dd>
<code>--root_dir /xowa/ --show_license n --show_args n</code>
</dd>
</dl>
</dd>
</dl>
<h2>
<span class="mw-headline" id="Coding_style">Coding style</span>
</h2>
<p>
For many Java programmers my style will appear idiosyncratic if not downright strange.
</p>
<p>
Some background may help explain the current condition:
</p>
<ul>
<li>
Most of the lower libraries originated in C#. They were ported to Java about two to three years ago. As such, many of the idioms are not in Java. This includes exceptions (no checked exceptions), events (no anonymous inner classes) and properties (no getProperty/setProperty pattern).
</li>
<li>
As a corollary to the above, much of the code takes a language-agnostic approach. For example, during the migration, the gui library needed a way to invoke similar methods in .NET Winforms and Java Swing without directly binding to either. Event handling, IO calls, reflection and many other functions fall into this same category as there are a number of differences between the .NET and Java libraries.
</li>
<li>
Even with the above, the style is admittedly eccentric. For this, I will try to standardize it wherever it is inconsistent or whenever it becomes a point of contention.
</li>
</ul>
</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(http://xowa.org/xowa_logo.png);" href="index.html" 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/wiki/home/page/Help/Download_XOWA.html" title='Download the XOWA application'>Download XOWA</a></li>
<li><a href="http://xowa.org/wiki/home/page/Dashboard/Image_databases.html" title='Download offline wikis and image databases'>Download wikis</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-stargin'>
<h3>Getting started</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/System_requirements.html" title='Get XOWA&apos;s system requirements'>Requirements</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/Installation.html" title='Get instructions for installing XOWA'>Installation</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/Simple_Wikipedia.html" title='Learn how to set up Simple Wikipedia'>Simple Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/English_Wikipedia.html" title='Learn how to set up English Wikipedia'>English Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/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-help'>
<h3>Help</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/Help/About.html" title='Get more information about XOWA'>About</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Contents.html" title='View a list of help topics'>Contents</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Media.html" title='Read what others have written about XOWA'>Media</a></li>
<li><a href="http://xowa.org/wiki/home/page/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/wiki/home/page/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>

538
Dev/Command-line/Dumps.html Normal file
View File

@@ -0,0 +1,538 @@
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Dev/Command-line/Dumps - XOWA</title>
<link rel="shortcut icon" href="http://xowa.org/xowa_logo.png" />
<link rel="stylesheet" href="http://xowa.org/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/Dumps</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 generate two types of dumps: file-dumps and html-dumps
</p>
<table class="metadata plainlinks ambox ambox-delete" style="">
<tr>
<td class="mbox-empty-cell">
</td>
<td class="mbox-text" style="">
<p>
<span class="mbox-text-span">Please note that this script is for power users. It is not meant for casual users.</span>
</p>
<p>
<span class="mbox-text-span">Please read through these instructions carefully. If you fail to follow these instructions, you may end up downloading millions of images by accident, and have your IP address banned by Wikimedia.</span>
</p>
<p>
<span class="mbox-text-span">Also, the script will change in the future, and without any warning. There is no backward compatibility. Although the XOWA databases have a fixed format, the scripts do not. If you discover that your script breaks, please refer to this page, contact me for assistance, or go through the code.</span>
</p>
</td>
</tr>
</table>
<p>
<br>
</p>
<div id="toc" class="toc">
<div id="toctitle">
<h2>
Contents
</h2>
</div>
<ul>
<li class="toclevel-1 tocsection-1">
<a href="#Overview"><span class="tocnumber">1</span> <span class="toctext">Overview</span></a>
</li>
<li class="toclevel-1 tocsection-2">
<a href="#Requirements"><span class="tocnumber">2</span> <span class="toctext">Requirements</span></a>
<ul>
<li class="toclevel-2 tocsection-3">
<a href="#commons.wikimedia.org_.28thum"><span class="tocnumber">2.1</span> <span class="toctext">commons.wikimedia.org (thum</span></a>
</li>
<li class="toclevel-2 tocsection-4">
<a href="#www.wikidata.org"><span class="tocnumber">2.2</span> <span class="toctext">www.wikidata.org</span></a>
</li>
<li class="toclevel-2 tocsection-5">
<a href="#Hardware"><span class="tocnumber">2.3</span> <span class="toctext">Hardware</span></a>
</li>
<li class="toclevel-2 tocsection-6">
<a href="#Internet-connectivity_.28optional.29"><span class="tocnumber">2.4</span> <span class="toctext">Internet-connectivity (optional)</span></a>
</li>
<li class="toclevel-2 tocsection-7">
<a href="#Pre-existing_image_databases_for_your_wiki_.28optional.29"><span class="tocnumber">2.5</span> <span class="toctext">Pre-existing image databases for your wiki (optional)</span></a>
</li>
</ul>
</li>
<li class="toclevel-1 tocsection-8">
<a href="#gfs"><span class="tocnumber">3</span> <span class="toctext">gfs</span></a>
</li>
<li class="toclevel-1 tocsection-9">
<a href="#Terms"><span class="tocnumber">4</span> <span class="toctext">Terms</span></a>
<ul>
<li class="toclevel-2 tocsection-10">
<a href="#lnki"><span class="tocnumber">4.1</span> <span class="toctext">lnki</span></a>
</li>
<li class="toclevel-2 tocsection-11">
<a href="#orig"><span class="tocnumber">4.2</span> <span class="toctext">orig</span></a>
</li>
<li class="toclevel-2 tocsection-12">
<a href="#xfer"><span class="tocnumber">4.3</span> <span class="toctext">xfer</span></a>
</li>
<li class="toclevel-2 tocsection-13">
<a href="#fsdb"><span class="tocnumber">4.4</span> <span class="toctext">fsdb</span></a>
</li>
</ul>
</li>
<li class="toclevel-1 tocsection-14">
<a href="#Script"><span class="tocnumber">5</span> <span class="toctext">Script</span></a>
</li>
</ul>
</div>
<h2>
<span class="mw-headline" id="Overview">Overview</span>
</h2>
<p>
The download-thumbs script downloads all thumbs for pages in a specific wiki. It works in the following way:
</p>
<ul>
<li>
It loads a page.
</li>
<li>
It converts the wikitext to HTML
<ul>
<li>
If thumb mode is enabled, it compiles a list of [[File]] links.
</li>
<li>
If HTML-dump mode is enabled, it saves the HTML into XOWA html databases
</li>
</ul>
</li>
<li>
It repeats until there are no more pages
</li>
<li>
If thumb mode, it does the following additional steps
<ul>
<li>
It analyzes the list of [[File]] links to come up with a unique list of thumbs.
</li>
<li>
It downloads the thumbs and creates the XOWA file databases.
</li>
</ul>
</li>
</ul>
<p>
The script for simple wikipedia is listed below.
</p>
<h2>
<span class="mw-headline" id="Requirements">Requirements</span>
</h2>
<h3>
<span class="mw-headline" id="commons.wikimedia.org_.28thum">commons.wikimedia.org (thum</span>
</h3>
<p>
You will need the latest version of commons.wikimedia.org. Note that if you have an older version, you will have missing images or wrong size information.
</p>
<p>
For example, if you have a commons.wikimedia.org from 2015-04-22 and are trying to import a 2015-05-17 English Wikipedia, then any new images added after 2015-04-22 will not be picked up.
</p>
<h3>
<span class="mw-headline" id="www.wikidata.org">www.wikidata.org</span>
</h3>
<p>
You also need to have the latest version of www.wikidata.org. Note that English Wikipedia and other wikis uses Wikidata through the {{#property}} call or Module code. If you have an earlier version, then data will be missing or out of date.
</p>
<h3>
<span class="mw-headline" id="Hardware">Hardware</span>
</h3>
<p>
You should have a recent-generation machine with relatively high-performance hardware, especially if you're planning to generate images for English Wikipedia.
</p>
<p>
For context, here is my current machine setup for generating the image dumps:
</p>
<ul>
<li>
Processor: Intel Core i7-4770K; 3.5 GHz with 8 MB L3 cache
</li>
<li>
Memory: 16 GB DDR3 SDRAM DDR3 1600 (PC3 12800)
</li>
<li>
Hard Drive: 1TB 10,000 RPM 64MB Cache SATA 6.0Gb/s
</li>
<li>
Operating System: openSUSE 13.2
</li>
</ul>
<p>
(Note: The hardware was assembled in late 2013 for about $1,600 US dollars.)
</p>
<p>
For English Wikipedia, it still takes about 50 hours for the entire process.
</p>
<h3>
<span class="mw-headline" id="Internet-connectivity_.28optional.29">Internet-connectivity (optional)</span>
</h3>
<p>
You should have a broadband connection to the internet. The script will need to download dump files from Wikimedia and some dump files (like English Wikipedia) will be in the 10s of GB.
</p>
<p>
You can opt to download these files separately and place them in the appropriate location beforehand. However, the script below assumes that the machine is always online. If you are offline, you will need to comment the "util.download" lines yourself.
</p>
<h3>
<span class="mw-headline" id="Pre-existing_image_databases_for_your_wiki_.28optional.29">Pre-existing image databases for your wiki (optional)</span>
</h3>
<p>
XOWA will automatically re-use the images from existing image databases so that you do not have to redownload them. This is particularly useful for large wikis where redownloading millions of images would be unwanted.
</p>
<p>
It is strongly advised that you download the image database for your wiki. You can find a full list here: <a href="http://xowa.sourceforge.net/image_dbs.html" rel="nofollow" class="external free">http://xowa.sourceforge.net/image_dbs.html</a> Note that if an image database does not exist for your wiki, you can still proceed to use the script
</p>
<ul>
<li>
If you have v1 image databases, they should be placed in <code>/xowa/file/wiki_domain-prv</code>. For example, English Wikipedia should have <code>/xowa/file/en.wikipedia.org-prv/fsdb.main/fsdb.bin.0000.sqlite3</code>
</li>
<li>
If you have v2 image databases, they should be placed in <code>/xowa/wiki/wiki_domain/prv</code>. For example, English Wikipedia should have <code>/xowa/wiki/en.wikipedia.org/prv/en.wikipedia.org-file-ns.000-db.001.xowa</code>
</li>
</ul>
<h2>
<span class="mw-headline" id="gfs">gfs</span>
</h2>
<p>
The script is written in the <code>gfs</code> format. This is a custom scripting format specific to XOWA. It is similar to JSON, but also supports commenting.
</p>
<p>
Unfortunately the error-handling for gfs is quite minimal. When making changes, please do them in small steps and be prepared to go to backups.
</p>
<p>
The following is a brief list of rules:
</p>
<ul>
<li>
Comments are made with either "//","\n" or "/*","*/". For example: <code>// single-line comment</code> or <code>/* multi-line comment*/</code>
</li>
<li>
Booleans are "y" and "n" (yes / no or true / false). For example: <code>enabled = 'y';</code>
</li>
<li>
Numbers are 32-bit integers and are not enclosed in quotes. For example, <code>count = 10000;</code>
</li>
<li>
Strings are surrounded by apostrophes (') or quotes ("). For example: <code>key = 'val';</code>
</li>
<li>
Statements are terminated by a semi-colon (;). For example: <code>procedure1;</code>
</li>
<li>
Statements can take arguments in parentheses. For example: <code>procedure1('argument1', 'argument2', 'argument3');</code>
</li>
<li>
Statements are grouped with curly braces. ({}). For example: <code>group {procedure1; procedure2; procedure3;}</code>
</li>
</ul>
<h2>
<span class="mw-headline" id="Terms">Terms</span>
</h2>
<h3>
<span class="mw-headline" id="lnki">lnki</span>
</h3>
<p>
A <code>lnki</code> is short for "<b>l</b>i<b>nk</b> <b>i</b>nternal". It refers to all wikitext with the double bracket syntax: [[A]]. A more elaborate example for files would be [[File:A.png|thumb|200x300px|upright=.80]]. Note that the abbreviation was chosen to differentiate it from <code>lnke</code> which is short for "<b>l</b>i<b>nk</b> <b>e</b>nternal". For the purposes of the script, all lnki data comes from the current wiki's data dump
</p>
<h3>
<span class="mw-headline" id="orig">orig</span>
</h3>
<ul>
<li>
An <code>orig</code> is short for "<b>orig</b>inal file". It refers to the original file metadata. For the purposes of this script, all orig data comes from commons.wikimedia.org
</li>
</ul>
<h3>
<span class="mw-headline" id="xfer">xfer</span>
</h3>
<ul>
<li>
An <code>xfer</code> is short for "transfer file". It refers to the actual file to be downloaded.
</li>
</ul>
<h3>
<span class="mw-headline" id="fsdb">fsdb</span>
</h3>
<ul>
<li>
The <code>fsdb</code> is short for "<b>f</b>ile <b>s</b>ystem <b>d</b>ata<b>b</b>ase". It refers to the internal table format of the XOWA image databases.
</li>
</ul>
<p>
<br>
</p>
<h2>
<span class="mw-headline" id="Script">Script</span>
</h2>
<pre class='code'>
app.bldr.pause_at_end_('n');
app.scripts.run_file_by_type('xowa_cfg_app');
app.bldr.cmds {
// build commons database; this only needs to be done once, whenever commons is updated
add ('commons.wikimedia.org' , 'util.cleanup') {delete_all = 'y';}
add ('commons.wikimedia.org' , 'util.download') {dump_type = 'pages-articles';}
add ('commons.wikimedia.org' , 'util.download') {dump_type = 'categorylinks';}
add ('commons.wikimedia.org' , 'util.download') {dump_type = 'page_props';}
add ('commons.wikimedia.org' , 'util.download') {dump_type = 'image';}
add ('commons.wikimedia.org' , 'text.init');
add ('commons.wikimedia.org' , 'text.page');
add ('commons.wikimedia.org' , 'text.cat.core');
add ('commons.wikimedia.org' , 'text.cat.link');
add ('commons.wikimedia.org' , 'text.cat.hidden');
add ('commons.wikimedia.org' , 'text.term');
add ('commons.wikimedia.org' , 'text.css');
add ('commons.wikimedia.org' , 'wiki.image');
add ('commons.wikimedia.org' , 'file.page_regy') {build_commons = 'y'}
add ('commons.wikimedia.org' , 'wiki.page_dump.make');
add ('commons.wikimedia.org' , 'wiki.redirect') {commit_interval = 1000; progress_interval = 100; cleanup_interval = 100;}
add ('commons.wikimedia.org' , 'util.cleanup') {delete_tmp = 'y'; delete_by_match('*.xml|*.sql|*.bz2|*.gz');}
// build wikidata database; this only needs to be done once, whenever wikidata is updated
add ('www.wikidata.org' , 'util.cleanup') {delete_all = 'y';}
add ('www.wikidata.org' , 'util.download') {dump_type = 'pages-articles';}
add ('www.wikidata.org' , 'util.download') {dump_type = 'categorylinks';}
add ('www.wikidata.org' , 'util.download') {dump_type = 'page_props';}
add ('www.wikidata.org' , 'util.download') {dump_type = 'image';}
add ('www.wikidata.org' , 'text.init');
add ('www.wikidata.org' , 'text.page');
add ('www.wikidata.org' , 'text.cat.core');
add ('www.wikidata.org' , 'text.cat.link');
add ('www.wikidata.org' , 'text.cat.hidden');
add ('www.wikidata.org' , 'text.term');
add ('www.wikidata.org' , 'text.css');
add ('www.wikidata.org' , 'util.cleanup') {delete_tmp = 'y'; delete_by_match('*.xml|*.sql|*.bz2|*.gz');}
// build simple.wikipedia.org
add ('simple.wikipedia.org' , 'util.cleanup') {delete_all = 'y';}
add ('simple.wikipedia.org' , 'util.download') {dump_type = 'pages-articles';}
add ('simple.wikipedia.org' , 'util.download') {dump_type = 'categorylinks';}
add ('simple.wikipedia.org' , 'util.download') {dump_type = 'page_props';}
add ('simple.wikipedia.org' , 'util.download') {dump_type = 'image';}
add ('simple.wikipedia.org' , 'util.download') {dump_type = 'pagelinks';}
add ('simple.wikipedia.org' , 'text.init');
add ('simple.wikipedia.org' , 'text.page') {
// calculate redirect_id for #REDIRECT pages. needed for html databases
redirect_id_enabled = 'y';
}
add ('simple.wikipedia.org' , 'text.search');
// upload desktop css
add ('simple.wikipedia.org' , 'text.css');
// upload mobile css
add ('simple.wikipedia.org' , 'text.css') {css_key = 'xowa.mobile'; /* css_dir = 'C:\xowa\user\anonymous\wiki\simple.wikipedia.org-mobile\html\'; */}
add ('simple.wikipedia.org' , 'text.cat.core');
add ('simple.wikipedia.org' , 'text.cat.link');
add ('simple.wikipedia.org' , 'text.cat.hidden');
add ('simple.wikipedia.org' , 'text.term');
// create local "page" tables in each "text" database for "lnki_temp"
add ('simple.wikipedia.org' , 'wiki.page_dump.make');
// create a redirect table for pages in the File namespace
add ('simple.wikipedia.org' , 'wiki.redirect') {commit_interval = 1000; progress_interval = 100; cleanup_interval = 100;}
// create an "image" table to get the metadata for all files in the current wiki
add ('simple.wikipedia.org' , 'wiki.image');
// parse all page-to-page links
add ('simple.wikipedia.org' , 'wiki.page_link');
// calculate a score for each page using the page-to-page links
add ('simple.wikipedia.org' , 'search.page__page_score') {iteration_max = 100;}
// update link score statistics for the search tables
add ('simple.wikipedia.org' , 'search.link__link_score') {page_rank_enabled = 'y';}
// update word count statistics for the search_word table
add ('simple.wikipedia.org' , 'search.word__link_count')
// cleanup all downloaded files as well as temporary files
add ('simple.wikipedia.org' , 'util.cleanup') {delete_tmp = 'y'; delete_by_match('*.xml|*.sql|*.bz2|*.gz');}
// parse every page in the listed namespace and gather data on their lnkis.
// this step will take the longest amount of time.
add ('simple.wikipedia.org' , 'file.lnki_temp') {
// save data every # of pages
commit_interval = 10000;
// update progress every # of pages
progress_interval = 50;
// free memory by flushing internal caches every # of pages
cleanup_interval = 50;
// specify # of pages to read into memory at a time, where # is in MB. For example, 25 means read approximately 25 MB of page text into memory
select_size = 25;
// namespaces to parse. See en.wikipedia.org/wiki/Help:Namespaces
ns_ids = '0|4|14';
// enable generation of ".html" databases. This is experimental and will increase processing time by 20% - 25%
// gen_hdump = 'y';
}
// aggregate the lnkis
add ('simple.wikipedia.org' , 'file.lnki_regy');
// generate orig metadata for files in the current wiki (for example, for pages in en.wikipedia.org/wiki/File:*)
add ('simple.wikipedia.org' , 'file.page_regy') {build_commons = 'n';}
// generate all orig metadata for all lnkis
add ('simple.wikipedia.org' , 'file.orig_regy');
// generate list of files to download based on "orig_regy" and XOWA image code
add ('simple.wikipedia.org' , 'file.xfer_temp.thumb');
// aggregate list one more time
add ('simple.wikipedia.org' , 'file.xfer_regy');
// identify images that have already been downloaded
add ('simple.wikipedia.org' , 'file.xfer_regy_update');
// download images. This step may also take a long time, depending on how many images are needed
add ('simple.wikipedia.org' , 'file.fsdb_make') {
commit_interval = 1000; progress_interval = 200; select_interval = 10000;
ns_ids = '0|4|14';
// specify whether original wiki databases are v1 (.sqlite3) or v2 (.xowa)
src_bin_mgr__fsdb_version = 'v1';
// always redownload certain files
src_bin_mgr__fsdb_skip_wkrs = 'page_gt_1|small_size';
// allow downloads from wikimedia
src_bin_mgr__wmf_enabled = 'y';
}
// generate registry of original metadata by file title
add ('simple.wikipedia.org' , 'file.orig_reg');
// drop page_dump tables
add ('simple.wikipedia.org' , 'wiki.page_dump.drop');
}
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(http://xowa.org/xowa_logo.png);" href="index.html" 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/wiki/home/page/Help/Download_XOWA.html" title='Download the XOWA application'>Download XOWA</a></li>
<li><a href="http://xowa.org/wiki/home/page/Dashboard/Image_databases.html" title='Download offline wikis and image databases'>Download wikis</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-stargin'>
<h3>Getting started</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/System_requirements.html" title='Get XOWA&apos;s system requirements'>Requirements</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/Installation.html" title='Get instructions for installing XOWA'>Installation</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/Simple_Wikipedia.html" title='Learn how to set up Simple Wikipedia'>Simple Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/English_Wikipedia.html" title='Learn how to set up English Wikipedia'>English Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/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-help'>
<h3>Help</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/Help/About.html" title='Get more information about XOWA'>About</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Contents.html" title='View a list of help topics'>Contents</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Media.html" title='Read what others have written about XOWA'>Media</a></li>
<li><a href="http://xowa.org/wiki/home/page/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/wiki/home/page/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,283 @@
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Dev/Command-line/Overview - XOWA</title>
<link rel="shortcut icon" href="http://xowa.org/xowa_logo.png" />
<link rel="stylesheet" href="http://xowa.org/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/Overview</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/wiki/home/page/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(http://xowa.org/xowa_logo.png);" href="index.html" 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/wiki/home/page/Help/Download_XOWA.html" title='Download the XOWA application'>Download XOWA</a></li>
<li><a href="http://xowa.org/wiki/home/page/Dashboard/Image_databases.html" title='Download offline wikis and image databases'>Download wikis</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-stargin'>
<h3>Getting started</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/System_requirements.html" title='Get XOWA&apos;s system requirements'>Requirements</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/Installation.html" title='Get instructions for installing XOWA'>Installation</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/Simple_Wikipedia.html" title='Learn how to set up Simple Wikipedia'>Simple Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/English_Wikipedia.html" title='Learn how to set up English Wikipedia'>English Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/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-help'>
<h3>Help</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/Help/About.html" title='Get more information about XOWA'>About</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Contents.html" title='View a list of help topics'>Contents</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Media.html" title='Read what others have written about XOWA'>Media</a></li>
<li><a href="http://xowa.org/wiki/home/page/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/wiki/home/page/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,121 @@
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Dev/Command-line/Script - XOWA</title>
<link rel="shortcut icon" href="http://xowa.org/xowa_logo.png" />
<link rel="stylesheet" href="http://xowa.org/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/Command-line/Script</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">
<table class="metadata plainlinks ambox ambox-delete" style="">
<tr>
<td class="mbox-empty-cell">
</td>
<td class="mbox-text" style="">
<p>
<span class="mbox-text-span">Note: This page is obsolete. It is preserved for historical reference only.</span>
</p>
</td>
</tr>
</table>
</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(http://xowa.org/xowa_logo.png);" href="index.html" 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/wiki/home/page/Help/Download_XOWA.html" title='Download the XOWA application'>Download XOWA</a></li>
<li><a href="http://xowa.org/wiki/home/page/Dashboard/Image_databases.html" title='Download offline wikis and image databases'>Download wikis</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-stargin'>
<h3>Getting started</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/System_requirements.html" title='Get XOWA&apos;s system requirements'>Requirements</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/Installation.html" title='Get instructions for installing XOWA'>Installation</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/Simple_Wikipedia.html" title='Learn how to set up Simple Wikipedia'>Simple Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/English_Wikipedia.html" title='Learn how to set up English Wikipedia'>English Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/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-help'>
<h3>Help</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/Help/About.html" title='Get more information about XOWA'>About</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Contents.html" title='View a list of help topics'>Contents</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Media.html" title='Read what others have written about XOWA'>Media</a></li>
<li><a href="http://xowa.org/wiki/home/page/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/wiki/home/page/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,209 @@
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Dev/Command-line/Site meta - XOWA</title>
<link rel="shortcut icon" href="http://xowa.org/xowa_logo.png" />
<link rel="stylesheet" href="http://xowa.org/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/Site meta</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">
<div id="toc" class="toc">
<div id="toctitle">
<h2>
Contents
</h2>
</div>
<ul>
<li class="toclevel-1 tocsection-1">
<a href="#Background"><span class="tocnumber">1</span> <span class="toctext">Background</span></a>
</li>
<li class="toclevel-1 tocsection-2">
<a href="#Process"><span class="tocnumber">2</span> <span class="toctext">Process</span></a>
</li>
</ul>
</div>
<p>
XOWA can download the metadata for the Wikimedia wikis
</p>
<h2>
<span class="mw-headline" id="Background">Background</span>
</h2>
<p>
Wikimedia exposes an API for accessing the meta-data for a given wiki. For example, for English Wikipedia, the following will return most of the meta-data around the wiki installation.
</p>
<pre class='code'>
https://en.wikipedia.org/w/api.php?action=query&amp;meta=siteinfo&amp;siprop=general|namespaces|statistics|interwikimap|namespacealiases|specialpagealiases|libraries|extensions|skins|magicwords|functionhooks|showhooks|extensiontags|protocols|defaultoptions|languages
</pre>
<p>
XOWA can call this API to download metadata for each wiki and save them in a database for data-processing. XOWA uses this info to resolve namespaces, but it will also incorporate other metadata from this API in future releases.
</p>
<h2>
<span class="mw-headline" id="Process">Process</span>
</h2>
<p>
Assuming you are on a Windows system with XOWA installed at <code>C:\xowa</code>
</p>
<ul>
<li>
Create a plain text-file called "C:\xowa\build_site_meta.gfs"
</li>
<li>
Save the following text to the file:
</li>
</ul>
<pre class='code'>
app.bldr.pause_at_end_('n');
app.scripts.run_file_by_type('xowa_cfg_app');
app.bldr.cmds {
// NOTE: wiki doesn't matter; just use any wiki name that is on your system
add('simple.wikipedia.org', 'util.site_meta') {
// path of the database to generate; default is C:\xowa\bin\any\xowa\cfg\wiki\site_meta.sqlite3
db_url = 'C:\xowa\site_meta__enwiki.sqlite3';
// skip any wikis which have been downloaded after this time. default is now() - 1 day
// the purpose of this argument is to avoid recalling the api if it's already been called recently.
// for example, if the script runs for 800 wikis and fails for 3 wikis,
// you can rerun the script again and it will only download the 3 failed ones; not all 800
cutoff_time = '2015-07-01';
// list of wikis to download; note that each wiki must be separated by a new-line. default is all wikis listed in [[Dashboard/Import/Online]]
wikis =
'en.wikipedia.org
en.wiktionary.org';
}
}
app.bldr.run;
</pre>
<ul>
<li>
Run the file with the following:
</li>
</ul>
<pre class='code'>
java -jar xowa_windows.jar --app_mode cmd --cmd_file C:\xowa\build_site_meta.gfs
</pre>
<ul>
<li>
Open C:\xowa\site_meta__enwiki.sqlite3 in a sqlite shell and run the following:
</li>
</ul>
<pre class='code'>
SELECT * FROM site_statistic;
</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(http://xowa.org/xowa_logo.png);" href="index.html" 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/wiki/home/page/Help/Download_XOWA.html" title='Download the XOWA application'>Download XOWA</a></li>
<li><a href="http://xowa.org/wiki/home/page/Dashboard/Image_databases.html" title='Download offline wikis and image databases'>Download wikis</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-stargin'>
<h3>Getting started</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/System_requirements.html" title='Get XOWA&apos;s system requirements'>Requirements</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/Installation.html" title='Get instructions for installing XOWA'>Installation</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/Simple_Wikipedia.html" title='Learn how to set up Simple Wikipedia'>Simple Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/English_Wikipedia.html" title='Learn how to set up English Wikipedia'>English Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/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-help'>
<h3>Help</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/Help/About.html" title='Get more information about XOWA'>About</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Contents.html" title='View a list of help topics'>Contents</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Media.html" title='Read what others have written about XOWA'>Media</a></li>
<li><a href="http://xowa.org/wiki/home/page/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/wiki/home/page/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,538 @@
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Dev/Command-line/Thumbs - XOWA</title>
<link rel="shortcut icon" href="http://xowa.org/xowa_logo.png" />
<link rel="stylesheet" href="http://xowa.org/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/Thumbs</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 generate two types of dumps: file-dumps and html-dumps
</p>
<table class="metadata plainlinks ambox ambox-delete" style="">
<tr>
<td class="mbox-empty-cell">
</td>
<td class="mbox-text" style="">
<p>
<span class="mbox-text-span">Please note that this script is for power users. It is not meant for casual users.</span>
</p>
<p>
<span class="mbox-text-span">Please read through these instructions carefully. If you fail to follow these instructions, you may end up downloading millions of images by accident, and have your IP address banned by Wikimedia.</span>
</p>
<p>
<span class="mbox-text-span">Also, the script will change in the future, and without any warning. There is no backward compatibility. Although the XOWA databases have a fixed format, the scripts do not. If you discover that your script breaks, please refer to this page, contact me for assistance, or go through the code.</span>
</p>
</td>
</tr>
</table>
<p>
<br>
</p>
<div id="toc" class="toc">
<div id="toctitle">
<h2>
Contents
</h2>
</div>
<ul>
<li class="toclevel-1 tocsection-1">
<a href="#Overview"><span class="tocnumber">1</span> <span class="toctext">Overview</span></a>
</li>
<li class="toclevel-1 tocsection-2">
<a href="#Requirements"><span class="tocnumber">2</span> <span class="toctext">Requirements</span></a>
<ul>
<li class="toclevel-2 tocsection-3">
<a href="#commons.wikimedia.org_.28thum"><span class="tocnumber">2.1</span> <span class="toctext">commons.wikimedia.org (thum</span></a>
</li>
<li class="toclevel-2 tocsection-4">
<a href="#www.wikidata.org"><span class="tocnumber">2.2</span> <span class="toctext">www.wikidata.org</span></a>
</li>
<li class="toclevel-2 tocsection-5">
<a href="#Hardware"><span class="tocnumber">2.3</span> <span class="toctext">Hardware</span></a>
</li>
<li class="toclevel-2 tocsection-6">
<a href="#Internet-connectivity_.28optional.29"><span class="tocnumber">2.4</span> <span class="toctext">Internet-connectivity (optional)</span></a>
</li>
<li class="toclevel-2 tocsection-7">
<a href="#Pre-existing_image_databases_for_your_wiki_.28optional.29"><span class="tocnumber">2.5</span> <span class="toctext">Pre-existing image databases for your wiki (optional)</span></a>
</li>
</ul>
</li>
<li class="toclevel-1 tocsection-8">
<a href="#gfs"><span class="tocnumber">3</span> <span class="toctext">gfs</span></a>
</li>
<li class="toclevel-1 tocsection-9">
<a href="#Terms"><span class="tocnumber">4</span> <span class="toctext">Terms</span></a>
<ul>
<li class="toclevel-2 tocsection-10">
<a href="#lnki"><span class="tocnumber">4.1</span> <span class="toctext">lnki</span></a>
</li>
<li class="toclevel-2 tocsection-11">
<a href="#orig"><span class="tocnumber">4.2</span> <span class="toctext">orig</span></a>
</li>
<li class="toclevel-2 tocsection-12">
<a href="#xfer"><span class="tocnumber">4.3</span> <span class="toctext">xfer</span></a>
</li>
<li class="toclevel-2 tocsection-13">
<a href="#fsdb"><span class="tocnumber">4.4</span> <span class="toctext">fsdb</span></a>
</li>
</ul>
</li>
<li class="toclevel-1 tocsection-14">
<a href="#Script"><span class="tocnumber">5</span> <span class="toctext">Script</span></a>
</li>
</ul>
</div>
<h2>
<span class="mw-headline" id="Overview">Overview</span>
</h2>
<p>
The download-thumbs script downloads all thumbs for pages in a specific wiki. It works in the following way:
</p>
<ul>
<li>
It loads a page.
</li>
<li>
It converts the wikitext to HTML
<ul>
<li>
If thumb mode is enabled, it compiles a list of [[File]] links.
</li>
<li>
If HTML-dump mode is enabled, it saves the HTML into XOWA html databases
</li>
</ul>
</li>
<li>
It repeats until there are no more pages
</li>
<li>
If thumb mode, it does the following additional steps
<ul>
<li>
It analyzes the list of [[File]] links to come up with a unique list of thumbs.
</li>
<li>
It downloads the thumbs and creates the XOWA file databases.
</li>
</ul>
</li>
</ul>
<p>
The script for simple wikipedia is listed below.
</p>
<h2>
<span class="mw-headline" id="Requirements">Requirements</span>
</h2>
<h3>
<span class="mw-headline" id="commons.wikimedia.org_.28thum">commons.wikimedia.org (thum</span>
</h3>
<p>
You will need the latest version of commons.wikimedia.org. Note that if you have an older version, you will have missing images or wrong size information.
</p>
<p>
For example, if you have a commons.wikimedia.org from 2015-04-22 and are trying to import a 2015-05-17 English Wikipedia, then any new images added after 2015-04-22 will not be picked up.
</p>
<h3>
<span class="mw-headline" id="www.wikidata.org">www.wikidata.org</span>
</h3>
<p>
You also need to have the latest version of www.wikidata.org. Note that English Wikipedia and other wikis uses Wikidata through the {{#property}} call or Module code. If you have an earlier version, then data will be missing or out of date.
</p>
<h3>
<span class="mw-headline" id="Hardware">Hardware</span>
</h3>
<p>
You should have a recent-generation machine with relatively high-performance hardware, especially if you're planning to generate images for English Wikipedia.
</p>
<p>
For context, here is my current machine setup for generating the image dumps:
</p>
<ul>
<li>
Processor: Intel Core i7-4770K; 3.5 GHz with 8 MB L3 cache
</li>
<li>
Memory: 16 GB DDR3 SDRAM DDR3 1600 (PC3 12800)
</li>
<li>
Hard Drive: 1TB 10,000 RPM 64MB Cache SATA 6.0Gb/s
</li>
<li>
Operating System: openSUSE 13.2
</li>
</ul>
<p>
(Note: The hardware was assembled in late 2013 for about $1,600 US dollars.)
</p>
<p>
For English Wikipedia, it still takes about 50 hours for the entire process.
</p>
<h3>
<span class="mw-headline" id="Internet-connectivity_.28optional.29">Internet-connectivity (optional)</span>
</h3>
<p>
You should have a broadband connection to the internet. The script will need to download dump files from Wikimedia and some dump files (like English Wikipedia) will be in the 10s of GB.
</p>
<p>
You can opt to download these files separately and place them in the appropriate location beforehand. However, the script below assumes that the machine is always online. If you are offline, you will need to comment the "util.download" lines yourself.
</p>
<h3>
<span class="mw-headline" id="Pre-existing_image_databases_for_your_wiki_.28optional.29">Pre-existing image databases for your wiki (optional)</span>
</h3>
<p>
XOWA will automatically re-use the images from existing image databases so that you do not have to redownload them. This is particularly useful for large wikis where redownloading millions of images would be unwanted.
</p>
<p>
It is strongly advised that you download the image database for your wiki. You can find a full list here: <a href="http://xowa.sourceforge.net/image_dbs.html" rel="nofollow" class="external free">http://xowa.sourceforge.net/image_dbs.html</a> Note that if an image database does not exist for your wiki, you can still proceed to use the script
</p>
<ul>
<li>
If you have v1 image databases, they should be placed in <code>/xowa/file/wiki_domain-prv</code>. For example, English Wikipedia should have <code>/xowa/file/en.wikipedia.org-prv/fsdb.main/fsdb.bin.0000.sqlite3</code>
</li>
<li>
If you have v2 image databases, they should be placed in <code>/xowa/wiki/wiki_domain/prv</code>. For example, English Wikipedia should have <code>/xowa/wiki/en.wikipedia.org/prv/en.wikipedia.org-file-ns.000-db.001.xowa</code>
</li>
</ul>
<h2>
<span class="mw-headline" id="gfs">gfs</span>
</h2>
<p>
The script is written in the <code>gfs</code> format. This is a custom scripting format specific to XOWA. It is similar to JSON, but also supports commenting.
</p>
<p>
Unfortunately the error-handling for gfs is quite minimal. When making changes, please do them in small steps and be prepared to go to backups.
</p>
<p>
The following is a brief list of rules:
</p>
<ul>
<li>
Comments are made with either "//","\n" or "/*","*/". For example: <code>// single-line comment</code> or <code>/* multi-line comment*/</code>
</li>
<li>
Booleans are "y" and "n" (yes / no or true / false). For example: <code>enabled = 'y';</code>
</li>
<li>
Numbers are 32-bit integers and are not enclosed in quotes. For example, <code>count = 10000;</code>
</li>
<li>
Strings are surrounded by apostrophes (') or quotes ("). For example: <code>key = 'val';</code>
</li>
<li>
Statements are terminated by a semi-colon (;). For example: <code>procedure1;</code>
</li>
<li>
Statements can take arguments in parentheses. For example: <code>procedure1('argument1', 'argument2', 'argument3');</code>
</li>
<li>
Statements are grouped with curly braces. ({}). For example: <code>group {procedure1; procedure2; procedure3;}</code>
</li>
</ul>
<h2>
<span class="mw-headline" id="Terms">Terms</span>
</h2>
<h3>
<span class="mw-headline" id="lnki">lnki</span>
</h3>
<p>
A <code>lnki</code> is short for "<b>l</b>i<b>nk</b> <b>i</b>nternal". It refers to all wikitext with the double bracket syntax: [[A]]. A more elaborate example for files would be [[File:A.png|thumb|200x300px|upright=.80]]. Note that the abbreviation was chosen to differentiate it from <code>lnke</code> which is short for "<b>l</b>i<b>nk</b> <b>e</b>nternal". For the purposes of the script, all lnki data comes from the current wiki's data dump
</p>
<h3>
<span class="mw-headline" id="orig">orig</span>
</h3>
<ul>
<li>
An <code>orig</code> is short for "<b>orig</b>inal file". It refers to the original file metadata. For the purposes of this script, all orig data comes from commons.wikimedia.org
</li>
</ul>
<h3>
<span class="mw-headline" id="xfer">xfer</span>
</h3>
<ul>
<li>
An <code>xfer</code> is short for "transfer file". It refers to the actual file to be downloaded.
</li>
</ul>
<h3>
<span class="mw-headline" id="fsdb">fsdb</span>
</h3>
<ul>
<li>
The <code>fsdb</code> is short for "<b>f</b>ile <b>s</b>ystem <b>d</b>ata<b>b</b>ase". It refers to the internal table format of the XOWA image databases.
</li>
</ul>
<p>
<br>
</p>
<h2>
<span class="mw-headline" id="Script">Script</span>
</h2>
<pre class='code'>
app.bldr.pause_at_end_('n');
app.scripts.run_file_by_type('xowa_cfg_app');
app.bldr.cmds {
// build commons database; this only needs to be done once, whenever commons is updated
add ('commons.wikimedia.org' , 'util.cleanup') {delete_all = 'y';}
add ('commons.wikimedia.org' , 'util.download') {dump_type = 'pages-articles';}
add ('commons.wikimedia.org' , 'util.download') {dump_type = 'categorylinks';}
add ('commons.wikimedia.org' , 'util.download') {dump_type = 'page_props';}
add ('commons.wikimedia.org' , 'util.download') {dump_type = 'image';}
add ('commons.wikimedia.org' , 'text.init');
add ('commons.wikimedia.org' , 'text.page');
add ('commons.wikimedia.org' , 'text.cat.core');
add ('commons.wikimedia.org' , 'text.cat.link');
add ('commons.wikimedia.org' , 'text.cat.hidden');
add ('commons.wikimedia.org' , 'text.term');
add ('commons.wikimedia.org' , 'text.css');
add ('commons.wikimedia.org' , 'wiki.image');
add ('commons.wikimedia.org' , 'file.page_regy') {build_commons = 'y'}
add ('commons.wikimedia.org' , 'wiki.page_dump.make');
add ('commons.wikimedia.org' , 'wiki.redirect') {commit_interval = 1000; progress_interval = 100; cleanup_interval = 100;}
add ('commons.wikimedia.org' , 'util.cleanup') {delete_tmp = 'y'; delete_by_match('*.xml|*.sql|*.bz2|*.gz');}
// build wikidata database; this only needs to be done once, whenever wikidata is updated
add ('www.wikidata.org' , 'util.cleanup') {delete_all = 'y';}
add ('www.wikidata.org' , 'util.download') {dump_type = 'pages-articles';}
add ('www.wikidata.org' , 'util.download') {dump_type = 'categorylinks';}
add ('www.wikidata.org' , 'util.download') {dump_type = 'page_props';}
add ('www.wikidata.org' , 'util.download') {dump_type = 'image';}
add ('www.wikidata.org' , 'text.init');
add ('www.wikidata.org' , 'text.page');
add ('www.wikidata.org' , 'text.cat.core');
add ('www.wikidata.org' , 'text.cat.link');
add ('www.wikidata.org' , 'text.cat.hidden');
add ('www.wikidata.org' , 'text.term');
add ('www.wikidata.org' , 'text.css');
add ('www.wikidata.org' , 'util.cleanup') {delete_tmp = 'y'; delete_by_match('*.xml|*.sql|*.bz2|*.gz');}
// build simple.wikipedia.org
add ('simple.wikipedia.org' , 'util.cleanup') {delete_all = 'y';}
add ('simple.wikipedia.org' , 'util.download') {dump_type = 'pages-articles';}
add ('simple.wikipedia.org' , 'util.download') {dump_type = 'categorylinks';}
add ('simple.wikipedia.org' , 'util.download') {dump_type = 'page_props';}
add ('simple.wikipedia.org' , 'util.download') {dump_type = 'image';}
add ('simple.wikipedia.org' , 'util.download') {dump_type = 'pagelinks';}
add ('simple.wikipedia.org' , 'text.init');
add ('simple.wikipedia.org' , 'text.page') {
// calculate redirect_id for #REDIRECT pages. needed for html databases
redirect_id_enabled = 'y';
}
add ('simple.wikipedia.org' , 'text.search');
// upload desktop css
add ('simple.wikipedia.org' , 'text.css');
// upload mobile css
add ('simple.wikipedia.org' , 'text.css') {css_key = 'xowa.mobile'; /* css_dir = 'C:\xowa\user\anonymous\wiki\simple.wikipedia.org-mobile\html\'; */}
add ('simple.wikipedia.org' , 'text.cat.core');
add ('simple.wikipedia.org' , 'text.cat.link');
add ('simple.wikipedia.org' , 'text.cat.hidden');
add ('simple.wikipedia.org' , 'text.term');
// create local "page" tables in each "text" database for "lnki_temp"
add ('simple.wikipedia.org' , 'wiki.page_dump.make');
// create a redirect table for pages in the File namespace
add ('simple.wikipedia.org' , 'wiki.redirect') {commit_interval = 1000; progress_interval = 100; cleanup_interval = 100;}
// create an "image" table to get the metadata for all files in the current wiki
add ('simple.wikipedia.org' , 'wiki.image');
// parse all page-to-page links
add ('simple.wikipedia.org' , 'wiki.page_link');
// calculate a score for each page using the page-to-page links
add ('simple.wikipedia.org' , 'search.page__page_score') {iteration_max = 100;}
// update link score statistics for the search tables
add ('simple.wikipedia.org' , 'search.link__link_score') {page_rank_enabled = 'y';}
// update word count statistics for the search_word table
add ('simple.wikipedia.org' , 'search.word__link_count')
// cleanup all downloaded files as well as temporary files
add ('simple.wikipedia.org' , 'util.cleanup') {delete_tmp = 'y'; delete_by_match('*.xml|*.sql|*.bz2|*.gz');}
// parse every page in the listed namespace and gather data on their lnkis.
// this step will take the longest amount of time.
add ('simple.wikipedia.org' , 'file.lnki_temp') {
// save data every # of pages
commit_interval = 10000;
// update progress every # of pages
progress_interval = 50;
// free memory by flushing internal caches every # of pages
cleanup_interval = 50;
// specify # of pages to read into memory at a time, where # is in MB. For example, 25 means read approximately 25 MB of page text into memory
select_size = 25;
// namespaces to parse. See en.wikipedia.org/wiki/Help:Namespaces
ns_ids = '0|4|14';
// enable generation of ".html" databases. This is experimental and will increase processing time by 20% - 25%
// gen_hdump = 'y';
}
// aggregate the lnkis
add ('simple.wikipedia.org' , 'file.lnki_regy');
// generate orig metadata for files in the current wiki (for example, for pages in en.wikipedia.org/wiki/File:*)
add ('simple.wikipedia.org' , 'file.page_regy') {build_commons = 'n';}
// generate all orig metadata for all lnkis
add ('simple.wikipedia.org' , 'file.orig_regy');
// generate list of files to download based on "orig_regy" and XOWA image code
add ('simple.wikipedia.org' , 'file.xfer_temp.thumb');
// aggregate list one more time
add ('simple.wikipedia.org' , 'file.xfer_regy');
// identify images that have already been downloaded
add ('simple.wikipedia.org' , 'file.xfer_regy_update');
// download images. This step may also take a long time, depending on how many images are needed
add ('simple.wikipedia.org' , 'file.fsdb_make') {
commit_interval = 1000; progress_interval = 200; select_interval = 10000;
ns_ids = '0|4|14';
// specify whether original wiki databases are v1 (.sqlite3) or v2 (.xowa)
src_bin_mgr__fsdb_version = 'v1';
// always redownload certain files
src_bin_mgr__fsdb_skip_wkrs = 'page_gt_1|small_size';
// allow downloads from wikimedia
src_bin_mgr__wmf_enabled = 'y';
}
// generate registry of original metadata by file title
add ('simple.wikipedia.org' , 'file.orig_reg');
// drop page_dump tables
add ('simple.wikipedia.org' , 'wiki.page_dump.drop');
}
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(http://xowa.org/xowa_logo.png);" href="index.html" 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/wiki/home/page/Help/Download_XOWA.html" title='Download the XOWA application'>Download XOWA</a></li>
<li><a href="http://xowa.org/wiki/home/page/Dashboard/Image_databases.html" title='Download offline wikis and image databases'>Download wikis</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-stargin'>
<h3>Getting started</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/System_requirements.html" title='Get XOWA&apos;s system requirements'>Requirements</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/Installation.html" title='Get instructions for installing XOWA'>Installation</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/Simple_Wikipedia.html" title='Learn how to set up Simple Wikipedia'>Simple Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/English_Wikipedia.html" title='Learn how to set up English Wikipedia'>English Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/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-help'>
<h3>Help</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/Help/About.html" title='Get more information about XOWA'>About</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Contents.html" title='View a list of help topics'>Contents</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Media.html" title='Read what others have written about XOWA'>Media</a></li>
<li><a href="http://xowa.org/wiki/home/page/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/wiki/home/page/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,206 @@
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Dev/Command-line/Wikidata - XOWA</title>
<link rel="shortcut icon" href="http://xowa.org/xowa_logo.png" />
<link rel="stylesheet" href="http://xowa.org/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/Wikidata</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">
<div id="toc" class="toc">
<div id="toctitle">
<h2>
Contents
</h2>
</div>
<ul>
<li class="toclevel-1 tocsection-1">
<a href="#Import_using_the_XML_dump"><span class="tocnumber">1</span> <span class="toctext">Import using the XML dump</span></a>
</li>
<li class="toclevel-1 tocsection-2">
<a href="#Import_using_the_JSON_dump"><span class="tocnumber">2</span> <span class="toctext">Import using the JSON dump</span></a>
</li>
</ul>
</div>
<p>
XOWA can import Wikidata through the command-line
</p>
<h2>
<span class="mw-headline" id="Import_using_the_XML_dump">Import using the XML dump</span>
</h2>
<p>
XOWA can build wikidata using the XML dump at www.mediwa/wikidatawiki/. This import is basically the same as an import of any other wiki.
</p>
<p>
The script for the XML import follows.
</p>
<pre class='code'>
// build wikidata database; this only needs to be done once, whenever wikidata is updated
add ('www.wikidata.org' , 'util.cleanup') {delete_all = 'y';}
add ('www.wikidata.org' , 'util.download') {dump_type = 'pages-articles';}
add ('www.wikidata.org' , 'util.download') {dump_type = 'categorylinks';}
add ('www.wikidata.org' , 'util.download') {dump_type = 'page_props';}
add ('www.wikidata.org' , 'util.download') {dump_type = 'image';}
add ('www.wikidata.org' , 'text.init');
add ('www.wikidata.org' , 'text.page');
add ('www.wikidata.org' , 'text.cat.core');
add ('www.wikidata.org' , 'text.cat.link');
add ('www.wikidata.org' , 'text.cat.hidden');
add ('www.wikidata.org' , 'text.term');
add ('www.wikidata.org' , 'text.css');
add ('www.wikidata.org' , 'util.cleanup') {delete_tmp = 'y'; delete_by_match('*.xml|*.sql|*.bz2|*.gz');}
</pre>
<h2>
<span class="mw-headline" id="Import_using_the_JSON_dump">Import using the JSON dump</span>
</h2>
<p>
As of v2.6.3, XOWA also provides basic support for building wikidata from the JSON dump. This support was added for the following reasons:
</p>
<ul>
<li>
<b>Current delay in XML dumps</b>: The last good wikidata XML dump was 2+ months old due to problems with dump generation. See: <a href="https://phabricator.wikimedia.org/T98585" rel="nofollow" class="external free">https://phabricator.wikimedia.org/T98585</a>
</li>
<li>
<b>JSON dumps recommended</b>: Wikidata seems to prefer using the JSON dump over the XML dump. See: <a href="http://www.wikidata.org/wiki/Wikidata:Database_download" rel="nofollow" class="external free">http://www.wikidata.org/wiki/Wikidata:Database_download</a>
</li>
<li>
<b>JSON dumps are more frequent</b>: The JSON dumps have been dumping regularly on a weekly basis. In contrast the XML dumps take 3 - 4 weeks.
</li>
</ul>
<p>
Despite these reasons, there are limitations to the JSON dump.
</p>
<ul>
<li>
<b>Non-JSON pages not available</b>: The JSON dump doesn't provide other pages, such as the Main Page or MediaWiki pages. Only pages in the main and property namespaces are available. This is by design. See: <a href="https://lists.wikimedia.org/pipermail/wikidata/2015-June/006441.html" rel="nofollow" class="external free">https://lists.wikimedia.org/pipermail/wikidata/2015-June/006441.html</a>
</li>
<li>
<b>Page metadata not available</b> : Certain properties are not available, such as page_id and last_modified. XOWA provides substitutes for these values, but they will not match the Wikimedia version
</li>
</ul>
<p>
The script for the JSON import follows.
</p>
<pre class='code'>
add ('www.wikidata.org' , 'util.cleanup') {delete_all = 'y';}
// TODO: add ('www.wikidata.org' , 'util.download') {dump_type = 'wikidata-json';}
add ('www.wikidata.org' , 'wbase.json_dump');
add ('www.wikidata.org' , 'text.term');
add ('www.wikidata.org' , 'text.css');
add ('www.wikidata.org' , 'util.cleanup') {delete_tmp = 'y'; delete_by_match('*.xml|*.sql|*.bz2|*.gz|*.json');}
</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(http://xowa.org/xowa_logo.png);" href="index.html" 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/wiki/home/page/Help/Download_XOWA.html" title='Download the XOWA application'>Download XOWA</a></li>
<li><a href="http://xowa.org/wiki/home/page/Dashboard/Image_databases.html" title='Download offline wikis and image databases'>Download wikis</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-stargin'>
<h3>Getting started</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/System_requirements.html" title='Get XOWA&apos;s system requirements'>Requirements</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/Installation.html" title='Get instructions for installing XOWA'>Installation</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/Simple_Wikipedia.html" title='Learn how to set up Simple Wikipedia'>Simple Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/English_Wikipedia.html" title='Learn how to set up English Wikipedia'>English Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/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-help'>
<h3>Help</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/Help/About.html" title='Get more information about XOWA'>About</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Contents.html" title='View a list of help topics'>Contents</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Media.html" title='Read what others have written about XOWA'>Media</a></li>
<li><a href="http://xowa.org/wiki/home/page/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/wiki/home/page/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,306 @@
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Dev/Config files/Details - XOWA</title>
<link rel="shortcut icon" href="http://xowa.org/xowa_logo.png" />
<link rel="stylesheet" href="http://xowa.org/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/Details</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">
<div id="toc" class="toc">
<div id="toctitle">
<h2>
Contents
</h2>
</div>
<ul>
<li class="toclevel-1 tocsection-1">
<a href="#General_characteristics"><span class="tocnumber">1</span> <span class="toctext">General characteristics</span></a>
</li>
<li class="toclevel-1 tocsection-2">
<a href="#Comments"><span class="tocnumber">2</span> <span class="toctext">Comments</span></a>
</li>
<li class="toclevel-1 tocsection-3">
<a href="#Whitespace"><span class="tocnumber">3</span> <span class="toctext">Whitespace</span></a>
</li>
<li class="toclevel-1 tocsection-4">
<a href="#Quotes"><span class="tocnumber">4</span> <span class="toctext">Quotes</span></a>
</li>
<li class="toclevel-1 tocsection-5">
<a href="#Booleans"><span class="tocnumber">5</span> <span class="toctext">Booleans</span></a>
</li>
<li class="toclevel-1 tocsection-6">
<a href="#Integers"><span class="tocnumber">6</span> <span class="toctext">Integers</span></a>
</li>
</ul>
</div>
<h2>
<span class="mw-headline" id="General_characteristics">General characteristics</span>
</h2>
<p>
A gfs file has the following general characteristics:
</p>
<ul>
<li>
Encoding is UTF-8 (without Byte Order Mark)
</li>
<li>
Line-endings should be <code>\n</code> not <code>\r\n</code>.
</li>
</ul>
<dl>
<dd>
There is support for <code>\r\n</code>, but for safety's sake, please use <code>\n</code>.
</dd>
</dl>
<ul>
<li>
Text is case-sensitive. There is a difference between <code>app</code> and <code>APP</code>.
</li>
</ul>
<h2>
<span class="mw-headline" id="Comments">Comments</span>
</h2>
<p>
Comments can be indicated by the conventional C comments of <code>//</code> or <code>/**/</code>. For example, any text between <code>/*</code> and <code>*/</code> is ignored.
</p>
<h2>
<span class="mw-headline" id="Whitespace">Whitespace</span>
</h2>
<p>
Whitespace is not significant. There is no difference between the following commands.
</p>
<ul>
<li>
no whitespace
</li>
</ul>
<pre>
app.wikis.get('en.wikipedia.org');
</pre>
<ul>
<li>
multiple spaces (ASCII 32)
</li>
</ul>
<pre>
app . wikis . get ( 'en.wikipedia.org' ) ;
</pre>
<ul>
<li>
spaces and new lines (ASCII 32 and ASCII 10)
</li>
</ul>
<pre>
app
. wikis
. get ( 'en.wikipedia.org' )
;
</pre>
<p>
Note that tabs (ASCII 9) and carriage returns (ASCII 13) are permitted but not recommended.
</p>
<h2>
<span class="mw-headline" id="Quotes">Quotes</span>
</h2>
<ul>
<li>
Strings should be quoted. Quote characters are the apostrophe (<code>'</code>) or the quote (<code>"</code>). Note that <code>'</code> is often used.
</li>
<li>
A special quote sequence of <code>&amp;lt:['\n</code> and <code>\n}':]&gt;</code> is used to handle text with significant delimiters
</li>
</ul>
<dl>
<dd>
For example, the following is identical to <code>app.wikis.get('en.wikipedia.org');</code>
</dd>
</dl>
<pre>
app.wikis.get(
&lt;:['
en.wikipedia.org
']:&gt;
);
</pre>
<dl>
<dd>
Note that this quote sequence allows processing a mixture of various syntax forms without escaping. This is especially useful for wiki text which can have elements of HTML and significant other symbols.
</dd>
</dl>
<h2>
<span class="mw-headline" id="Booleans">Booleans</span>
</h2>
<p>
Booleans can be indicated in different forms as per the following table:
</p>
<table>
<tr>
<td>
Value
</td>
<td>
<b>true</b>
</td>
<td>
<b>false</b>
</td>
</tr>
<tr>
<td>
Text (uppercase)
</td>
<td>
<code>'TRUE'</code>
</td>
<td>
<code>'FALSE'</code>
</td>
</tr>
<tr>
<td>
Text (lowercase)
</td>
<td>
<code>'true'</code>
</td>
<td>
<code>'false'</code>
</td>
</tr>
<tr>
<td>
Text (simple)
</td>
<td>
<code>'y'</code>
</td>
<td>
<code>'n'</code>
</td>
</tr>
<tr>
<td>
Number
</td>
<td>
<code>1</code>
</td>
<td>
<code>0</code>
</td>
</tr>
</table>
<p>
Note that for brevity's sake, <code>'y'</code> and <code>'n'</code> will be used.
</p>
<h2>
<span class="mw-headline" id="Integers">Integers</span>
</h2>
<p>
Integers can be indicated with or without quotes. Note that without quotes is recommended.
</p>
<p>
Integers can not include commas or decimal places. For example, <code>1,234</code> is not valid. Use <code>1234</code> instead.
</p>
</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(http://xowa.org/xowa_logo.png);" href="index.html" 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/wiki/home/page/Help/Download_XOWA.html" title='Download the XOWA application'>Download XOWA</a></li>
<li><a href="http://xowa.org/wiki/home/page/Dashboard/Image_databases.html" title='Download offline wikis and image databases'>Download wikis</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-stargin'>
<h3>Getting started</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/System_requirements.html" title='Get XOWA&apos;s system requirements'>Requirements</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/Installation.html" title='Get instructions for installing XOWA'>Installation</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/Simple_Wikipedia.html" title='Learn how to set up Simple Wikipedia'>Simple Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/English_Wikipedia.html" title='Learn how to set up English Wikipedia'>English Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/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-help'>
<h3>Help</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/Help/About.html" title='Get more information about XOWA'>About</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Contents.html" title='View a list of help topics'>Contents</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Media.html" title='Read what others have written about XOWA'>Media</a></li>
<li><a href="http://xowa.org/wiki/home/page/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/wiki/home/page/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,212 @@
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Dev/Config files/Examples - XOWA</title>
<link rel="shortcut icon" href="http://xowa.org/xowa_logo.png" />
<link rel="stylesheet" href="http://xowa.org/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/Examples</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="Changing_a_keyboard_shortcut">Changing a keyboard shortcut</span>
</h2>
<ul>
<li>
Open xowa.gfs in a text editor.
</li>
<li>
Search for <code>'app_exit'</code> (Note the single quotes).
</li>
</ul>
<dl>
<dd>
The following line should be found:
<dl>
<dd>
<code>.set('app_exit' , 'mod.c+key.q')</code>
</dd>
</dl>
</dd>
<dd>
This line defines Control+Q as the shortcut to exit the application.
</dd>
</dl>
<ul>
<li>
Change the shortcut from Control+Q to Control+Z by changing <code>key.q</code> to <code>key.z</code>.
</li>
</ul>
<dl>
<dd>
When you are done you should have the following line (note the red highlight):
<dl>
<dd>
<code>.set('app_exit' , 'mod.c+key.<span style="color:red;">z</span>')</code>
</dd>
</dl>
</dd>
</dl>
<ul>
<li>
Save xowa.gfs and close the file.
</li>
<li>
Run XOWA. Press Control+Z to exit the application.
</li>
</ul>
<h2>
<span class="mw-headline" id="Changing_the_HTML_view">Changing the HTML view</span>
</h2>
<ul>
<li>
Open xowa.gfs in a text editor.
</li>
<li>
Search for the line <code>.page_read_(</code>
</li>
</ul>
<dl>
<dd>
The following lines define the HTML used for the "Read" tab.
</dd>
<dd>
For now, let's add a "Hello World!"
</dd>
</dl>
<ul>
<li>
Scroll down about 20 lines. You will see the following line:
</li>
</ul>
<dl>
<dd>
<dl>
<dd>
<code>&lt;div id="siteSub"&gt;From XOWA:....</code> .
</dd>
</dl>
</dd>
</dl>
<ul>
<li>
Add a "Hello World!" right before "From XOWA:". When you are done you should have the following line (note the red highlight):
</li>
</ul>
<dl>
<dd>
<dl>
<dd>
<code>&lt;div id="siteSub"&gt;<span style="color:red;">Hello World!</span> From XOWA:....</code> .
</dd>
</dl>
</dd>
</dl>
<ul>
<li>
Save xowa.gfs and close the file.
</li>
<li>
Run XOWA. Note the "Hello World!" text at the top of the page.
</li>
</ul>
</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(http://xowa.org/xowa_logo.png);" href="index.html" 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/wiki/home/page/Help/Download_XOWA.html" title='Download the XOWA application'>Download XOWA</a></li>
<li><a href="http://xowa.org/wiki/home/page/Dashboard/Image_databases.html" title='Download offline wikis and image databases'>Download wikis</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-stargin'>
<h3>Getting started</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/System_requirements.html" title='Get XOWA&apos;s system requirements'>Requirements</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/Installation.html" title='Get instructions for installing XOWA'>Installation</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/Simple_Wikipedia.html" title='Learn how to set up Simple Wikipedia'>Simple Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/English_Wikipedia.html" title='Learn how to set up English Wikipedia'>English Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/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-help'>
<h3>Help</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/Help/About.html" title='Get more information about XOWA'>About</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Contents.html" title='View a list of help topics'>Contents</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Media.html" title='Read what others have written about XOWA'>Media</a></li>
<li><a href="http://xowa.org/wiki/home/page/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/wiki/home/page/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>

174
Dev/Config_files/Files.html Normal file
View File

@@ -0,0 +1,174 @@
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Dev/Config files/Files - XOWA</title>
<link rel="shortcut icon" href="http://xowa.org/xowa_logo.png" />
<link rel="stylesheet" href="http://xowa.org/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/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">
<p>
XOWA currently saves its config files in multiple locations. These will be itemized at a later writing.
</p>
<p>
For the purposes of general use, you will generally be concerned with the following:
</p>
<ul>
<li>
<b>/xowa/xowa.gfs</b>.
</li>
</ul>
<dl>
<dd>
This is the main config file loaded by the application
</dd>
<dd>
Note that the xowa.gfs will change from version to version. Any change here will be lost during upgrades.
</dd>
</dl>
<ul>
<li>
<b>/xowa/user/anonymous/app/data/cfg/user_system_cfg.gfs</b>
</li>
</ul>
<dl>
<dd>
This config is used for changes made by the UI
</dd>
<dd>
These changes are meant to persist from version to version. However, they should not be directly edited by a user. Any manual change here may be lost in future versions.
</dd>
<dd>
Any API that shows up here is intended to be backward compatible. Note that this is not a guarantee, but it is the closest you will ever get. If any setting here needs to change, then XOWA will be responsible for automatically changing it.
</dd>
</dl>
<ul>
<li>
<b>/xowa/user/anonymous/app/data/cfg/user_custom_cfg.gfs</b>
</li>
</ul>
<dl>
<dd>
This config is meant for users to store their config settings.
</dd>
<dd>
It is not modified by XOWA at all. It will not be overwritten during upgrades.
</dd>
<dd>
However, note that the "gfs" syntax is not fixed, and may change from version to version. There should be no expectation of backward compatibility. If you need to make lots of custom changes, please notify me, and I will try to make the proper provisions in the UI, or "solidify" the API/object model.
</dd>
</dl>
<p>
Finally, note that the last two files are called at the bottom of /xowa/xowa.gfs
</p>
<pre>
app.gfs_mgr.run_file_by_type('user_system_cfg');
app.gfs_mgr.run_file_by_type('user_custom_cfg');
</pre>
<p>
If you wish to disable them for testing purposes you can comment out these lines.
</p>
<p>
<br>
</p>
</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(http://xowa.org/xowa_logo.png);" href="index.html" 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/wiki/home/page/Help/Download_XOWA.html" title='Download the XOWA application'>Download XOWA</a></li>
<li><a href="http://xowa.org/wiki/home/page/Dashboard/Image_databases.html" title='Download offline wikis and image databases'>Download wikis</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-stargin'>
<h3>Getting started</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/System_requirements.html" title='Get XOWA&apos;s system requirements'>Requirements</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/Installation.html" title='Get instructions for installing XOWA'>Installation</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/Simple_Wikipedia.html" title='Learn how to set up Simple Wikipedia'>Simple Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/English_Wikipedia.html" title='Learn how to set up English Wikipedia'>English Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/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-help'>
<h3>Help</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/Help/About.html" title='Get more information about XOWA'>About</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Contents.html" title='View a list of help topics'>Contents</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Media.html" title='Read what others have written about XOWA'>Media</a></li>
<li><a href="http://xowa.org/wiki/home/page/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/wiki/home/page/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>

130
Dev/Config_files/Index.html Normal file
View File

@@ -0,0 +1,130 @@
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Dev/Config files/Index - XOWA</title>
<link rel="shortcut icon" href="http://xowa.org/xowa_logo.png" />
<link rel="stylesheet" href="http://xowa.org/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/Index</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>
This is a list of pages relating to XOWA config files (.gfs)
</p>
<ul>
<li>
<a href="http://xowa.org/wiki/home/page/Dev/Config_files/Overview.html" id="xolnki_2" title="Dev/Config files/Overview">Overview</a>
</li>
<li>
<a href="http://xowa.org/wiki/home/page/Dev/Config_files/Examples.html" id="xolnki_3" title="Dev/Config files/Examples">Examples</a>
</li>
<li>
<a href="http://xowa.org/wiki/home/page/Dev/Config_files/Files.html" id="xolnki_4" title="Dev/Config files/Files">Files</a>
</li>
<li>
<a href="http://xowa.org/wiki/home/page/Dev/Config_files/Details.html" id="xolnki_5" title="Dev/Config files/Details">Details and format</a>
</li>
<li>
<a href="http://xowa.org/wiki/home/page/Dev/Config_files/Syntax.html" id="xolnki_6" title="Dev/Config files/Syntax">Syntax and object model</a>
</li>
</ul>
</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(http://xowa.org/xowa_logo.png);" href="index.html" 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/wiki/home/page/Help/Download_XOWA.html" title='Download the XOWA application'>Download XOWA</a></li>
<li><a href="http://xowa.org/wiki/home/page/Dashboard/Image_databases.html" title='Download offline wikis and image databases'>Download wikis</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-stargin'>
<h3>Getting started</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/System_requirements.html" title='Get XOWA&apos;s system requirements'>Requirements</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/Installation.html" title='Get instructions for installing XOWA'>Installation</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/Simple_Wikipedia.html" title='Learn how to set up Simple Wikipedia'>Simple Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/English_Wikipedia.html" title='Learn how to set up English Wikipedia'>English Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/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-help'>
<h3>Help</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/Help/About.html" title='Get more information about XOWA'>About</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Contents.html" title='View a list of help topics'>Contents</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Media.html" title='Read what others have written about XOWA'>Media</a></li>
<li><a href="http://xowa.org/wiki/home/page/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/wiki/home/page/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,170 @@
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Dev/Config files/Overview - XOWA</title>
<link rel="shortcut icon" href="http://xowa.org/xowa_logo.png" />
<link rel="stylesheet" href="http://xowa.org/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/Overview</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/wiki/home/page/Dev/Config_files_files/Examples.html" id="xolnki_2" title="Dev/Config files files/Examples">Dev/Config_files 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(http://xowa.org/xowa_logo.png);" href="index.html" 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/wiki/home/page/Help/Download_XOWA.html" title='Download the XOWA application'>Download XOWA</a></li>
<li><a href="http://xowa.org/wiki/home/page/Dashboard/Image_databases.html" title='Download offline wikis and image databases'>Download wikis</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-stargin'>
<h3>Getting started</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/System_requirements.html" title='Get XOWA&apos;s system requirements'>Requirements</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/Installation.html" title='Get instructions for installing XOWA'>Installation</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/Simple_Wikipedia.html" title='Learn how to set up Simple Wikipedia'>Simple Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/English_Wikipedia.html" title='Learn how to set up English Wikipedia'>English Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/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-help'>
<h3>Help</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/Help/About.html" title='Get more information about XOWA'>About</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Contents.html" title='View a list of help topics'>Contents</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Media.html" title='Read what others have written about XOWA'>Media</a></li>
<li><a href="http://xowa.org/wiki/home/page/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/wiki/home/page/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,157 @@
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Dev/Config files/Syntax - XOWA</title>
<link rel="shortcut icon" href="http://xowa.org/xowa_logo.png" />
<link rel="stylesheet" href="http://xowa.org/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/Syntax</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="Syntax">Syntax</span>
</h2>
<ul>
<li>
Syntax follows an object-oriented convention.
</li>
</ul>
<dl>
<dd>
For example, <code>app.wikis('en.wikipedia.org')</code> can be expanded to
<dl>
<dd>
find an object that accepts the "app" message in the current context
</dd>
<dd>
find an object that accepts the "wikis" message in the "app" context
</dd>
<dd>
pass the last object a message that has one argument with a value of 'en.wikipedia.org'
</dd>
</dl>
</dd>
</dl>
<ul>
<li>
Note that instances/methods can return itself. This allows chaining multiple message calls.
</li>
</ul>
<dl>
<dd>
For example, in <code>app.wikis.get('en.wikipedia.org').files.cfg_download</code>, enabled_ and redownload_ both return the cfg_download object. This allows the following call
</dd>
</dl>
<pre>
app.wikis.get('en.wikipedia.org').files.cfg_download
.enabled_('y') // returns cfg_download
.redownload_('none') // uses the cfg_download from .enabled_ and calls .redownload_
;
</pre>
<p>
Note that the above is the same as the following:
</p>
<pre>
app.wikis.get('en.wikipedia.org').files.cfg_download.enabled_('y');
app.wikis.get('en.wikipedia.org').files.cfg_download.redownload_('none');
</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(http://xowa.org/xowa_logo.png);" href="index.html" 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/wiki/home/page/Help/Download_XOWA.html" title='Download the XOWA application'>Download XOWA</a></li>
<li><a href="http://xowa.org/wiki/home/page/Dashboard/Image_databases.html" title='Download offline wikis and image databases'>Download wikis</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-stargin'>
<h3>Getting started</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/System_requirements.html" title='Get XOWA&apos;s system requirements'>Requirements</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/Installation.html" title='Get instructions for installing XOWA'>Installation</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/Simple_Wikipedia.html" title='Learn how to set up Simple Wikipedia'>Simple Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/English_Wikipedia.html" title='Learn how to set up English Wikipedia'>English Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/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-help'>
<h3>Help</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/Help/About.html" title='Get more information about XOWA'>About</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Contents.html" title='View a list of help topics'>Contents</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Media.html" title='Read what others have written about XOWA'>Media</a></li>
<li><a href="http://xowa.org/wiki/home/page/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/wiki/home/page/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,192 @@
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Dev/Database/Shell/File - XOWA</title>
<link rel="shortcut icon" href="http://xowa.org/xowa_logo.png" />
<link rel="stylesheet" href="http://xowa.org/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/Database/Shell/File</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>
<a href="http://xowa.org/wiki/home/page/Template:Css/Sqlite.html" id="xolnki_2" title="Template:Css/Sqlite">Template:Css/Sqlite</a>
</p>
<h3>
<span class="mw-headline" id="Get_the_file">Get the file</span>
</h3>
<ul>
<li>
launch sqlite3 shell. See <a href="http://xowa.org/wiki/home/page/Dev/Sqlite/Shell.html" id="xolnki_3" title="Dev/Sqlite/Shell">Dev/Sqlite/Shell</a>
</li>
<li>
Turn on some options
</li>
</ul>
<pre class='sqlite-sql'>
-- enables column headers
.header on
-- enables column view
.mode column
.width 40 80
</pre>
<ul>
<li>
Get a list of thumbs and their database
</li>
</ul>
<pre class='sqlite-sql'>
SELECT f.fil_name
, t.thm_w
, tb.dbb_url
FROM fsdb_fil f
JOIN fsdb_thm t ON f.fil_id = t.thm_owner_id
JOIN fsdb_dbb tb ON t.thm_bin_db_id = tb.dbb_uid
WHERE f.fil_name LIKE 'Earth%'
LIMIT 10
;
</pre>
<dl>
<dd>
The following output should be returned
</dd>
</dl>
<pre>
dbb_url fil_name
---------------------------------------- --------------------------------------------------------------------------------
en.wikipedia.org-file-ns.000-db.001.xowa Earth_from_Apollo_11_after_translunar_injection.jpg
en.wikipedia.org-file-ns.000-db.001.xowa Earth-moon.jpg
en.wikipedia.org-file-ns.000-db.001.xowa Earth-moon.jpg
en.wikipedia.org-file-ns.000-db.001.xowa Earth_Day_Flag.png
en.wikipedia.org-file-ns.000-db.001.xowa Earth_precession.jpg
en.wikipedia.org-file-ns.000-db.001.xowa Earth_Day_Flag.png
en.wikipedia.org-file-ns.000-db.001.xowa Earthenware_architecture_models,_Eastern_Han_Dynasty,_5.JPG
en.wikipedia.org-file-ns.000-db.001.xowa Earth_coordinates.PNG
en.wikipedia.org-file-ns.000-db.001.xowa Earth_symbol.svg
en.wikipedia.org-file-ns.000-db.001.xowa Earth-cutaway-schematic-english.svg
</pre>
<ul>
<li>
Output some thumbs to the file-system
</li>
</ul>
<pre>
ATTACH 'en.wikipedia.org-file-ns.000-db.001.xowa' AS 'bin_db';
SELECT writefile(Cast(t.thm_size AS varchar(10)) || 'px-' || f.fil_name, tb.bin_data) AS file_data
FROM fsdb_fil f
JOIN fsdb_thm t ON f.fil_id = t.thm_owner_id
JOIN bin_db.fsdb_bin tb ON t.thm_id = tb.bin_owner_id
WHERE fil_name = 'Earth-moon.jpg';
DETACH 'bin_db';
</pre>
<ul>
<li>
See a listing of the files
</li>
</ul>
<pre>
sqlite&gt; .shell dir /b *px-*
497px-Earth-moon.jpg
644px-Earth-moon.jpg
</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(http://xowa.org/xowa_logo.png);" href="index.html" 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/wiki/home/page/Help/Download_XOWA.html" title='Download the XOWA application'>Download XOWA</a></li>
<li><a href="http://xowa.org/wiki/home/page/Dashboard/Image_databases.html" title='Download offline wikis and image databases'>Download wikis</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-stargin'>
<h3>Getting started</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/System_requirements.html" title='Get XOWA&apos;s system requirements'>Requirements</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/Installation.html" title='Get instructions for installing XOWA'>Installation</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/Simple_Wikipedia.html" title='Learn how to set up Simple Wikipedia'>Simple Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/English_Wikipedia.html" title='Learn how to set up English Wikipedia'>English Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/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-help'>
<h3>Help</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/Help/About.html" title='Get more information about XOWA'>About</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Contents.html" title='View a list of help topics'>Contents</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Media.html" title='Read what others have written about XOWA'>Media</a></li>
<li><a href="http://xowa.org/wiki/home/page/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/wiki/home/page/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>

125
Dev/Design/CSS.html Normal file
View File

@@ -0,0 +1,125 @@
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Dev/Design/CSS - XOWA</title>
<link rel="shortcut icon" href="http://xowa.org/xowa_logo.png" />
<link rel="stylesheet" href="http://xowa.org/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/Design/CSS</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 wiki pages are styled with CSS.
</p>
<h2>
<span class="mw-headline" id="Overview">Overview</span>
</h2>
<p>
XOWA stores the CSS for a wiki page in the following directory: C:\xowa\user\anonymous\wiki\ For example, for simple.wikipedia.org, the css is in C:\xowa\user\anonymous\wiki\simple.wikipedia.org
</p>
<p>
The logo in the upper right-hand corner is called logo.png and stored in C:\xowa\user\anonymous\wiki\simple.wikipedia.org\html\logo.png
</p>
<p>
The CSS files are downloaded automatically from Wikimedia servers. xowa_common.css is the main file. xowa_wiki.css is the contents of the css at simple.wikipedia.org/wiki/MediaWiki:Commons.css
</p>
</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(http://xowa.org/xowa_logo.png);" href="index.html" 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/wiki/home/page/Help/Download_XOWA.html" title='Download the XOWA application'>Download XOWA</a></li>
<li><a href="http://xowa.org/wiki/home/page/Dashboard/Image_databases.html" title='Download offline wikis and image databases'>Download wikis</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-stargin'>
<h3>Getting started</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/System_requirements.html" title='Get XOWA&apos;s system requirements'>Requirements</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/Installation.html" title='Get instructions for installing XOWA'>Installation</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/Simple_Wikipedia.html" title='Learn how to set up Simple Wikipedia'>Simple Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/English_Wikipedia.html" title='Learn how to set up English Wikipedia'>English Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/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-help'>
<h3>Help</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/Help/About.html" title='Get more information about XOWA'>About</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Contents.html" title='View a list of help topics'>Contents</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Media.html" title='Read what others have written about XOWA'>Media</a></li>
<li><a href="http://xowa.org/wiki/home/page/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/wiki/home/page/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,227 @@
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Dev/Design/Data dump format - XOWA</title>
<link rel="shortcut icon" href="http://xowa.org/xowa_logo.png" />
<link rel="stylesheet" href="http://xowa.org/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/Design/Data dump format</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>
The Wikimedia data dump files are released in compressed forms: <a href="http://en.wikipedia.org/bzip2" rel="nofollow" class="external text">bzip2</a> or <a href="http://en.wikipedia.org/gzip" rel="nofollow" class="external text">gzip</a>. Prior to v0.5.2, XOWA required that the files be uncompressed in order to read them. v0.5.2 allows the user the option to either read directly from the compressed or uncompressed file.
</p>
<div id="toc" class="toc">
<div id="toctitle">
<h2>
Contents
</h2>
</div>
<ul>
<li class="toclevel-1 tocsection-1">
<a href="#bzip2:_disk_space_vs_speed"><span class="tocnumber">1</span> <span class="toctext">bzip2: disk space vs speed</span></a>
</li>
<li class="toclevel-1 tocsection-2">
<a href="#bzip2:_Application_install_.28GUI.29"><span class="tocnumber">2</span> <span class="toctext">bzip2: Application install (GUI)</span></a>
</li>
<li class="toclevel-1 tocsection-3">
<a href="#Command-line_install"><span class="tocnumber">3</span> <span class="toctext">Command-line install</span></a>
</li>
<li class="toclevel-1 tocsection-4">
<a href="#gzip"><span class="tocnumber">4</span> <span class="toctext">gzip</span></a>
</li>
<li class="toclevel-1 tocsection-5">
<a href="#References"><span class="tocnumber">5</span> <span class="toctext">References</span></a>
</li>
</ul>
</div>
<h2>
<span class="mw-headline" id="bzip2:_disk_space_vs_speed">bzip2: disk space vs speed</span>
</h2>
<p>
Currently, reading from a bzip2 file is much slower than unzipping and reading from the xml file.<sup id="cite_ref-0" class="reference"><a href="#cite_note-0">[1]</a></sup>
</p>
<p>
For example, using a 10 GB English Wikipedia dump file:
</p>
<ul>
<li>
<b>unzip</b> takes 120 minutes and +40 GB extra disk space. This process includes unzipping to .xml with 7-zip (40 min: 40 GB) and then importing the wiki (80 min)
</li>
<li>
<b>bzip2</b> takes 330 minutes and + 0 GB extra disk space. This process includes reading directly from the .bz2 file (250 min: 0 GB) and importing the wiki (80 min)
</li>
</ul>
<p>
If you have the extra disk space, you will want to use the <b>unzip</b> route. If you are low on disk space, then you can use the <b>bzip2</b> route instead
</p>
<h2>
<span class="mw-headline" id="bzip2:_Application_install_.28GUI.29">bzip2: Application install (GUI)</span>
</h2>
<p>
By default, the application install uses the <b>unzip</b> route.
</p>
<p>
To change it to the <b>bzip2</b> route:
</p>
<ul>
<li>
Go to <a href="http://xowa.org/wiki/home/page/Options/Import.html" id="xolnki_2" title="Options/Import" class="xowa-visited">Options/Import</a>
</li>
<li>
Change <b>Custom wiki commands</b> to <code>wiki.download,wiki.import</code>
</li>
</ul>
<dl>
<dd>
Note: the key step is to remove <code>wiki.unzip</code> after <code>wiki.download</code>
</dd>
</dl>
<h2>
<span class="mw-headline" id="Command-line_install">Command-line install</span>
</h2>
<p>
The <code>core_init</code> build step now has an extra property: <code>src_bz2_fil_</code>. A sample invocation would be
</p>
<pre>
.add('simple.wikipedia.org', 'core.init').src_bz2_fil_('/home/download/simplewiki-latest-pages-articles.bz2').owner
</pre>
<p>
Note that XOWA can also auto-detect the appropriate file. For example, using a directory of /xowa/wiki/simple.wikipedia.org/
</p>
<ul>
<li>
If a .bz2 file is there, it will use it
</li>
<li>
If a .xml file is there, it will use it
</li>
<li>
If both a .bz2 file and a .xml file are there, it will use the .xml file. (since the .xml will be faster)
</li>
<li>
If neither are there, it will fail
</li>
</ul>
<h2>
<span class="mw-headline" id="gzip">gzip</span>
</h2>
<p>
Currently, gzip is only used for the /category2/ system.
</p>
<ul>
<li>
For application setup, .gz is always used (there is no unzipping)
</li>
<li>
For CLI, either .gz or .sql can be used. Note that usage follows the same rules as described above for .bz2 / .xml.
</li>
</ul>
<h2>
<span class="mw-headline" id="References">References</span>
</h2>
<ol class="references">
<li id="cite_note-0">
<span class="mw-cite-backlink"><a href="#cite_ref-0">^</a></span> <span class="reference-text">This seems to be a result of Java's lack of support for an unsigned byte data-type, as well as other performance gains from a native C++/C application. (7-zip on Windows; bzip2 on Linux)</span>
</li>
</ol>
</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(http://xowa.org/xowa_logo.png);" href="index.html" 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/wiki/home/page/Help/Download_XOWA.html" title='Download the XOWA application'>Download XOWA</a></li>
<li><a href="http://xowa.org/wiki/home/page/Dashboard/Image_databases.html" title='Download offline wikis and image databases'>Download wikis</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-stargin'>
<h3>Getting started</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/System_requirements.html" title='Get XOWA&apos;s system requirements'>Requirements</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/Installation.html" title='Get instructions for installing XOWA'>Installation</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/Simple_Wikipedia.html" title='Learn how to set up Simple Wikipedia'>Simple Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/English_Wikipedia.html" title='Learn how to set up English Wikipedia'>English Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/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-help'>
<h3>Help</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/Help/About.html" title='Get more information about XOWA'>About</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Contents.html" title='View a list of help topics'>Contents</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Media.html" title='Read what others have written about XOWA'>Media</a></li>
<li><a href="http://xowa.org/wiki/home/page/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/wiki/home/page/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>

391
Dev/Design/Database.html Normal file
View File

@@ -0,0 +1,391 @@
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Dev/Design/Database - XOWA</title>
<link rel="shortcut icon" href="http://xowa.org/xowa_logo.png" />
<link rel="stylesheet" href="http://xowa.org/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/Design/Database</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">
<div id="toc" class="toc">
<div id="toctitle">
<h2>
Contents
</h2>
</div>
<ul>
<li class="toclevel-1 tocsection-1">
<a href="#Overview"><span class="tocnumber">1</span> <span class="toctext">Overview</span></a>
</li>
<li class="toclevel-1 tocsection-2">
<a href="#Details"><span class="tocnumber">2</span> <span class="toctext">Details</span></a>
</li>
<li class="toclevel-1 tocsection-3">
<a href="#Options"><span class="tocnumber">3</span> <span class="toctext">Options</span></a>
</li>
<li class="toclevel-1 tocsection-4">
<a href="#Multi-file_layout"><span class="tocnumber">4</span> <span class="toctext">Multi-file layout</span></a>
</li>
<li class="toclevel-1 tocsection-5">
<a href="#Version_compatibility"><span class="tocnumber">5</span> <span class="toctext">Version compatibility</span></a>
</li>
</ul>
</div>
<h2>
<span class="mw-headline" id="Overview">Overview</span>
</h2>
<p>
As of v2.4.1.1, XOWA has changed the database layout to be more simple and portable. Regular users should not notice any difference. Users who move XOWA wikis between computer systems will notice some benefits.
</p>
<h2>
<span class="mw-headline" id="Details">Details</span>
</h2>
<ul>
<li>
<b>.xowa</b>: XOWA databases now have the extension <code>.xowa</code> instead of <code>.sqlite3</code>.
<ul>
<li>
For example, importing Simple Wikipedia now generates a file called <code>simple.wikipedia.org-text.xowa</code> instead of <code>simple.wikipedia.org.000.sqlite3</code>
</li>
<li>
Note that the underlying file is still a sqlite3 database. The extension has just been renamed from <code>.sqlite3</code> to <code>.xowa</code>.
</li>
<li>
Note that all new wikis uploaded to archive.org will be in .xowa format. The same also goes for new torrents.
</li>
</ul>
</li>
<li>
<b>Backward compatible</b>: XOWA v2.4.1.1 and higher opens both <code>.xowa</code> wikis and <code>.sqlite3</code> wikis. There is no need to upgrade to the new wikis unless you're planning on using some of the features below. However, users are encouraged to generate new wikis with the new format.
</li>
<li>
<b>One file for most wikis</b>: Small wikis will default to one file instead of several.
<ul>
<li>
For example, importing simple.wikipedia.org will generate 1 file called <code>simple.wikipedia.org-text.xowa</code>. In contrast, it used to generate 5 files: <code>simple.wikipedia.org.000.sqlite3</code> up to <code>simple.wikipedia.org.004.sqlite3</code>
</li>
</ul>
</li>
<li>
<b>Multiple 'detachable' files for large wikis</b>: Larger wikis will still generate multiple files. See the Multi-file layout section below for more detail.
</li>
<li>
<b>Databases in same directory</b>: All database files are now under <code>/xowa/wiki/wiki_name</code>. File databases no longer have to go to <code>/xowa/file/wiki_name</code>. The latter was a point of confusion for new users, as well as an inconvenience when trying to move wikis to new machines.
</li>
</ul>
<h2>
<span class="mw-headline" id="Options">Options</span>
</h2>
<p>
General behavior for "single" vs "multiple" file import can be customized at <a href="http://xowa.org/wiki/home/page/Options/Import.html" id="xolnki_2" title="Options/Import" class="xowa-visited">Options/Import</a> under Database Layout
</p>
<h2>
<span class="mw-headline" id="Multi-file_layout">Multi-file layout</span>
</h2>
<p>
Large wikis will still generate multiple files. This includes English Wikipedia, German Wikipedia as well as about a dozen others. The primary reasons are as follows:
</p>
<ul>
<li>
<b>FAT32 4 GB limit</b>: FAT32 supports a maximum file size of 4 GB. Although modern operating can support files greater than 4 GB, most flash cards still use a FAT32 file-system. In addition, large files are not supported in other formats (for example, DVDs, archive.org with a 10 GB limit, etc.)
</li>
<li>
<b>Detachable databases</b>: Wikis will still work even if individual databases are deleted or removed. For example, if you don't plan to read the articles in the Wikipedia namespace and want to save 2.6 GB of disk space then you can simply remove the file called "en.wikipedia.org-text-ns.004.xowa".
</li>
</ul>
<p>
Note that detached databases can be reattached simply by moving the file back into its proper location. For example, consider the following:
</p>
<ul>
<li>
<span class='path'>C:\xowa\wiki\en.wikipedia.org\en.wikipedia.org-xtn.category.core.xowa</span> is deleted.
<ul>
<li>
Categories will no longer show, but the wiki functions as normal
</li>
</ul>
</li>
<li>
<span class='path'>C:\xowa\wiki\en.wikipedia.org\en.wikipedia.org-xtn.category.core.xowa</span> is restored.
<ul>
<li>
Categories will now work again.
</li>
</ul>
</li>
</ul>
<p>
The following table provides more information on what happens when a database is detached:
</p>
<table class='wikitable'>
<tr>
<th>
file-name suffix
</th>
<th>
example
</th>
<th>
effect if removed
</th>
</tr>
<tr>
<td>
core
</td>
<td>
en.wikipedia.org-core.xowa
</td>
<td>
Core file: wiki will not work
</td>
</tr>
<tr>
<td>
text-ns.***-db.***
</td>
<td>
en.wikipedia.org-text-ns.012.xowa
</td>
<td>
Articles in the namespace will not be available. See <a href="http://en.wikipedia.org/wiki/Wikipedia:Namespace" rel="nofollow" class="external free">http://en.wikipedia.org/wiki/Wikipedia:Namespace</a> For example, ns.012 is for "Help:" articles
</td>
</tr>
<tr>
<td>
xtn.category
</td>
<td>
en.wikipedia.org-xtn.category.xowa
</td>
<td>
Categories will not show up at the bottom of the article
</td>
</tr>
<tr>
<td>
xtn.index
</td>
<td>
en.wikipedia.org-xtn.index.xowa
</td>
<td>
"Special:Search" will not work; EX: en.wikipedia.org/wiki/Special:Search/Earth?search=Earth&amp;fulltext=y
</td>
</tr>
<tr>
<td>
wbase
</td>
<td>
www.wikidata.org-wbase.xowa
</td>
<td>
Core file: Wikidata will not work.
</td>
</tr>
<tr>
<td>
file-core
</td>
<td>
en.wikipedia.org-file-core.xowa
</td>
<td>
Wiki will not show images
</td>
</tr>
<tr>
<td>
file-data
</td>
<td>
en.wikipedia.org-file-data.001.xowa
</td>
<td>
Images in that database will not show
</td>
</tr>
</table>
<h2>
<span class="mw-headline" id="Version_compatibility">Version compatibility</span>
</h2>
<p>
The formats for wiks and files are interchangable between old and new formats. A user may keep their existing <b>old</b> file databases and still generate <b>new</b> wikis whenever they want to.
</p>
<p>
For example, consider English Wikipedia. All of the following combinations of <b>old</b> and <b>new</b> should work:
</p>
<table class="wikitable">
<tr>
<th>
wiki type
</th>
<th>
file type
</th>
<th>
wiki path example
</th>
<th>
file path example
</th>
</tr>
<tr>
<td>
old
</td>
<td>
old
</td>
<td>
<span class='path'>C:\xowa\wiki\en.wikipedia.org\en.wikipedia.org.000.sqlite3</span>
</td>
<td>
<span class='path'>C:\xowa\file\en.wikipedia.org\fsdb.main\fsdb.abc.sqlite3</span>
</td>
</tr>
<tr>
<td>
new
</td>
<td>
old
</td>
<td>
<span class='path'>C:\xowa\wiki\en.wikipedia.org\en.wikipedia.org-core.xowa</span>
</td>
<td>
<span class='path'>C:\xowa\file\en.wikipedia.org\fsdb.main\fsdb.abc.sqlite3</span>
</td>
</tr>
<tr>
<td>
old
</td>
<td>
new
</td>
<td>
<span class='path'>C:\xowa\wiki\en.wikipedia.org\en.wikipedia.org.000.sqlite3</span>
</td>
<td>
<span class='path'>C:\xowa\wiki\en.wikipedia.org\en.wikipedia.org-file-core.xowa</span>
</td>
</tr>
<tr>
<td>
new
</td>
<td>
new
</td>
<td>
<span class='path'>C:\xowa\wiki\en.wikipedia.org\en.wikipedia.org-core.xowa</span>
</td>
<td>
<span class='path'>C:\xowa\wiki\en.wikipedia.org\en.wikipedia.org-file-core.xowa</span>
</td>
</tr>
</table>
</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(http://xowa.org/xowa_logo.png);" href="index.html" 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/wiki/home/page/Help/Download_XOWA.html" title='Download the XOWA application'>Download XOWA</a></li>
<li><a href="http://xowa.org/wiki/home/page/Dashboard/Image_databases.html" title='Download offline wikis and image databases'>Download wikis</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-stargin'>
<h3>Getting started</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/System_requirements.html" title='Get XOWA&apos;s system requirements'>Requirements</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/Installation.html" title='Get instructions for installing XOWA'>Installation</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/Simple_Wikipedia.html" title='Learn how to set up Simple Wikipedia'>Simple Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/English_Wikipedia.html" title='Learn how to set up English Wikipedia'>English Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/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-help'>
<h3>Help</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/Help/About.html" title='Get more information about XOWA'>About</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Contents.html" title='View a list of help topics'>Contents</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Media.html" title='Read what others have written about XOWA'>Media</a></li>
<li><a href="http://xowa.org/wiki/home/page/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/wiki/home/page/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>

334
Dev/Design/Files/Wikia.html Normal file
View File

@@ -0,0 +1,334 @@
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Dev/Design/Files/Wikia - XOWA</title>
<link rel="shortcut icon" href="http://xowa.org/xowa_logo.png" />
<link rel="stylesheet" href="http://xowa.org/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/Design/Files/Wikia</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">
<div id="toc" class="toc">
<div id="toctitle">
<h2>
Contents
</h2>
</div>
<ul>
<li class="toclevel-1 tocsection-1">
<a href="#Overview"><span class="tocnumber">1</span> <span class="toctext">Overview</span></a>
</li>
<li class="toclevel-1 tocsection-2">
<a href="#Background"><span class="tocnumber">2</span> <span class="toctext">Background</span></a>
</li>
<li class="toclevel-1 tocsection-3">
<a href="#Instructions"><span class="tocnumber">3</span> <span class="toctext">Instructions</span></a>
</li>
<li class="toclevel-1 tocsection-4">
<a href="#Image_Magic_and_Inkscape"><span class="tocnumber">4</span> <span class="toctext">Image Magic and Inkscape</span></a>
</li>
<li class="toclevel-1 tocsection-5">
<a href="#.5Eorig_regy.sqlite3"><span class="tocnumber">5</span> <span class="toctext">^orig_regy.sqlite3</span></a>
</li>
<li class="toclevel-1 tocsection-6">
<a href="#Urls"><span class="tocnumber">6</span> <span class="toctext">Urls</span></a>
</li>
<li class="toclevel-1 tocsection-7">
<a href="#Orig_directory"><span class="tocnumber">7</span> <span class="toctext">Orig directory</span></a>
</li>
<li class="toclevel-1 tocsection-8">
<a href="#Thumb_directory"><span class="tocnumber">8</span> <span class="toctext">Thumb directory</span></a>
</li>
</ul>
</div>
<h2>
<span class="mw-headline" id="Overview">Overview</span>
</h2>
<p>
Some wikis are not Wikimedia Foundation wikis, and may not have their images / files arranged in a WMF filesystem layout
</p>
<p>
XOWA supports using files from a single directory.
</p>
<p>
<br>
</p>
<h2>
<span class="mw-headline" id="Background">Background</span>
</h2>
<p>
Wikimedia Foundation wikis place their images in a precisely defined filesystem layout.
</p>
<p>
For example, a file in a WMF tarball may have the following path /wmf_tarball/wikipedia/commons/7/70/A.png
</p>
<p>
Note that this path embeds the MD5 hash of the title in the path. In this case "70" are the first two characters of the MD5 hash for "A.png" which is "701ccaf6ec1641a9ff778fd0b862e5a2"
</p>
<p>
Because an MD5 hash is a non-trivial function, non-WMF wikis may find it difficult to arrange their files in the same filesystem layout.
</p>
<p>
XOWA allows these wikis to use an alternate method, where the files need only be placed inside a single directory.
</p>
<p>
<br>
</p>
<h2>
<span class="mw-headline" id="Instructions">Instructions</span>
</h2>
<ul>
<li>
Go to home/wiki/Help:Options/Config script
</li>
<li>
Enter in the following:
</li>
</ul>
<pre>
app.wikis.get('my_wiki').files.wkrs.get('fs.dir') {
orig_dir = '~{&lt;&gt;xowa_root_dir&lt;&gt;}wiki/my_wiki/orig/';
thumb_dir = '~{&lt;&gt;xowa_root_dir&lt;&gt;}wiki/my_wiki/thumb/';
}
</pre>
<ul>
<li>
Place a file called "A.png" in "~{&lt;&gt;xowa_root_dir&lt;&gt;}wiki/my_wiki/orig/". For example, if XOWA is setup on a Windows machine at C:\xowa\ and your wiki is my_wiki, then your file should be at C:\xowa\wiki\my_wiki\orig\A.png.
</li>
<li>
Restart XOWA
</li>
<li>
Go to any page in my_wiki
</li>
<li>
Enter in [[File:A.png]]
</li>
<li>
Preview the page. The file should show
</li>
<li>
Enter in [[File:A.png|200px]]
</li>
<li>
Preview the page. The thumb should show
</li>
</ul>
<p>
<br>
</p>
<h2>
<span class="mw-headline" id="Image_Magic_and_Inkscape">Image Magic and Inkscape</span>
</h2>
<ul>
<li>
You must have ImageMagick and Inkscape installed on your machine. They are needed because:
<ul>
<li>
MediaWiki has a lot of logic that depends on the image's size. ImageMagick is used to get the size.
</li>
<li>
Thumbs are resized from the original. ImageMagick and Inkscape does the resizing.
</li>
</ul>
</li>
</ul>
<p>
<br>
</p>
<h2>
<span class="mw-headline" id=".5Eorig_regy.sqlite3">^orig_regy.sqlite3</span>
</h2>
<ul>
<li>
A file called "^orig_regy.sqlite3" will be in the orig directory.
<ul>
<li>
This db caches the sizes of the original files (so ImageMagick doesn't need to be continually run).
</li>
<li>
Note that if this file is deleted, it will be automatically regenerated
</li>
</ul>
</li>
</ul>
<p>
<br>
</p>
<h2>
<span class="mw-headline" id="Urls">Urls</span>
</h2>
<ul>
<li>
XOWA takes the following type of urls
<ul>
<li>
Absolute urls: C:\xowa\wiki\my_wiki\images\
</li>
<li>
XOWA relative urls: ~{&lt;&gt;xowa_root_dir&lt;&gt;}wiki/my_wiki/images/
<ul>
<li>
Note that relative urls can use the "\" instead of the "/". However, it is recommended to use "/" for sharing across different machines (for example, the same USB drive can be used on both a Windows or Linux machine if a "/" path is used)
</li>
</ul>
</li>
</ul>
</li>
<li>
File names need to comply with valid MediaWiki titles. For example, certain characters are invalid, such as [].
</li>
</ul>
<p>
<br>
</p>
<h2>
<span class="mw-headline" id="Orig_directory">Orig directory</span>
</h2>
<ul>
<li>
All original files should go into the orig directory
</li>
<li>
The orig directory can be nested.
<ul>
<li>
For example, /xowa/wiki/my_wiki/orig/ can have a subfile in /xowa/wiki/my_wiki/orig/level_0/level_00/A.png.
</li>
<li>
[[File:A.png]] will pick up this file
</li>
<li>
Note that file names should be unique with a given folder. If there are two files called A.png in two different subfolders, then XOWA will only use one, and ignore the other.
</li>
</ul>
</li>
</ul>
<p>
<br>
</p>
<h2>
<span class="mw-headline" id="Thumb_directory">Thumb directory</span>
</h2>
<ul>
<li>
All thumbs will go into the thumb directory
</li>
<li>
Thumbs can be deleted, and they will be recreated.
</li>
<li>
For nested files, thumbs will be created in a parallel directory
<ul>
<li>
For example, the original file is in /xowa/wiki/my_wiki/orig/level_0/level_00/A.png.
</li>
<li>
The thumb file will be created in /xowa/wiki/my_wiki/thumb/level_0/level_00/A.png/30px.png
</li>
</ul>
</li>
</ul>
<p>
<br>
</p>
</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(http://xowa.org/xowa_logo.png);" href="index.html" 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/wiki/home/page/Help/Download_XOWA.html" title='Download the XOWA application'>Download XOWA</a></li>
<li><a href="http://xowa.org/wiki/home/page/Dashboard/Image_databases.html" title='Download offline wikis and image databases'>Download wikis</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-stargin'>
<h3>Getting started</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/System_requirements.html" title='Get XOWA&apos;s system requirements'>Requirements</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/Installation.html" title='Get instructions for installing XOWA'>Installation</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/Simple_Wikipedia.html" title='Learn how to set up Simple Wikipedia'>Simple Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/English_Wikipedia.html" title='Learn how to set up English Wikipedia'>English Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/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-help'>
<h3>Help</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/Help/About.html" title='Get more information about XOWA'>About</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Contents.html" title='View a list of help topics'>Contents</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Media.html" title='Read what others have written about XOWA'>Media</a></li>
<li><a href="http://xowa.org/wiki/home/page/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/wiki/home/page/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,116 @@
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Dev/Design/Language files - XOWA</title>
<link rel="shortcut icon" href="http://xowa.org/xowa_logo.png" />
<link rel="stylesheet" href="http://xowa.org/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/Design/Language 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">
<p>
Non-English wikis use specific language keywords and messages. For example, French Wikipedia uses the word "REDIRECTION" instead of "REDIRECT" for redirect pages.
</p>
<p>
XOWA distributes all language files in the xowa_app_*.zip package. They can be found at /xowa/user/anonymous/lang/xowa/ under the appropriate language code. For example, the language definition for English is in en.gfs, French is fr.gfs, German is de.gfs, etc..
</p>
</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(http://xowa.org/xowa_logo.png);" href="index.html" 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/wiki/home/page/Help/Download_XOWA.html" title='Download the XOWA application'>Download XOWA</a></li>
<li><a href="http://xowa.org/wiki/home/page/Dashboard/Image_databases.html" title='Download offline wikis and image databases'>Download wikis</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-stargin'>
<h3>Getting started</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/System_requirements.html" title='Get XOWA&apos;s system requirements'>Requirements</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/Installation.html" title='Get instructions for installing XOWA'>Installation</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/Simple_Wikipedia.html" title='Learn how to set up Simple Wikipedia'>Simple Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/English_Wikipedia.html" title='Learn how to set up English Wikipedia'>English Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/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-help'>
<h3>Help</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/Help/About.html" title='Get more information about XOWA'>About</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Contents.html" title='View a list of help topics'>Contents</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Media.html" title='Read what others have written about XOWA'>Media</a></li>
<li><a href="http://xowa.org/wiki/home/page/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/wiki/home/page/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,182 @@
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Dev/Design/Offline files - XOWA</title>
<link rel="shortcut icon" href="http://xowa.org/xowa_logo.png" />
<link rel="stylesheet" href="http://xowa.org/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/Design/Offline 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">
<table class="metadata plainlinks ambox ambox-delete" style="">
<tr>
<td class="mbox-empty-cell">
</td>
<td class="mbox-text" style="">
<p>
<span class="mbox-text-span">This process is currently in development. The documentation below is provided for reference only. You can run the commands, but please note that the end result will not have any immediate use.</span>
</p>
</td>
</tr>
</table>
<p>
Offline thumbnails will require a lot of time and disk storage. Estimates are provided below in the format of <code>[Space used; Time taken]</code>.
</p>
<p>
Note that Simple Wikipedia will take 24+ hours and 120 GB for the first run.
</p>
<h2>
<span class="mw-headline" id="Commons_process">Commons process</span>
</h2>
<p>
Since most images reside in the commons wiki, commons must be set up. Note that this only needs to be done once for all wikis.
</p>
<ul>
<li>
<code>[ 50 GB; 03 h]</code> Import the Commons wiki with category level 2. See <a href="http://xowa.org/wiki/home/page/Dashboard/Import/Offline.html" id="xolnki_2" title="Dashboard/Import/Offline" class="xowa-visited">Dashboard/Import/Offline</a>
</li>
<li>
<code>[ 50 GB; 02 h]</code> Download and unzip commonswiki-latest-image.sql.gz
</li>
<li>
<code>[ 01 GB; 20 m]</code> Run the images command. This will generate a database called oimg_image which will have more data for each file (width, height)
</li>
<li>
<code>[ 15 MB; 40 m]</code> Run the redirect command. This will generate a database called oimg_redirect which will list all redirect targets
</li>
</ul>
<h2>
<span class="mw-headline" id="Wiki_process">Wiki process</span>
</h2>
<p>
These steps must be run for the given wiki. Estimated size / times are provided for Simple Wikipedia.
</p>
<ul>
<li>
<code>[ 01 MB; 01 m]</code> Run the images command.
</li>
<li>
<code>[ 05 MB; 01 m]</code> Run the redirect command.
</li>
<li>
<code>[ 25 MB; 15 m]</code> Run the lnki_temp command. This will generate a database called oimg_lnki which will be the main database. It also creates a table called oimg_lnki_temp which lists every [[File:]] reference
</li>
<li>
<code>[ 20 MB; 05 m]</code> Run the file_regy command. This will create a table called oimg_lnki_regy which aggregates all info in oimg_lnki_temp. It also creates a table called oimg_file_regy which uses the data generated in the images and redirect commands.
</li>
<li>
<code>[ 05 MB; 01 m]</code> Run the xfer_regy command. This will create a table called oimg_xfer_regy which generates a unique list of all thumbnails to download
</li>
</ul>
<pre>
app.bldr.cmds {
add ('commons.wikimedia.org', 'oimg.image');
add ('commons.wikimedia.org', 'oimg.redirect') {commit_interval = 10000; progress_interval = 100; cleanup_interval = 100;}
add ('simple.wikipedia.org' , 'oimg.image');
add ('simple.wikipedia.org' , 'oimg.redirect') {commit_interval = 10000; progress_interval = 100; cleanup_interval = 100;}
add ('simple.wikipedia.org' , 'oimg.lnki_temp') {commit_interval = 10000; progress_interval = 100; cleanup_interval = 100;}
add ('simple.wikipedia.org' , 'oimg.file_regy');
add ('simple.wikipedia.org' , 'oimg.xfer_regy');
}
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(http://xowa.org/xowa_logo.png);" href="index.html" 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/wiki/home/page/Help/Download_XOWA.html" title='Download the XOWA application'>Download XOWA</a></li>
<li><a href="http://xowa.org/wiki/home/page/Dashboard/Image_databases.html" title='Download offline wikis and image databases'>Download wikis</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-stargin'>
<h3>Getting started</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/System_requirements.html" title='Get XOWA&apos;s system requirements'>Requirements</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/Installation.html" title='Get instructions for installing XOWA'>Installation</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/Simple_Wikipedia.html" title='Learn how to set up Simple Wikipedia'>Simple Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/English_Wikipedia.html" title='Learn how to set up English Wikipedia'>English Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/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-help'>
<h3>Help</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/Help/About.html" title='Get more information about XOWA'>About</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Contents.html" title='View a list of help topics'>Contents</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Media.html" title='Read what others have written about XOWA'>Media</a></li>
<li><a href="http://xowa.org/wiki/home/page/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/wiki/home/page/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>

164
Dev/Design/Site_config.html Normal file
View File

@@ -0,0 +1,164 @@
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Dev/Design/Site config - XOWA</title>
<link rel="shortcut icon" href="http://xowa.org/xowa_logo.png" />
<link rel="stylesheet" href="http://xowa.org/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/Design/Site config</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="Sample_files">Sample files</span>
</h2>
<p>
In /xowa/bin/any/xowa/cfg/wiki/api/, each folder has a sample file that can be used for a wiki. To use it do the following:
</p>
<ul>
<li>
Copy the "-sample.csv" file
</li>
<li>
Replace the "-sample" to the name of the wiki. For example, for nethackwiki.com, rename the file to "extensiontags-nethackwiki.com.csv". For English Wikipedia, use "extensiontags-en.wikipedia.org.csv"
</li>
<li>
Import the wiki. XOWA will use the data in the file when creating the wiki
</li>
</ul>
<p>
This data gets stored in the main ".xowa" database in the xowa_cfg table. For example, run the following SQL: SELECT * FROM xowa_cfg WHERE cfg_key = 'extensiontags';
</p>
<p>
The remainder of this article documents the purpose of each file.
</p>
<h2>
<span class="mw-headline" id="extensiontags">extensiontags</span>
</h2>
<p>
The "extensiontags" file lists active extensions. For example, to enable only &lt;ref&gt; and &lt;references&gt;, use the following two lines:
</p>
<pre>
ref
references
</pre>
<p>
All other extension tags will be disabled. For example, &lt;math&gt; will show up as just &lt;math&gt; LaTeX source instead of being replaced with graphical equations
</p>
<p>
The main purpose of this functionality is to disable extensions in some wikis. For example, the &lt;do&gt; extension is only active in the Wikivoyage wiki. Otherwise, English Wikipedia has an article called <a href="https://en.wikipedia.org/wiki/Type_system" rel="nofollow" class="external text">Type system</a> which will render incorrectly with the following fragment:
</p>
<pre>
&lt;code&gt;if &lt;complex test&gt; then &lt;do something&gt; else &lt;generate type error&gt;&lt;/code&gt;
</pre>
<h2>
<span class="mw-headline" id="interwikimap">interwikimap</span>
</h2>
<p>
The "interwikimap" file lists active interwiki prefixes. For example, to enable only the interwiki prefix for commons, use the following:
</p>
<pre>
commons|https://commons.wikimedia.org/wiki/~{0}
</pre>
<p>
This will convert [[commons:Earth]] to a link to <a href="https://commons.wikipedia.org/wiki/Earth" rel="nofollow" class="external free">https://commons.wikipedia.org/wiki/Earth</a>
</p>
</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(http://xowa.org/xowa_logo.png);" href="index.html" 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/wiki/home/page/Help/Download_XOWA.html" title='Download the XOWA application'>Download XOWA</a></li>
<li><a href="http://xowa.org/wiki/home/page/Dashboard/Image_databases.html" title='Download offline wikis and image databases'>Download wikis</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-stargin'>
<h3>Getting started</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/System_requirements.html" title='Get XOWA&apos;s system requirements'>Requirements</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/Installation.html" title='Get instructions for installing XOWA'>Installation</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/Simple_Wikipedia.html" title='Learn how to set up Simple Wikipedia'>Simple Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/English_Wikipedia.html" title='Learn how to set up English Wikipedia'>English Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/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-help'>
<h3>Help</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/Help/About.html" title='Get more information about XOWA'>About</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Contents.html" title='View a list of help topics'>Contents</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Media.html" title='Read what others have written about XOWA'>Media</a></li>
<li><a href="http://xowa.org/wiki/home/page/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/wiki/home/page/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,259 @@
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Dev/Design/Sqlite/File-sizes - XOWA</title>
<link rel="shortcut icon" href="http://xowa.org/xowa_logo.png" />
<link rel="stylesheet" href="http://xowa.org/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/Design/Sqlite/File-sizes</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>
The XOWA sqlite import currently defaults to a multi-file format. This format is chosen for two reasons:
</p>
<ul>
<li>
<b>Large wikis and FAT32</b>:
<ul>
<li>
Most flash memory cards use a <a href="http://en.wikipedia.org/wiki/FAT32" rel="nofollow" class="external text">FAT32</a> file-system. FAT32 is particulary convenient when exchanging files between Windows, Linux, Mac OS X and Android.
</li>
<li>
FAT32 has a limit of 4GB for any one file. A large wiki like en.wikipedia.org will easily take 20 GB.
</li>
<li>
Multiple files allow the 20 GB data to be broken into smaller pieces: each less than 4 GB
</li>
</ul>
</li>
</ul>
<ul>
<li>
<b>Slight performance gains</b>
</li>
</ul>
<dl>
<dd>
A smaller database file may be easier to query than a large one because all the pages will be grouped closer together on disk
</dd>
<dd>
For example, consider a wiki page that requires 50 template pages.
<dl>
<dd>
With a single-file format, these 50 pages may be scattered anywhere over the 20 GB file.
</dd>
<dd>
With a multi-file format, these 50 pages may be scattered anywhere over a smaller 280 MB file. A disk drive will have to seek over a smaller section of disk. For a smaller wiki, the entire template file may be stored in the hard disk cache.
</dd>
</dl>
</dd>
</dl>
<p>
The file format is controlled by other arguments
</p>
<div id="toc" class="toc">
<div id="toctitle">
<h2>
Contents
</h2>
</div>
<ul>
<li class="toclevel-1 tocsection-1">
<a href="#ns_file_map"><span class="tocnumber">1</span> <span class="toctext">ns_file_map</span></a>
</li>
<li class="toclevel-1 tocsection-2">
<a href="#db_text_max_value"><span class="tocnumber">2</span> <span class="toctext">db_text_max value</span></a>
</li>
<li class="toclevel-1 tocsection-3">
<a href="#db_categorylink_max_and_db_wikidata_max_value"><span class="tocnumber">3</span> <span class="toctext">db_categorylink_max and db_wikidata_max value</span></a>
</li>
<li class="toclevel-1 tocsection-4">
<a href="#db_wikidata_max_value"><span class="tocnumber">4</span> <span class="toctext">db_wikidata_max value</span></a>
</li>
</ul>
</div>
<h2>
<span class="mw-headline" id="ns_file_map">ns_file_map</span>
</h2>
<p>
The ns_file_map argument is a new-line/semi-colon delimited string. The default value is the following:
</p>
<pre>
Template;Module
</pre>
<p>
Note that each line has a list of namespace names. Multiple namespaces can be delimited with the ";". The namespace name must be the "canonical" English name.
</p>
<p>
Note that an empty string will default everything to be stored in the core database. If a single file database is desired, specify "".
</p>
<h2>
<span class="mw-headline" id="db_text_max_value">db_text_max value</span>
</h2>
<p>
This is a number that represents the maximum number of MB of text data that can be stored in the file. Note the following
</p>
<ul>
<li>
Once a file reaches that number, it will spill over into a new file.
</li>
</ul>
<dl>
<dd>
For example, file 002 is the text database. After 3,000 MB of text data is stored in file 002, the next 3,000 MB of text data will be stored in file 003.
</dd>
</dl>
<ul>
<li>
The number is a rough approximation of total database size. A precise value cannot be used b/c of the following non-deterministic variables:
<ul>
<li>
Sqlite database page size (data / indexes will not fill up an entire page)
</li>
<li>
Sqlite table / database overhead
</li>
</ul>
</li>
</ul>
<dl>
<dd>
As such, please use a number which is 80% of the desired size. For example, if you want a database no greater than 4,000 MB (4.0 GB), use 3,000
</dd>
</dl>
<h2>
<span class="mw-headline" id="db_categorylink_max_and_db_wikidata_max_value">db_categorylink_max and db_wikidata_max value</span>
</h2>
<p>
This is a number that represents the maximum number of MB of categorylink data that can be stored in the file. Note the following:
</p>
<ul>
<li>
This number functions similarly to the db_text_max value above. (Once the max is reached, new data will spill over into a new file)
</li>
<li>
However, it is more precise than db_text_max. The number specified is 90% of the actual value (presumably due to less page fragmentation)
</li>
</ul>
<h2>
<span class="mw-headline" id="db_wikidata_max_value">db_wikidata_max value</span>
</h2>
<p>
This is a number that represents the maximum number of MB of wikidata label data that can be stored in the file. Note the following:
</p>
<ul>
<li>
This number only affects www.wikidata.org wikis
</li>
<li>
This number only recognizes 0 and not 0.
<ul>
<li>
To put all wikidata data in one database, use 0
</li>
<li>
To put all wikidata data in another database, use any number &gt; 0
</li>
</ul>
</li>
</ul>
</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(http://xowa.org/xowa_logo.png);" href="index.html" 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/wiki/home/page/Help/Download_XOWA.html" title='Download the XOWA application'>Download XOWA</a></li>
<li><a href="http://xowa.org/wiki/home/page/Dashboard/Image_databases.html" title='Download offline wikis and image databases'>Download wikis</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-stargin'>
<h3>Getting started</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/System_requirements.html" title='Get XOWA&apos;s system requirements'>Requirements</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/Installation.html" title='Get instructions for installing XOWA'>Installation</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/Simple_Wikipedia.html" title='Learn how to set up Simple Wikipedia'>Simple Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/English_Wikipedia.html" title='Learn how to set up English Wikipedia'>English Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/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-help'>
<h3>Help</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/Help/About.html" title='Get more information about XOWA'>About</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Contents.html" title='View a list of help topics'>Contents</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Media.html" title='Read what others have written about XOWA'>Media</a></li>
<li><a href="http://xowa.org/wiki/home/page/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/wiki/home/page/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,140 @@
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Dev/Environment/Text editor - XOWA</title>
<link rel="shortcut icon" href="http://xowa.org/xowa_logo.png" />
<link rel="stylesheet" href="http://xowa.org/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/Environment/Text editor</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 files are standard text files. They can be opened up in any text editor that supports the following:
</p>
<ul>
<li>
Unix-style line-endings (ASCII 10)
</li>
<li>
UTF-8 encoded with no Byte-Order-Mark
</li>
</ul>
<p>
The following is a list of recommended text editors based on operating system:
</p>
<ul>
<li>
Windows: Notepad++: <a href="http://notepad-plus-plus.org/" rel="nofollow" class="external free">http://notepad-plus-plus.org/</a>
<ul>
<li>
Do not use plain Notepad. It uses Windows-style line-endings and does not support UTF-8.
</li>
</ul>
</li>
<li>
Mac OS X: TextEdit
</li>
<li>
Linux: gedit or kate
</li>
</ul>
</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(http://xowa.org/xowa_logo.png);" href="index.html" 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/wiki/home/page/Help/Download_XOWA.html" title='Download the XOWA application'>Download XOWA</a></li>
<li><a href="http://xowa.org/wiki/home/page/Dashboard/Image_databases.html" title='Download offline wikis and image databases'>Download wikis</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-stargin'>
<h3>Getting started</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/System_requirements.html" title='Get XOWA&apos;s system requirements'>Requirements</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/Installation.html" title='Get instructions for installing XOWA'>Installation</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/Simple_Wikipedia.html" title='Learn how to set up Simple Wikipedia'>Simple Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/English_Wikipedia.html" title='Learn how to set up English Wikipedia'>English Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/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-help'>
<h3>Help</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/Help/About.html" title='Get more information about XOWA'>About</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Contents.html" title='View a list of help topics'>Contents</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Media.html" title='Read what others have written about XOWA'>Media</a></li>
<li><a href="http://xowa.org/wiki/home/page/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/wiki/home/page/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,225 @@
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Dev/Environment/Viewer apps - XOWA</title>
<link rel="shortcut icon" href="http://xowa.org/xowa_logo.png" />
<link rel="stylesheet" href="http://xowa.org/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/Environment/Viewer apps</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>
Certain files are best displayed in dedicated third party applications. For example, a video file cannot be played natively in a HTML browser, but can be played in a media player.
</p>
<div id="toc" class="toc">
<div id="toctitle">
<h2>
Contents
</h2>
</div>
<ul>
<li class="toclevel-1 tocsection-1">
<a href="#Using_viewer_applications"><span class="tocnumber">1</span> <span class="toctext">Using viewer applications</span></a>
</li>
<li class="toclevel-1 tocsection-2">
<a href="#Assigning_viewer_applications"><span class="tocnumber">2</span> <span class="toctext">Assigning viewer applications</span></a>
</li>
<li class="toclevel-1 tocsection-3">
<a href="#External_links"><span class="tocnumber">3</span> <span class="toctext">External links</span></a>
</li>
<li class="toclevel-1 tocsection-4">
<a href="#Recommended_applications"><span class="tocnumber">4</span> <span class="toctext">Recommended applications</span></a>
</li>
</ul>
</div>
<h2>
<span class="mw-headline" id="Using_viewer_applications">Using viewer applications</span>
</h2>
<p>
Viewer applications are generally activated in one of the following two situations:
</p>
<ul>
<li>
For audio/video files
</li>
</ul>
<dl>
<dd>
Click the play button in the article. This will launch the audio/video file in its viewer application
</dd>
</dl>
<ul>
<li>
For image files
</li>
</ul>
<dl>
<dd>
Click the thumbnail in the article. This will navigate you to its <i>File</i> page.
</dd>
<dd>
Click the main image. This will launch the image file in its viewer application.
</dd>
</dl>
<h2>
<span class="mw-headline" id="Assigning_viewer_applications">Assigning viewer applications</span>
</h2>
<p>
XOWA assigns a file-type to its default viewer-application.
</p>
<p>
The applications use defaults defined in the <a href="http://xowa.org/wiki/home/page/Dev/Config_files_files.html" id="xolnki_2" title="Dev/Config files files">config file</a>:
</p>
<p>
If you wish to change the viewer application, you can do so in <a href="http://xowa.org/wiki/home/page/Options/Apps.html" id="xolnki_3" title="Options/Apps">Options/Apps</a>
</p>
<h2>
<span class="mw-headline" id="External_links">External links</span>
</h2>
<p>
Many articles will have external links. By default, clicking on these links will not result in any action. If you want the external links to open in a web browser, you will need to enable the web viewer application
</p>
<p>
If you wish to change the web browser, you can also do so in <a href="http://xowa.org/wiki/home/page/Options/Apps.html" id="xolnki_4" title="Options/Apps">Options/Apps</a>
</p>
<h2>
<span class="mw-headline" id="Recommended_applications">Recommended applications</span>
</h2>
<p>
This is a list of recommended open-source applications for each viewer type.
</p>
<dl>
<dt>
Internet
</dt>
<dd>
Firefox
</dd>
<dt>
Images
</dt>
<dd>
GIMP
</dd>
<dt>
Video/Audio
</dt>
<dd>
VLC
</dd>
<dt>
DjVu
</dt>
<dd>
DjVuLibre
</dd>
<dt>
PDF
</dt>
<dd>
Sumatra (Windows)
</dd>
<dd>
Evince
</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(http://xowa.org/xowa_logo.png);" href="index.html" 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/wiki/home/page/Help/Download_XOWA.html" title='Download the XOWA application'>Download XOWA</a></li>
<li><a href="http://xowa.org/wiki/home/page/Dashboard/Image_databases.html" title='Download offline wikis and image databases'>Download wikis</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-stargin'>
<h3>Getting started</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/System_requirements.html" title='Get XOWA&apos;s system requirements'>Requirements</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/Installation.html" title='Get instructions for installing XOWA'>Installation</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/Simple_Wikipedia.html" title='Learn how to set up Simple Wikipedia'>Simple Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/English_Wikipedia.html" title='Learn how to set up English Wikipedia'>English Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/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-help'>
<h3>Help</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/Help/About.html" title='Get more information about XOWA'>About</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Contents.html" title='View a list of help topics'>Contents</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Media.html" title='Read what others have written about XOWA'>Media</a></li>
<li><a href="http://xowa.org/wiki/home/page/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/wiki/home/page/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>

121
Dev/File/Setup/Index.html Normal file
View File

@@ -0,0 +1,121 @@
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Dev/File/Setup/Index - XOWA</title>
<link rel="shortcut icon" href="http://xowa.org/xowa_logo.png" />
<link rel="stylesheet" href="http://xowa.org/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/File/Setup/Index</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">
<ul>
<li>
Windows: <a href="http://xowa.org/wiki/home/page/Dev/File/Setup/Windows.html" id="xolnki_2" title="Dev/File/Setup/Windows" class="xowa-visited">Dev/File/Setup/Windows</a>
</li>
<li>
Linux: <a href="http://xowa.org/wiki/home/page/Dev/File/Setup/Linux.html" id="xolnki_3" title="Dev/File/Setup/Linux" class="xowa-visited">Dev/File/Setup/Linux</a>
</li>
<li>
Mac OS X: <a href="http://xowa.org/wiki/home/page/Dev/File/Setup/Mac_OS_X.html" id="xolnki_4" title="Dev/File/Setup/Mac OS X">Dev/File/Setup/Mac OS X</a>
</li>
</ul>
</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(http://xowa.org/xowa_logo.png);" href="index.html" 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/wiki/home/page/Help/Download_XOWA.html" title='Download the XOWA application'>Download XOWA</a></li>
<li><a href="http://xowa.org/wiki/home/page/Dashboard/Image_databases.html" title='Download offline wikis and image databases'>Download wikis</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-stargin'>
<h3>Getting started</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/System_requirements.html" title='Get XOWA&apos;s system requirements'>Requirements</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/Installation.html" title='Get instructions for installing XOWA'>Installation</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/Simple_Wikipedia.html" title='Learn how to set up Simple Wikipedia'>Simple Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/English_Wikipedia.html" title='Learn how to set up English Wikipedia'>English Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/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-help'>
<h3>Help</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/Help/About.html" title='Get more information about XOWA'>About</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Contents.html" title='View a list of help topics'>Contents</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Media.html" title='Read what others have written about XOWA'>Media</a></li>
<li><a href="http://xowa.org/wiki/home/page/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/wiki/home/page/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>

241
Dev/File/Setup/Linux.html Normal file
View File

@@ -0,0 +1,241 @@
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Dev/File/Setup/Linux - XOWA</title>
<link rel="shortcut icon" href="http://xowa.org/xowa_logo.png" />
<link rel="stylesheet" href="http://xowa.org/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/File/Setup/Linux</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 recommends that Linux users download and install ImageMagick and Inkscape according to their distribution requirements.
</p>
<p>
Ubuntu instructions are listed below. Other distro-specific instructions will be added as feedback is received.
</p>
<p>
After ImageMagic and Inkscape are installed, you must click the following link to update XOWA's config:
</p>
<div>
update xowa config&nbsp;
</div>
<p>
. You can also configure this option at <a href="http://xowa.org/wiki/home/page/Options/Files.html" id="xolnki_2" title="Options/Files" class="xowa-visited">Options/Files</a>
</p>
<p>
For more information about the config, see the section below.
</p>
<div id="toc" class="toc">
<div id="toctitle">
<h2>
Contents
</h2>
</div>
<ul>
<li class="toclevel-1 tocsection-1">
<a href="#Ubuntu"><span class="tocnumber">1</span> <span class="toctext">Ubuntu</span></a>
</li>
<li class="toclevel-1 tocsection-2">
<a href="#Config_.28all_distros.29"><span class="tocnumber">2</span> <span class="toctext">Config (all distros)</span></a>
<ul>
<li class="toclevel-2 tocsection-3">
<a href="#Enable_images"><span class="tocnumber">2.1</span> <span class="toctext">Enable images</span></a>
</li>
<li class="toclevel-2 tocsection-4">
<a href="#Paths"><span class="tocnumber">2.2</span> <span class="toctext">Paths</span></a>
</li>
</ul>
</li>
<li class="toclevel-1 tocsection-5">
<a href="#ImageMagick_source"><span class="tocnumber">3</span> <span class="toctext">ImageMagick source</span></a>
</li>
</ul>
</div>
<h2>
<span class="mw-headline" id="Ubuntu">Ubuntu</span>
</h2>
<p>
Ubuntu users should run the following in a terminal:
</p>
<pre>
sudo apt-get install imagemagick
sudo apt-get install inkscape
</pre>
<h2>
<span class="mw-headline" id="Config_.28all_distros.29">Config (all distros)</span>
</h2>
<h3>
<span class="mw-headline" id="Enable_images">Enable images</span>
</h3>
<ul>
<li>
Navigate to <a href="http://xowa.org/wiki/home/page/Options.html" id="xolnki_3" title="Options" class="xowa-visited">Options</a> and check "Download enabled"
</li>
<li>
Restart XOWA and navigate to any page. Any images will be downloaded automatically.
</li>
</ul>
<h3>
<span class="mw-headline" id="Paths">Paths</span>
</h3>
<p>
Note that XOWA assumes that ImageMagick and Inkscape have the following paths:
</p>
<ul>
<li>
<b>/usr/bin/identify</b>
</li>
<li>
<b>/usr/bin/convert</b>
</li>
<li>
<b>/usr/bin/inkscape</b>
</li>
</ul>
<p>
If these paths are different on your system, you will need to update the config file. Instructions are provided below. If you run into issues, you may want to visit <a href="http://xowa.org/wiki/home/page/Dev/Config_files.html" id="xolnki_4" title="Dev/Config files">Dev/Config_files</a> for more information.
</p>
<ul>
<li>
Open <b>/xowa/xowa.gfs</b> in a text editor.
</li>
<li>
Search for <code>.cmd_('/usr/bin/identify')</code>
</li>
<li>
Update the path to whatever it is on you system.
</li>
<li>
Repeat for the other paths
</li>
<li>
Save the file and restart XOWA.
</li>
</ul>
<h2>
<span class="mw-headline" id="ImageMagick_source">ImageMagick source</span>
</h2>
<p>
If you need to compile ImageMagick from source, you can try the following:
</p>
<ul>
<li>
Navigate to the <a href="http://www.imagemagick.org/script/install-source.php" rel="nofollow" class="external free">http://www.imagemagick.org/script/install-source.php</a>
</li>
<li>
Download <b>tar.gz</b>.
</li>
<li>
Unpack the archive to your home directory (EX: <b>/home/username/imageMagick</b>)
</li>
<li>
Run the following from a terminal
</li>
</ul>
<pre>
./configure
make
sudo make install
sudo ldconfig /usr/local/lib
</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(http://xowa.org/xowa_logo.png);" href="index.html" 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/wiki/home/page/Help/Download_XOWA.html" title='Download the XOWA application'>Download XOWA</a></li>
<li><a href="http://xowa.org/wiki/home/page/Dashboard/Image_databases.html" title='Download offline wikis and image databases'>Download wikis</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-stargin'>
<h3>Getting started</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/System_requirements.html" title='Get XOWA&apos;s system requirements'>Requirements</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/Installation.html" title='Get instructions for installing XOWA'>Installation</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/Simple_Wikipedia.html" title='Learn how to set up Simple Wikipedia'>Simple Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/English_Wikipedia.html" title='Learn how to set up English Wikipedia'>English Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/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-help'>
<h3>Help</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/Help/About.html" title='Get more information about XOWA'>About</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Contents.html" title='View a list of help topics'>Contents</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Media.html" title='Read what others have written about XOWA'>Media</a></li>
<li><a href="http://xowa.org/wiki/home/page/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/wiki/home/page/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,141 @@
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Dev/File/Setup/Mac OS X - XOWA</title>
<link rel="shortcut icon" href="http://xowa.org/xowa_logo.png" />
<link rel="stylesheet" href="http://xowa.org/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/File/Setup/Mac OS X</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 currently has no instructions for Mac OS X. You can help by installing ImageMagick and Inkscape on our machine and posting your instructions.
</p>
<ul>
<li>
For ImageMagick, see <a href="http://www.imagemagick.org/script/binary-releases.php#macosx" rel="nofollow" class="external free">http://www.imagemagick.org/script/binary-releases.php#macosx</a>
</li>
<li>
For Inkscape, see <a href="http://inkscape.org/download/" rel="nofollow" class="external free">http://inkscape.org/download/</a> and "Mac OS X 10.6, Snow Leopard — Universal .dmg (requires Apple's X11/Xquartz 2.3.4 or higher)"
</li>
</ul>
<p>
After ImageMagic and Inkscape are installed, you must click the following link to update XOWA's config:
</p>
<div>
update xowa config&nbsp;
</div>
<p>
You can also do the following:
</p>
<ul>
<li>
Navigate to <a href="http://xowa.org/wiki/home/page/Options/Files.html" id="xolnki_2" title="Options/Files" class="xowa-visited">Options/Files</a> and check "Download enabled"
</li>
<li>
Restart XOWA and navigate to any page. Any images will be downloaded automatically.
</li>
</ul>
<p>
If you do succeed in installing ImageMagick/Inkscape, please help XOWA and detail your experience. See <a href="http://xowa.org/wiki/home/page/Help/Feedback.html" id="xolnki_3" title="Help/Feedback" class="xowa-visited">Help/Feedback</a>.
</p>
</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(http://xowa.org/xowa_logo.png);" href="index.html" 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/wiki/home/page/Help/Download_XOWA.html" title='Download the XOWA application'>Download XOWA</a></li>
<li><a href="http://xowa.org/wiki/home/page/Dashboard/Image_databases.html" title='Download offline wikis and image databases'>Download wikis</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-stargin'>
<h3>Getting started</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/System_requirements.html" title='Get XOWA&apos;s system requirements'>Requirements</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/Installation.html" title='Get instructions for installing XOWA'>Installation</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/Simple_Wikipedia.html" title='Learn how to set up Simple Wikipedia'>Simple Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/English_Wikipedia.html" title='Learn how to set up English Wikipedia'>English Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/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-help'>
<h3>Help</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/Help/About.html" title='Get more information about XOWA'>About</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Contents.html" title='View a list of help topics'>Contents</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Media.html" title='Read what others have written about XOWA'>Media</a></li>
<li><a href="http://xowa.org/wiki/home/page/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/wiki/home/page/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>

207
Dev/File/Setup/Windows.html Normal file
View File

@@ -0,0 +1,207 @@
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Dev/File/Setup/Windows - XOWA</title>
<link rel="shortcut icon" href="http://xowa.org/xowa_logo.png" />
<link rel="stylesheet" href="http://xowa.org/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/File/Setup/Windows</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>
If you run into issues with this install, then you may will need to install the components manually. The sections below provide more detail.
</p>
<div id="toc" class="toc">
<div id="toctitle">
<h2>
Contents
</h2>
</div>
<ul>
<li class="toclevel-1 tocsection-1">
<a href="#ImageMagick"><span class="tocnumber">1</span> <span class="toctext">ImageMagick</span></a>
</li>
<li class="toclevel-1 tocsection-2">
<a href="#Inkscape"><span class="tocnumber">2</span> <span class="toctext">Inkscape</span></a>
</li>
<li class="toclevel-1 tocsection-3">
<a href="#Enable_download"><span class="tocnumber">3</span> <span class="toctext">Enable download</span></a>
</li>
<li class="toclevel-1 tocsection-4">
<a href="#Notes"><span class="tocnumber">4</span> <span class="toctext">Notes</span></a>
</li>
</ul>
</div>
<h2>
<span class="mw-headline" id="ImageMagick">ImageMagick</span>
</h2>
<p>
ImageMagick is used for image rendering. It is a free and open-source library, and is probably used by Wikipedia on its website.
</p>
<p>
Installation should take approximately 5-10 minutes.
</p>
<ul>
<li>
Navigate to <a href="http://www.imagemagick.org/script/binary-releases.php#windows" rel="nofollow" class="external free">http://www.imagemagick.org/script/binary-releases.php#windows</a>
</li>
<li>
Download the latest version of ImageMagick: <b>ImageMagick-*-Q16-windows.zip</b>
</li>
<li>
Unzip the file to <b>C:\xowa\bin\windows\imagemagick</b>. When you are done, you should have a file called <b>C:\xowa\bin\windows\imagemagick\convert.exe</b>
</li>
</ul>
<h2>
<span class="mw-headline" id="Inkscape">Inkscape</span>
</h2>
<p>
Inkscape is used for SVG rendering. Note that ImageMagick can be designated the SVG renderer, but it will fail to convert a small percentage of SVGs.<sup id="cite_ref-inkscape_0-0" class="reference"><a href="#cite_note-inkscape-0">[1]</a></sup>
</p>
<p>
Inkscape is also a free and open-source library, and may be used by Wikipedia on its website.
</p>
<p>
Installation should take approximately 5-10 minutes.
</p>
<ul>
<li>
Navigate to the <a href="http://inkscape.org/download/?lang=en" rel="nofollow" class="external free">http://inkscape.org/download/?lang=en</a>
</li>
<li>
Download the 7zip version
</li>
<li>
Unzip the file to <b>C:\xowa\bin\windows\inkscape</b>. When you are done, you should have a file called <b>C:\xowa\bin\windows\inkscape\inkscape.com</b>.
</li>
</ul>
<h2>
<span class="mw-headline" id="Enable_download">Enable download</span>
</h2>
<ul>
<li>
Navigate to <a href="http://xowa.org/wiki/home/page/Options/Files.html" id="xolnki_2" title="Options/Files" class="xowa-visited">Options/Files</a> and check "Download enabled"
</li>
<li>
Restart XOWA and navigate to any page. Any images will be downloaded automatically.
</li>
</ul>
<h2>
<span class="mw-headline" id="Notes">Notes</span>
</h2>
<ol class="references">
<li id="cite_note-inkscape-0">
<span class="mw-cite-backlink"><a href="#cite_ref-inkscape_0-0">^</a></span> <span class="reference-text">ImageMagick indicates that it is not a full-fledged SVG solution: <a href="http://www.imagemagick.org/www/formats.html" rel="nofollow" class="external autonumber">[1]</a></span>
<blockquote>
<span class="reference-text">"Note that SVG is a complex specification and support for the specification in ImageMagick is not complete."</span>
</blockquote><span class="reference-text">Specifically, the following SVGs are converted improperly by ImageMagick. (They are marked with a Corel format.)</span>
<ul>
<li>
<span class="reference-text">In en.wikipedia.org/wiki/Black Hole: File:BH-no-escape-1.svg, File:BH-no-escape-2.svg, File:BH-no-escape-3.svg</span>
</li>
<li>
<span class="reference-text">In en.wikipedia.org/wiki/Thornton Affair: File:US flag 29 stars.svg</span>
</li>
</ul>
</li>
</ol>
</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(http://xowa.org/xowa_logo.png);" href="index.html" 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/wiki/home/page/Help/Download_XOWA.html" title='Download the XOWA application'>Download XOWA</a></li>
<li><a href="http://xowa.org/wiki/home/page/Dashboard/Image_databases.html" title='Download offline wikis and image databases'>Download wikis</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-stargin'>
<h3>Getting started</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/System_requirements.html" title='Get XOWA&apos;s system requirements'>Requirements</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/Installation.html" title='Get instructions for installing XOWA'>Installation</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/Simple_Wikipedia.html" title='Learn how to set up Simple Wikipedia'>Simple Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/English_Wikipedia.html" title='Learn how to set up English Wikipedia'>English Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/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-help'>
<h3>Help</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/Help/About.html" title='Get more information about XOWA'>About</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Contents.html" title='View a list of help topics'>Contents</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Media.html" title='Read what others have written about XOWA'>Media</a></li>
<li><a href="http://xowa.org/wiki/home/page/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/wiki/home/page/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>

195
Dev/SWT.html Normal file
View File

@@ -0,0 +1,195 @@
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Dev/SWT - XOWA</title>
<link rel="shortcut icon" href="http://xowa.org/xowa_logo.png" />
<link rel="stylesheet" href="http://xowa.org/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/SWT</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>
SWT is a core GUI library in XOWA.
</p>
<div id="toc" class="toc">
<div id="toctitle">
<h2>
Contents
</h2>
</div>
<ul>
<li class="toclevel-1 tocsection-1">
<a href="#Overview"><span class="tocnumber">1</span> <span class="toctext">Overview</span></a>
</li>
<li class="toclevel-1 tocsection-2">
<a href="#SWT_is_not_used_in_HTTP_Server_or_Android"><span class="tocnumber">2</span> <span class="toctext">SWT is not used in HTTP Server or Android</span></a>
</li>
<li class="toclevel-1 tocsection-3">
<a href="#Packaging_details"><span class="tocnumber">3</span> <span class="toctext">Packaging details</span></a>
<ul>
<li class="toclevel-2 tocsection-4">
<a href="#Platform-specific_jar"><span class="tocnumber">3.1</span> <span class="toctext">Platform-specific jar</span></a>
</li>
<li class="toclevel-2 tocsection-5">
<a href="#Annual_update"><span class="tocnumber">3.2</span> <span class="toctext">Annual update</span></a>
</li>
</ul>
</li>
<li class="toclevel-1 tocsection-6">
<a href="#SWT_version"><span class="tocnumber">4</span> <span class="toctext">SWT version</span></a>
</li>
</ul>
</div>
<h2>
<span class="mw-headline" id="Overview">Overview</span>
</h2>
<p>
The <a href="https://www.eclipse.org/swt/" rel="nofollow" class="external text">SWT library</a> is an open-source GUI library, used by the open-source Java IDE <a href="https://www.eclipse.org/eclipse/" rel="nofollow" class="external text">Eclipse</a>.
</p>
<p>
XOWA uses SWT in its GUI application across the 3 major operating systems: Windows, Linux, Mac OS X. This means that SWT handles everything visual: including buttons, text boxes, windows, and of course, the HTML browser.
</p>
<h2>
<span class="mw-headline" id="SWT_is_not_used_in_HTTP_Server_or_Android">SWT is not used in HTTP Server or Android</span>
</h2>
<p>
If you are running XOWA as an HTTP server or are using the Android version, then SWT is not used.
</p>
<h2>
<span class="mw-headline" id="Packaging_details">Packaging details</span>
</h2>
<h3>
<span class="mw-headline" id="Platform-specific_jar">Platform-specific jar</span>
</h3>
<p>
SWT comes packaged in an operating system-specific jar called swt.jar. XOWA includes this at /xowa/operating_system_name/swt/swt.jar. For example, on Linux 64-bit, this file is at /xowa/linux_64/swt/swt.jar
</p>
<h3>
<span class="mw-headline" id="Annual_update">Annual update</span>
</h3>
<p>
SWT does a major update annually in coordination with the Eclipse release. Typically, this occurs in June. There are also development snapshots that are released during the course of the year.
</p>
<p>
XOWA will always update SWT shortly after the major version release. Depending on changes, it may also update after development snapshots.
</p>
<h2>
<span class="mw-headline" id="SWT_version">SWT version</span>
</h2>
<p>
XOWA v0.0.0 through v2.6.4 had been using SWT 4.2.
</p>
<p>
XOWA had been stalled in using SWT 4.3 and SWT 4.4 due to the following SWT bug: <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=429739" rel="nofollow" class="external free">https://bugs.eclipse.org/bugs/show_bug.cgi?id=429739</a> This bug was corrected in SWT 4.5.
</p>
<p>
As of v2.6.5, XOWA now uses SWT 4.5. As a result the following 2 bugs were also fixed:
</p>
<ul>
<li>
Printing was not available. See: <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=376358" rel="nofollow" class="external free">https://bugs.eclipse.org/bugs/show_bug.cgi?id=376358</a>
</li>
<li>
A very small minority of pages would not render the same as a browser. For example, <a href="https://en.wikisource.org/wiki/Lubbers_Don't_Live" rel="nofollow" class="external free">https://en.wikisource.org/wiki/Lubbers_Don't_Live</a>!
</li>
</ul>
</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(http://xowa.org/xowa_logo.png);" href="index.html" 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/wiki/home/page/Help/Download_XOWA.html" title='Download the XOWA application'>Download XOWA</a></li>
<li><a href="http://xowa.org/wiki/home/page/Dashboard/Image_databases.html" title='Download offline wikis and image databases'>Download wikis</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-stargin'>
<h3>Getting started</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/System_requirements.html" title='Get XOWA&apos;s system requirements'>Requirements</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/Installation.html" title='Get instructions for installing XOWA'>Installation</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/Simple_Wikipedia.html" title='Learn how to set up Simple Wikipedia'>Simple Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/English_Wikipedia.html" title='Learn how to set up English Wikipedia'>English Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/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-help'>
<h3>Help</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/Help/About.html" title='Get more information about XOWA'>About</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Contents.html" title='View a list of help topics'>Contents</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Media.html" title='Read what others have written about XOWA'>Media</a></li>
<li><a href="http://xowa.org/wiki/home/page/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/wiki/home/page/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>

287
Dev/Sqlite/Tips.html Normal file
View File

@@ -0,0 +1,287 @@
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Dev/Sqlite/Tips - XOWA</title>
<link rel="shortcut icon" href="http://xowa.org/xowa_logo.png" />
<link rel="stylesheet" href="http://xowa.org/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/Sqlite/Tips</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">
<div id="toc" class="toc">
<div id="toctitle">
<h2>
Contents
</h2>
</div>
<ul>
<li class="toclevel-1 tocsection-1">
<a href="#Avoid_LIKE"><span class="tocnumber">1</span> <span class="toctext">Avoid LIKE</span></a>
</li>
<li class="toclevel-1 tocsection-2">
<a href="#Alternative:_Use_comparison"><span class="tocnumber">2</span> <span class="toctext">Alternative: Use comparison</span></a>
</li>
<li class="toclevel-1 tocsection-3">
<a href="#Avoid_ORDER_BY"><span class="tocnumber">3</span> <span class="toctext">Avoid ORDER BY</span></a>
<ul>
<li class="toclevel-2 tocsection-4">
<a href="#Alternative:_denormalize_the_table"><span class="tocnumber">3.1</span> <span class="toctext">Alternative: denormalize the table</span></a>
</li>
<li class="toclevel-2 tocsection-5">
<a href="#Alternative:_multiple_where_clauses"><span class="tocnumber">3.2</span> <span class="toctext">Alternative: multiple where clauses</span></a>
</li>
</ul>
</li>
<li class="toclevel-1 tocsection-6">
<a href="#Beware_bulk_INSERTs_into_a_table_with_a_PRIMARY_KEY"><span class="tocnumber">4</span> <span class="toctext">Beware bulk INSERTs into a table with a PRIMARY KEY</span></a>
</li>
<li class="toclevel-1 tocsection-7">
<a href="#ATTACH"><span class="tocnumber">5</span> <span class="toctext">ATTACH</span></a>
</li>
<li class="toclevel-1 tocsection-8">
<a href="#Get_a_Solid_State_Drive"><span class="tocnumber">6</span> <span class="toctext">Get a Solid State Drive</span></a>
</li>
<li class="toclevel-1 tocsection-9">
<a href="#Use_an_INDEX_for_your_SELECTs.2C_especially_JOINs"><span class="tocnumber">7</span> <span class="toctext">Use an INDEX for your SELECTs, especially JOINs</span></a>
</li>
<li class="toclevel-1 tocsection-10">
<a href="#Use_TRANSACTIONs_for_multiple_INSERT_.2F_UPDATE_.2F_DELETE"><span class="tocnumber">8</span> <span class="toctext">Use TRANSACTIONs for multiple INSERT / UPDATE / DELETE</span></a>
</li>
<li class="toclevel-1 tocsection-11">
<a href="#Use_PRAGMA_page_size_4096"><span class="tocnumber">9</span> <span class="toctext">Use PRAGMA page_size 4096</span></a>
</li>
</ul>
</div>
<h3>
<span class="mw-headline" id="Avoid_LIKE">Avoid LIKE</span>
</h3>
<ul>
<li>
Like is not performant, as it will search both lowercase and uppercase. You can get around this with PRAGMA case_sensitive_like=OFF;
</li>
<li>
Like does not use an index.
</li>
</ul>
<p>
Consider the following table:
</p>
<pre>
CREATE TABLE tbl1
( id integer NOT NULL PRIMARY KEY
, name varchar(255) NOT NULL
);
CREATE INDEX tbl1__name ON tbl1 (name);
</pre>
<p>
Now, consider the following query:
</p>
<pre>
SELECT id
FROM tbl1
WHERE name LIKE 'a%';
</pre>
<p>
The clause <code>name LIKE 'a%'</code> does not use the index <code>tbl1__name</code>.
</p>
<h3>
<span class="mw-headline" id="Alternative:_Use_comparison">= Alternative: Use comparison</span>
</h3>
<p>
If the like has a wildcard at the end, and the data is standardized to one case (all lowercase or all uppercase), use an equality instead:
</p>
<pre>
SELECT id
FROM tbl1
WHERE name &gt;= 'a' AND name &lt; 'b';
</pre>
<p>
This uses the index <code>tbl1__name</code> and returns the same data.
</p>
<h3>
<span class="mw-headline" id="Avoid_ORDER_BY">Avoid ORDER BY</span>
</h3>
<p>
ORDER BY will do an expensive sort operation which may not use an index. This will come into play with multiple-table joins
</p>
<pre>
SELECT t1.id
FROM tbl1 t1
JOIN tbl2 t2 ON t1.id = t2.id
ORDER BY t2.age
;
</pre>
<p>
In most cases, SQLite will only apply one index. In this example, it will be the index for the JOIN. No index gets applied for the score column, even if one is available In some cases, SQLite will actually sort the result-set by the ORDER BY first, before it applies the WHERE.
</p>
<h4>
<span class="mw-headline" id="Alternative:_denormalize_the_table">Alternative: denormalize the table</span>
</h4>
<p>
Putting all the columns in one table and building an index across them.
</p>
<h4>
<span class="mw-headline" id="Alternative:_multiple_where_clauses">Alternative: multiple where clauses</span>
</h4>
<pre>
SELECT t1.id
FROM tbl1 t1
JOIN tbl2 t2 ON t1.id = t2.id
WHERE t2.age &gt; 100 AND t2.age &lt;= 130
;
SELECT t1.id
FROM tbl1 t1
JOIN tbl2 t2 ON t1.id = t2.id
WHERE t2.age &gt; 70 AND t2.age &lt;= 100
;
</pre>
<h3>
<span class="mw-headline" id="Beware_bulk_INSERTs_into_a_table_with_a_PRIMARY_KEY">Beware bulk INSERTs into a table with a PRIMARY KEY</span>
</h3>
<pre>
INSERT INTO
INSERT INTO tbl2 (id, key)
SELECT t1.id
FROM tbl1 t1
JOIN tbl2 t2 ON t1.id = t2.id
WHERE t2.age &gt; 100 AND t2.age &lt;= 130
;
</pre>
<p>
Instead, insert into the table with an ORDER BY
</p>
<h3>
<span class="mw-headline" id="ATTACH">ATTACH</span>
</h3>
<p>
ATTACH database does not affect performance. There is no difference between the following
</p>
<pre>
SELECT t1.id
FROM tbl1 t1
JOIN tbl2 t2 ON t1.id = t2.id
;
</pre>
<pre>
ATTACH 'db2.sqlite3' AS 'db2';
SELECT t1.id
FROM tbl1 t1
JOIN db2.tbl2 t2 ON t1.id = t2.id
;
</pre>
<h2>
<span class="mw-headline" id="Get_a_Solid_State_Drive">Get a Solid State Drive</span>
</h2>
<p>
SQLite does a lot of disk reading and writing
</p>
<h2>
<span class="mw-headline" id="Use_an_INDEX_for_your_SELECTs.2C_especially_JOINs">Use an INDEX for your SELECTs, especially JOINs</span>
</h2>
<h2>
<span class="mw-headline" id="Use_TRANSACTIONs_for_multiple_INSERT_.2F_UPDATE_.2F_DELETE">Use TRANSACTIONs for multiple INSERT / UPDATE / DELETE</span>
</h2>
<h2>
<span class="mw-headline" id="Use_PRAGMA_page_size_4096">Use PRAGMA page_size 4096</span>
</h2>
</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(http://xowa.org/xowa_logo.png);" href="index.html" 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/wiki/home/page/Help/Download_XOWA.html" title='Download the XOWA application'>Download XOWA</a></li>
<li><a href="http://xowa.org/wiki/home/page/Dashboard/Image_databases.html" title='Download offline wikis and image databases'>Download wikis</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-stargin'>
<h3>Getting started</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/System_requirements.html" title='Get XOWA&apos;s system requirements'>Requirements</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Setup/Installation.html" title='Get instructions for installing XOWA'>Installation</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/Simple_Wikipedia.html" title='Learn how to set up Simple Wikipedia'>Simple Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/App/Import/English_Wikipedia.html" title='Learn how to set up English Wikipedia'>English Wikipedia</a></li>
<li><a href="http://xowa.org/wiki/home/page/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-help'>
<h3>Help</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/wiki/home/page/Help/About.html" title='Get more information about XOWA'>About</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Contents.html" title='View a list of help topics'>Contents</a></li>
<li><a href="http://xowa.org/wiki/home/page/Help/Media.html" title='Read what others have written about XOWA'>Media</a></li>
<li><a href="http://xowa.org/wiki/home/page/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/wiki/home/page/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>