xref: /plugin/siteexport/README.md (revision ba092c97dbb1709a7fb9c7bd411069949079fb9c)
1#Dokuwiki Site Export
2
3Site Export is an admin plugin that offers a convenient way to download your dokuwiki site as a standalone version. It cycles through your namespaces - a starting point can be given at run-time - and packs the result into a zip file.
4The result can be unpacked at any place and viewed without having an internet connection. That makes the plugin perfect for providing static documentation to customers on a CD or DVD.
5
6##Requirements
7
8 * [DokuWiki](http://dokuwiki.org) version **Weatherwax**, **Binky** and newer
9 * You need to log in as administrator to have access to the siteexport plugin
10 * You have to have the [zip compression library of your php](http://de.php.net/manual/en/book.zip.php) installation activated.
11 * [dw2pdf](https://www.dokuwiki.org/plugin:dw2pdf) for PDF export options
12 * a writable <code>/inc/preload.php</code> file for template switching
13
14##Configuration
15
16This is about the Admin --> Configuration Manager page.
17
18 * **Default Export Depth:**<br>
19 How far in should the export go. This option will be used when selecting "_specific depth_" as _Export Type_.
20 * **Try to export non-public pages:**<br>
21 SiteExport only allows to export public pages. This option will allow to export non-public pages that the currently logged in user has access too as well. **(no yet implemented)**
22 * **Wiki Path and name for exported ZIP file:**<br>
23 DokuWiki namespace and file name that will be used to create temporary files.
24 * **Pattern to exclude resources:**<br>
25 A regular expression to define paths that should not be exported
26 * **Maximum script execution time:**<br>
27 Defines an execution time in seconds for how long the script may run while exporting a site via URL Request or wget/curl request. Due to PHP settings this may be very limited and if you export a very large site or namespace the script will time out. This option will take care of redirecting the request as many times as needed until the export is finished for all pages (the time should be lonf enough to have at least one page exported).
28 * **Debug Level:**<br>
29 Level of Debug during export job. This may be important to find errors for the support.
30 * **Debug File:**<br>
31 Where will the debug log be written to? It has to be a writable destination.
32 * **Cache time for export:**<br>
33 The siteexport uses its own cache timer to determine when an export should be discarded.
34
35##How to export pages
36
37SiteExport is only available from the Admin menu at the _Additional Plugins_ section. When starting of from the page you want to export, simply go to the export menu, and hit _start_.
38
39###Enter your starting Namespace
40
41Basic export options
42
43####Set Namespace
44The namespace/page you actually want to export. This will be predefined with the page you currently visited.
45
46####Parent Namespace to export
47By default this is the same namespace/page that you are going to export. That will result in a flat structure, with the pages at the top level.
48
49You can define a higher namespace which will result in the structure below being exported with potentially empty folders but habing the lib (plugins, template) directories beeing at top level.
50
51This is usefull for exporting translated namespaces starting with the root of the translation.
52
53####Export Type
54How many pages should be exported?
55
56  * **This page only:**<br>
57  Attemps to only export this one page.
58  * **All sub namespaces:**<br>
59  Exports everything below the defined namespace
60  * **Specific depth:**<br>
61  Exports everything below the defined namespace but only for the defined depth. The depth means how many namespaces it will go down.
62
63#####Depth
64Number of namespaces to go down into.
65
66#####Export Linked Pages
67Will export linked pages outside or even deeper of the defined namespace as well
68
69###Select your Options
70
71####Export Absolute Paths
72
73#### Export Body only
74Adds the option for renderes to only export the inner body other than exporting the whole page.
75
76####Export all parameters (e.g. "do")
77Adds all parameters to the links in exported pages - which may make sense when using JavaScript that relies on the links
78
79####Render Engine
80By default the engine of the DokuWiki. This allows exporting the pages with other renderers, e.g. the siteexport_pdf (derived from dw2pdf) to have pages in PDF file format.
81
82####Export Template
83**Only available if <code>inc/preload.php</code> is writable.**<br>
84Allows to export the pages with a different template than the default one.
85
86####PDF Export
87**Only available if the dw2pdf plugin is installed.**<br>
88Exports the pages into PDF files, one per page. There are options ([TOC](#Table Of Contents definition)) to export multiple pages into one large PDF.
89
90####Numbered Headings
91**Only available if the dw2pdf plugin is installed.**<br>
92Adds a number to each heading. Usefull for a Table Of Contents inside the PDF
93
94###Select one of the Help Creation Options (optional)
95This is totaly optional.
96
97####Create Eclipse Help:
98Allows the creation of <code>context.xml</code> and <code>map.xml</code> files that can be used by Eclipse and its Plugins.
99
100####Create Java Help:
101Allows the creation of <code>tox.xml</code> and <code>map.xml</code> files that can be used by Java and the Java Help implementation.
102
103####Use TOC file in Namespace
104If you do not want the export to be structured like your DokuWiki is, you can create a file called <code>toc</code> in the namespace and create a custom structure that will be used instead.
105
106This is great for having all the chapters of a documentation in their own file and exporting them into PDF as a single file.
107
108See [Table Of Contents definition](#table-of-contents-definition)
109
110###Disable (JS/CSS) Plugins while export
111The checkboxes stand for each plugin. By checking it the plugin will be disabled temporarily and therefore not generate any CSS or JS output.
112
113This is great for a static export that does not need any other or only some plugins. Be adviced that disabling plugins might improve the speed of PDF export.
114
115###Custom Options
116Here you can add additional variables that will be given to exported page. This can help to create content dynamically when using other plugins or PHP execution.
117
118Simply hit _add Option_ for a new _name_ / _value_ field, enter the variables name and value. Done.
119
120###Start Process
121The three links are convenience links. They will be regenerated by every change of any option. They reflect static URLs that can be copied and used e.g. for _ant_ jobs.
122
123Now: Hit start and your pages will be exported.
124
125###Status
126Reflects what is currently going on and will display errors that occur during exporting or changing options.
127
128###Save as Cron Job
129If your configuration directory is writable - which it should after setup, you can save your current setup here.
130
131You can show what has been saved, view them, delete them and re-run them.
132
133If you have CLI access (terminal or whatever) and cron access to your server, you can add the <code>cron.php</code> file to schedule runs of your cron jobs.
134
135
136##Table Of Contents definition
137If you do not want the export to be structured like your DokuWiki is, you can create a file called <code>toc</code> in the namespace and create a custom structure that will be used instead.
138
139This is great for having all the chapters of a documentation in their own file and exporting them into PDF as a single file.
140
141The structure is basically a list of links:
142
143<pre>
144&lt;toc&gt;
145  * [[.:index|Index of the page]]
146    * [[.:sub:index|Index of the sub namespace]]
147      * [[.:sub:sub:index|Index of the sub/sub namespace]]
148    * [[.:sub:page|Page in the sub namespace]]
149  * [[.:another-page|Another page]]
150    * [[.:another-sub:index|Index of another sub namespace]]
151&lt;/toc&gt;
152</pre>
153
154The &lt;toc&gt; tag support several options:
155
156Option | Behavior
157---- | ----
158notoc | hide the user defined TOC in the document
159description | display the description abstract below of the linked page below the link (usefull together with:`~~META:description abstract=This is my abstract.~~`
160merge | this will merge all the defined documents from the TOC into the current document.
161mergeheader | this will, as addition to merge, merge all headers starting with the first document (new headers of later documents will be appended at the end, the will not be sorted alphabetically)
162
163You have to define the options like this: <code>&lt;toc notoc merge&gt;</code>
164
165##Siteexport Aggregator
166There is the additional syntax: aggregator. This allows an in-page selection of an ordered list of pages in the current namespace and sub-namespaces. Once selected and submitted, that page will be generated with the options provided - and merged back up the list (it actually starts merging top down). (What?!)
167
168The Syntax is (and can be used multiple times per document):
169
170<pre>
171{{siteexportAGGREGATOR [options]}}
172</pre>
173
174 * This will actually create a `<toc>` internally, using the options `merge` and `mergeheader`
175 * Without options it will generate a dropdown-list of all pages in the namespace (except the current) one
176 * The list will be ordered by a meta key `mergecompare` which has to be added via the META plugin.
177 * You can create an element with predefined options using the editor button.