Dokuwiki EBook

Top

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur eu elit sed turpis tincidunt malesuada at nec nulla. Donec vel feugiat lacus. Nunc condimentum ullamcorper risus, id tristique elit aliquam vitae. Morbi a risus tincidunt, mollis sem sed, egestas nisl. Cras a dui eu justo pulvinar feugiat nec quis augue. Ut ornare, ex a posuere convallis, justo sem congue lacus, vel pellentesque turpis augue a elit. Pellentesque finibus, magna eget suscipit blandit, nunc massa lobortis eros, eu venenatis ipsum augue viverra tortor. Morbi malesuada, tellus quis aliquet venenatis, turpis elit faucibus lorem, at vestibulum metus est non lacus. Etiam velit diam, faucibus sit amet pretium elementum, consectetur ut magna. Curabitur scelerisque blandit eros, non luctus ligula pharetra eget. Etiam bibendum felis eu porta molestie. Integer sit amet mauris et tellus sollicitudin placerat id non felis. Nullam pretium rutrum gravida. Pellentesque malesuada consequat porta.

Sed a semper urna, eu luctus lorem. In hac habitasse platea dictumst. Integer eu placerat dolor. Sed auctor a erat at feugiat. Suspendisse potenti. Integer at libero eu dolor feugiat elementum in non nunc. Vivamus auctor libero eu ante hendrerit, et mattis dolor aliquam. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse tristique metus et velit rhoncus, id viverra sem feugiat.

Middle

Proin facilisis mattis tortor in vulputate. Donec pellentesque, risus sed sodales dignissim, leo neque eleifend elit, et commodo nisl eros non nisl. In ac vestibulum urna. Praesent nec felis id risus hendrerit suscipit pulvinar nec tellus. Aenean rhoncus lectus ante, quis ullamcorper dui euismod non. Integer posuere risus massa, ac blandit augue vehicula eget. Mauris id faucibus augue. Vestibulum aliquam enim at tellus pretium placerat. Duis nec eros tincidunt, efficitur lectus id, lacinia nisl. Nullam cursus libero vehicula libero ultricies, vulputate eleifend justo lobortis. Curabitur iaculis lacus id ex convallis, nec efficitur sem aliquam. Morbi quis ante in libero consequat volutpat ac at enim. Pellentesque ultrices nulla nec efficitur feugiat.

Etiam porta tellus id leo laoreet, id euismod sem placerat. Aliquam porttitor, eros a cursus elementum, eros velit hendrerit dui, non varius tellus urna non erat. Nunc dignissim non nisi non condimentum. Nunc eu dui magna. Donec turpis nisi, faucibus in imperdiet in, tincidunt eget elit. Duis at gravida risus, at molestie arcu. Sed facilisis ornare quam nec placerat.

Font Spacing

This section has been re-opened and edited four or five times

red styles and font styles ppp pm-infix: ppmm mm PPPPPPP ppq rst mm

Morbi dapibus, nibh id imperdiet porttitor, elit dui sodales orci, eu gravida lacus odio et purus. Etiam in tristique urna. Proin in libero vitae lacus porta volutpat. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Cras diam tortor, tincidunt eu est a, sodales commodo lectus. Nam vehicula nisi vel eleifend egestas. Nullam tempor ligula sit amet dictum lobortis. Fusce consequat nulla quis turpis euismod, ut auctor felis pharetra. Sed imperdiet, leo eu commodo interdum, nunc velit auctor nunc, id dapibus sapien lacus ac mi. Aenean pharetra nulla vel mauris sagittis aliquam. Integer non sapien iaculis, tincidunt nibh in, lobortis ex. Add text to old paragraph .Sed efficitur risus diam, volutpat facilisis ante faucibus nec. Nullam pharetra sollicitudin urna, vel condimentum orci ultrices at. Ut feugiat, nisl sed feugiat accumsan, lorem nibh mollis neque, sodales ornare felis metus quis ligula. Aenean faucibus varius scelerisque.

