DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:pagebreak

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:pagebreak [2009-12-28 18:07] – added block download name HåkanSplugin:pagebreak [2023-08-16 18:15] (current) – [Development] 104.33.209.15
Line 3: Line 3:
 ---- plugin ---- ---- plugin ----
 description: Forces ('suggests') a pagebreak after the line where a <pagebreak> tag is inserted description: Forces ('suggests') a pagebreak after the line where a <pagebreak> tag is inserted
-author     : Jonathan McBride+author     : Michael Große and Jonathan McBride
 email      : j.mcbride@mail.utexas.edu email      : j.mcbride@mail.utexas.edu
 type       : syntax type       : syntax
-lastupdate : 2007-08-08 +lastupdate : 2016-02-16 
-compatible :+compatible : Hrun, Frusterick Manners
 depends    : depends    :
 conflicts  : conflicts  :
 similar    : similar    :
-tags       : typography, export, printing+tags       : typography, export, printing, pagebreak 
 + 
 +downloadurl: https://github.com/micgro42/dokuwiki-plugin-pagebreak/zipball/master 
 +bugtracker : https://github.com/micgro42/dokuwiki-plugin-pagebreak/issues 
 +sourcerepo : https://github.com/micgro42/dokuwiki-plugin-pagebreak/
 ---- ----
 +
  
  
 ====Description==== ====Description====
 This plugin inserts a 'suggested' pagebreak when printing a wiki page.  Nothing new is visible from a browser.  This seemed like a much needed addition to DokuWiki, since the main use of DokuWiki is documentation.  This is intended to help in the creation of hard-copies of a wiki, possibly with some sort of pdf/ps/gs printer. This plugin inserts a 'suggested' pagebreak when printing a wiki page.  Nothing new is visible from a browser.  This seemed like a much needed addition to DokuWiki, since the main use of DokuWiki is documentation.  This is intended to help in the creation of hard-copies of a wiki, possibly with some sort of pdf/ps/gs printer.
 +
 +Works well with the [[plugin:dw2pdf|dw2pdf plugin]] and the [[plugin:odt|odt plugin]].
  
 ====Use==== ====Use====
 Insert a %%<pagebreak>%% tag on a line by itself where you want a pagebreak.  Check with print preview. Insert a %%<pagebreak>%% tag on a line by itself where you want a pagebreak.  Check with print preview.
  
-====Code==== +====Installation==== 
-<code php syntax.php> +Search and install the plugin using the [[plugin:extension|Extension Manager]]Refer to [[:Plugins]] on how to install plugins manually.
-<?php +
-/** +
- * Plugin Tab: Inserts a pagebreak into the document for every <pagebreak> it encounters.  Based on the tab plugin by Tim Skoch <timskoch@hotmail.com> +
- *  +
- * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html) +
- * @author     Jonathan McBride and Chris Sturm - The University of Texas at Austin +
- *  +
- */ +
-  +
-if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../').'/'); +
-if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); +
-require_once(DOKU_PLUGIN.'syntax.php'); +
-  +
-/** +
- * All DokuWiki plugins to extend the parser/rendering mechanism +
- * need to inherit from this class +
- */ +
-class syntax_plugin_pagebreak extends DokuWiki_Syntax_Plugin { +
-  +
-    /** +
-     * return some info +
-     */ +
-    function getInfo(){ +
-        return array( +
-            'author' => 'Jonathan McBride and Chris Sturm', +
-            'email'  => 'j.mcbride@mail.utexas.edu', +
-            'date'   => '2007-08-08', +
-            'name'   => 'Pagebreak Plugin', +
-            'desc'   => 'Inserts " <br style="page-break-after:always;"> " into the html of the document for every <pagebreak> it encounters', +
-            'url'    => 'NA', +
-        ); +
-    } +
-  +
-    /** +
-     * What kind of syntax are we? +
-     */ +
-    function getType(){ +
-        return 'substition'; +
-    } +
-  +
-    /** +
-     * What kind of syntax do we allow (optional) +
-     */ +
-//    function getAllowedTypes() { +
-//        return array(); +
-//    } +
-  +
-    /** +
-     * What about paragraphs? (optional) +
-     */ +
-//    function getPType(){ +
-//        return 'normal'; +
-//    } +
-  +
-    /** +
-     * Where to sort in? +
-     */  +
-    function getSort(){ +
-        return 999; +
-    } +
-  +
-  +
-    /** +
-     * Connect pattern to lexer +
-     */ +
-    function connectTo($mode) { +
-      $this->Lexer->addSpecialPattern('<pagebreak>',$mode,'plugin_pagebreak'); +
-//      $this->Lexer->addEntryPattern('<TEST>',$mode,'plugin_test'); +
-    } +
-  +
-//    function postConnect() { +
-//      $this->Lexer->addExitPattern('</TEST>','plugin_test'); +
-//    } +
-  +
-  +
-    /** +
-     * Handle the match +
-     */ +
-    function handle($match, $state, $pos, &$handler){ +
-        switch ($state) { +
-          case DOKU_LEXER_ENTER :  +
-            break; +
-          case DOKU_LEXER_MATCHED : +
-            break; +
-          case DOKU_LEXER_UNMATCHED : +
-            break; +
-          case DOKU_LEXER_EXIT : +
-            break; +
-          case DOKU_LEXER_SPECIAL : +
-            break; +
-        } +
-        return array(); +
-    } +
-  +
-    /** +
-     * Create output +
-     */ +
-    function render($mode, &$renderer, $data) { +
-        if($mode == 'xhtml'){ +
-            $renderer->doc .= "<br style=\"page-break-after:always;\">";            // ptype = 'normal' +
-//            $renderer->doc .= "<p>Hello World!</p>";     // ptype = 'block' +
-            return true; +
-        } +
-        return false; +
-    } +
-}+
  
-//Setup VIM: ex: et ts=4 enc=utf-8 : +===== Development =====
-</code>+
  
-====Installation==== 
-Create a new folder “lib/plugins/pagebreak”, and create a file “syntax.php” with the above code as its contents. 
  
-====Discussion==== +=== Change Log ==
-This plugin is **hugely** based on the [[plugin:tab|tab plugin]] by Tim Skoch.  A good 90% of this is probably his untouched code.  Many thanks to Tim for giving us a starting point for this plugin.+ 
 +{{rss>https://github.com/micgro42/dokuwiki-plugin-pagebreak/commits/master.atom date}} 
 + 
 +=== Known Bugs and Issues === 
 + 
 +Please report bugs and issues at the [[https://github.com/micgro42/dokuwiki-plugin-pagebreak/issues|Github issue tracker]].
  
 +> [[;plugin:pagebreak | The PageBreak plugin]] isn't maintained, and [[https://github.com/micgro42/dokuwiki-plugin-pagebreak/issues | bugs]] seem ignored since 2018!  Tag   ''<br style=\"page-break-after:always;\">''   is broken,  ''<div>/</div>''  maby be better?  ''$renderer->doc .= "<div style=\"page-break-after:always;\"></div>";'' This seems simple enough that it may be good to add it in dokuwiki core as ''~~pagebreak~~'' or similar? 
plugin/pagebreak.1262020031.txt.gz · Last modified: 2009-12-28 18:07 by HåkanS

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki