-
-
Notifications
You must be signed in to change notification settings - Fork 22
/
partial-sideload-encyclopedia.hdb
61 lines (55 loc) · 2.87 KB
/
partial-sideload-encyclopedia.hdb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<h1 class="my-3">Sideload Encyclopedia</h1>
<div class="my-3 p-3 border bg-light">
<p>This will side-load a MediaWiki-style OpenZim data set. Place a zim file in the uploads directory.
For Wikipedia, the zim file can be downloaded from <a href="https://download.kiwix.org/zim/wikipedia/">https://download.kiwix.org/zim/wikipedia/</a>.
The en_all_nopic sets are recommended for wikipedia, since they are smaller and do not contain images
(which are not used anyway). For testing, the _mini or _en_100 sets are good choices.
<p></p>
The zim file will be converted to a sqlite database (.db-file) with a similar name to
the zim file, which then automatically is turned into processed data.
<p></p>
Since the first stage of processing is very time-consuming, the sqlite database can
also be loaded from this form.
</p>
</div>
<form method="post" action="actions/sideload-encyclopedia" onsubmit="return confirm('Confirm sideloading')">
<div class="my-3 py-3">
<table class="table">
<th></th><th>Filename</th><th>Size</th><th>Last Modified</th>
{{#each uploadDirContents.items}}
<tr>
<td><input {{#if directory}}disabled{{/if}} class="form-check-input" type="radio" name="source" id="{{name}}" value="{{name}}"></td>
<td {{#if directory}}class="text-muted"{{/if}}>
<label class="form-check-label" for="inlineRadio1">{{name}}{{#if directory}}/{{/if}}</label>
</td>
<td>{{#unless directory}}{{size}}{{/unless}}</td>
<td>{{lastModifiedTime}}</td>
</tr>
{{/each}}
{{#unless uploadDirContents.items}}
<tr>
<td colspan="3">Nothing found in upload directory</td>
</tr>
{{/unless}}
</table>
<p>
<small class="text-muted">
The upload directory is typically mounted to /uploads on the server. The external
directory is typically something like index-{{node.id}}/uploads.
</small>
</p>
<label for="baseUrl" class="form-label">Base URL</label>
<div class="col mb-3">
<input id="baseUrl" name="baseUrl" class="form-control" value="https://en.wikipedia.org/wiki/">
</div>
<small class="text-muted">
The base URL is used to construct the URL for each article. The base URL is prepended to the article path,
and the result is used as the URL for the article. The default value will point to English Wikipedia.
</small>
<div class="row mt-3">
<div class="col">
<button {{#unless uploadDirContents.items}}disabled{{/unless}} type="submit" class="btn btn-primary">Sideload Encyclopedia</button>
</div>
</div>
</div>
</form>