Add Bulleted List

Item One

reopen page and Insert new nested item and reopen again and add font element

Item Two

Item Three

Item 4

Item Five

Event Handlers: Sample Code

eventcheck

events:eventcheck.tgz[1]

eventcheck is a plugin that dumps output on all events, as they are being fired, to a file called eventcheck.txt in your main DokuWiki directory, labeling the 'BEFORE' and 'AFTER' phases of each event. A great deal of data accumulates in a very short time, so you may eventually want to exclude any events you are not currently interested in. A good way way to use this plugin is to check its output against the descriptions of the event objects in the DokuWiki Events List[2].

The eventCheck register() method registers all current DokuWiki events in both 'BEFORE' and 'AFTER' modes. This code illustrates that one plugin can accommodate multiple event handlers and that, where convenient, the same callbacks can be used for more than one handler. To use this plugin place it in a directory named eventcheck in lib/plugins.

headers and footers

Using TPL_ACT_RENDER[3], it’s possible to add text to the top and bottom of a wiki page. TPL_ACT_RENDER is signalled by tpl_content(), which is called from main.php to output the wiki page to the browser:

    <!-- wikipage start -->
<?php tpl_content()?>
<!-- wikipage stop -->

While this event is in effect, the text is held in a buffer outside of its reach and cannot be modified.

However, anything written to standard output (echo, print) will appear either above or below the page, depending on whether it has originated in the BEFORE or AFTER phase of the handler. The headers and footers appear on the screen but do not get written to the page files. This makes them ideal for outputting messages on the fly. When the user is editing a page, the header will appear above the standard instructions:

“Edit the page and hit Save. See syntax . . . ”

During a login session, it will appear above the Login title. What action is currently being processed can be determined from the data field ($event→data), which holds the name of the current action–edit, show, login, etc.¹⁾ TPL_ACT_RENDER provides a powerful option. You can stop the page from being printed to the screen by making the following calls:

$event->preventDefault()
$event->stopPropagation()

The page will not appear on the screen, but any text output from the handler will, enabling you to substitute your own message for the page. Assume, for instance, that certain pages can be viewed only by users from particular IP addresses, who may not be registered with your DokuWiki. You can substitute for the page a message indicating that this page is not available for viewing.²⁾

Content Modification

There are several events which give handlers a chance to modify the text:

PARSER_WIKITEXT_PREPROCESS: here $event→data holds the complete text as marked up in DokuWiki syntax. The modified text will appear in the browser, but it is not saved to disk.

RENDERER_CONTENT_POSTPROCESS: here the marked up text has been converted to XHTML. As in the above, the modified text appears in browser but is not saved to disk. The text is found in data[1].

IO_WIKIPAGE_WRITE: this event writes the text with modifications to disk. At the same time, the text, with any modifications, is returned to the browser. The text is in DokuWiki format and is found in $event→data[0][1]; event→data[0][0] holds the absolute path of the file.

¹⁾

See the sample TPL_ACT_RENDER object

²⁾

The page can be determined from $_REQUEST['id'] and the IP from $_SERVER['REMOTE_ADDR'].

Opencpn ebook with enhanced table of contents

playground:opencpn-4-8-6.toc.epub[4]

How-to

Load your epub into Sigil, click on Tools→Table of Contents→Generate Table of Contents. You could probably make your book a bit smaller by loading it into the Calibre editor and removing unused CSS. Ignore any messages about CSS issues. These are non-critical problems in Dokuwiki itself.

events_event_handlers_code.html

[1] https://www.mturner.org/devel/lib/exe/fetch.php?media=events:eventcheck.tgz
[2] https://www.dokuwiki.org/devel%3Aevents_list
[3] https://www.dokuwiki.org/wiki%3Aevents_list#tpl_act_render

playground_links_t.html

[4] https://www.mturner.org/devel/_media/playground/opencpn-4-8-6.toc.epub