DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:bookcreator

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:bookcreator [2016-01-29 02:35] – [Description] 158.61.0.233plugin:bookcreator [2024-02-08 00:14] (current) Klap-in
Line 2: Line 2:
  
 ---- plugin ---- ---- plugin ----
-description: Allow to select some pages and create a book (PDF or text) +description: Allow to select some pages and create a book (PDF, ODT or text) 
 author     : Gerrit Uitslag (original author: Luigi Micco) author     : Gerrit Uitslag (original author: Luigi Micco)
 email      : klapinklapin@gmail.com # previous: l.micco@tiscali.it  email      : klapinklapin@gmail.com # previous: l.micco@tiscali.it 
 type       : action, syntax type       : action, syntax
-lastupdate : 2015-06-11 +lastupdate : 2024-02-07 
-compatible : HrunAdora BelleWeatherwaxBinky,Ponder Stibbons +compatible : Elenor Of TsortFrusterick MannersGreeboHogfatherIgor, Jack Jackrum, Kaos 
-depends    : dw2pdf, text+depends    : dw2pdf, text, odt
 conflicts  : projects conflicts  : projects
 similar    : odt, dw2pdf similar    : odt, dw2pdf
-tags       : export, pdf, books +tags       : export, pdf, odt, books
-screenshot_img : http://img37.imageshack.us/img37/2496/bookcreatorbookmanager.png+
  
 securitywarning: securitywarning:
Line 20: Line 19:
 sourcerepo : https://github.com/Klap-in/dokuwiki-plugin-bookcreator sourcerepo : https://github.com/Klap-in/dokuwiki-plugin-bookcreator
 donationurl: donationurl:
 +
 +screenshot_img : https://trello.com/1/cards/644c13bd06a0c6737cae672f/attachments/644c1410e00d0916dfc21f6c/download/bookcreator_bookmanager.png
 ---- ----
  
 ===== Description ===== ===== Description =====
-The **bookcreator** plugin allows the user to select some pages from a wiki and then export them to create a little PDF book or text (like a similar [[wp>Help:Books|function of Wikipedia]]) 
  
-First you initialize a book by clicking an interface button or by adding ''?do=addtobook'' to the page url. Nextly, a toolbar at the top of the pages appear to add/remove more pages to the book. Also you can jump to the bookmanager (at a preconfigured page) that let you sort and finish the selections for your book, and export it to screen(html) and when the required plugins are installed: to pdf-file or text on screen.+The **bookcreator** plugin allows the user to select some pages from a wiki and then export them to create a little PDF book or text (like a similar [[wp>Help:Books|function of Wikipedia]]). 
 + 
 +First you initialize a book by clicking an interface button. Nextly, a toolbar at the top of the pages appear to add/remove more pages to the book. Also you can jump to the bookmanager (at a preconfigured page) that let you sort and finish the selections for your book, and export it to screen(html) and when the required plugins are installed: to pdf-file, odt-file or text on screen.
  
 The bookmanager let you save and load saved selections for later use. You can use drag and drop to change the order and move pages in and out.  The bookmanager let you save and load saved selections for later use. You can use drag and drop to change the order and move pages in and out. 
-   + 
-To workthis plugin needs cookies; the PDF export required [[plugin:dw2pdf|dw2pdf]] plugin; the Text export required the [[plugin:text|text]] plugin. +The bookcreator supports the following export formatsif you install respectively plugin
 +  * To work the PDF export required [[plugin:dw2pdf|dw2pdf]] plugin; 
 +  * the ODT export required [[plugin:odt|OpenDocument Export]] plugin; 
 +  * the Text export required the [[plugin:text|text]] plugin. 
  
 ===== Usage ===== ===== Usage =====
Line 38: Line 43:
      
 In the bookmanager can show and manage your list of selected pages In the bookmanager can show and manage your list of selected pages
-    * Reset current selection +  * Reset current selection 
-    * Exclude/include a page from selection (up to about 80 pages((Size is limited by maximum size of cookies. Number is lower when using long pageids.))) +  * Exclude/include a page from selection 
-    * View the excluded pages and "include" them back +  * View the excluded pages and "include" them back 
-    * Drag and drop to change exporting order of page and remove/add page to the selection. +  * Drag and drop to change exporting order of page and remove/add page to the selection. 
-    * Set a title for the PDF document +  * Set a title for the PDF document 
-    * Create the PDF book on selected pages +  * Create the PDF book on selected pages 
-    * Create a printable version of selected pages +  * Create a printable version of selected pages 
-    * Extract only text of selected pages +  * Extract only text of selected pages 
-    * Save and restore selections on a specific namespace (use ACL's rights)+  * Save and restore selections on a specific namespace (use ACL's rights)
  
 == Example == == Example ==
Line 55: Line 60:
 </code> </code>
 And __after__ you mark at least one page for inclusion in the book, the bookmanager appears.  And __after__ you mark at least one page for inclusion in the book, the bookmanager appears. 
-{{http://img37.imageshack.us/img37/2496/bookcreatorbookmanager.png?500}}+{{https://trello.com/1/cards/644c13bd06a0c6737cae672f/attachments/644c1410e00d0916dfc21f6c/download/bookcreator_bookmanager.png?500&recache|BOOK}}
  
 ==== Initiate a book==== ==== Initiate a book====
  
-{{ http://img17.imageshack.us/img17/9830/bookcreatorpagetoolsadd.png?150}} +{{ https://trello.com/1/cards/644c13bd06a0c6737cae672f/attachments/644c1411072ca080378e5093/download/bookcreator_pagetoolsadd.png?150&recache|pagetools}} 
-Use the //Add/Remove to book// link or button in your template to point a first page you like to add to a pdf book. The image on the left handside is the link as added automatically to the 'dokuwiki' template, see [[#installation]] instruction below for other templates. When no such link is available add ''?do=addtobook'' or ''&do=addtobook'' to the page url+Use the //Add/Remove to book// link or button in your template to point a first page you like to add to a pdf book. The image on the left handside is the link as added automatically to the 'dokuwiki' template, see [[#installation]] instruction below for other templates.
  
 After selecting the first page, a toolbar appears on every page that let you add or remove additional pages. This toolbar refers also to the book manage tool. After selecting the first page, a toolbar appears on every page that let you add or remove additional pages. This toolbar refers also to the book manage tool.
  
-{{http://img703.imageshack.us/img703/9973/bookcreatortoolbar.png?500}}+{{https://trello.com/1/cards/644c13bd06a0c6737cae672f/attachments/644c158811a19667595f946f/download/bookcreator_toolbar.png?500&recache|toolbar}}
  
 The book manage tool that you created above (default on ''wiki:ebook'') with ''<nowiki>~~BOOK~~</nowiki>'' let you reorder and exclude pages to your selection. Everybody who has access to the book manage tool can export selections to pdf, or show a print version. When you have enough (at least the "change") ACL permissions in the namespace where the selections are saved, you can also save and select these selections.  The book manage tool that you created above (default on ''wiki:ebook'') with ''<nowiki>~~BOOK~~</nowiki>'' let you reorder and exclude pages to your selection. Everybody who has access to the book manage tool can export selections to pdf, or show a print version. When you have enough (at least the "change") ACL permissions in the namespace where the selections are saved, you can also save and select these selections. 
Line 71: Line 76:
  
 Below the bookmanager is a listed displayed with saved selections. You can also display with ''<nowiki>~~ARCHIVEBOOK:</nowiki>//number//<nowiki>&sort~~</nowiki>'' such a list of saved selections (books) anywhere into your wiki. Below the bookmanager is a listed displayed with saved selections. You can also display with ''<nowiki>~~ARCHIVEBOOK:</nowiki>//number//<nowiki>&sort~~</nowiki>'' such a list of saved selections (books) anywhere into your wiki.
-    * Available action: Load a saved selection into the bookmanager again +  * Available action: Load a saved selection into the bookmanager again 
-    * Optionally you can specify the number of selections to display and the order: +  * Optionally you can specify the number of selections to display and the order: 
-      * ''date'' -- Sort by saving date of selection +    * ''date'' -- Sort by saving date of selection 
-      * ''title'' -- Sort by Title of the selection +    * ''title'' -- Sort by Title of the selection 
-      * a //number// limits the number of displayed selections+    * a //number// limits the number of displayed selections
  
 Default is 10 items ordered by date (last updated are sorted first). Each entry links also to the wiki page where their selection is saved. Per page only one list of saved selections is displayed. Default is 10 items ordered by date (last updated are sorted first). Each entry links also to the wiki page where their selection is saved. Per page only one list of saved selections is displayed.
Line 82: Line 87:
  
 == Example == == Example ==
 +
 +{{ https://trello.com/1/cards/644c13bd06a0c6737cae672f/attachments/644c140fcbe6cb0c49445a29/download/bookcreator_archivebook.png?170&recache|list}}
 Lists 5 selections, sorted by date Lists 5 selections, sorted by date
 <code> <code>
 ~~ARCHIVEBOOK:5&date~~ ~~ARCHIVEBOOK:5&date~~
 </code> </code>
-{{http://img59.imageshack.us/img59/9531/bookcreatorarchivebook.png?170}} 
  
-===== Installation =====+==== Direct export a saved selection ====
  
-To add or remove page to the selection, you simply need to call the page passing it a ''do=addtobook'' url argument. The easiest way to implement this is to add a button or link somewhere in the template design. Some templates are supported alreadysome other templates require manual modifications.+To create link, which initiates an export to respectively pdf, text, html or odt-file, you can use: 
 +(FIXME: ODT format have to receive the update yetlittle patience please) 
 +<code> 
 +~~EXPORTPDF:Pagename of Saved selection~~ 
 +~~EXPORTTEXT:pagename_of_saved_selection~~ 
 +~~EXPORTHTML:pagename of saved selection~~ 
 +~~EXPORTODT:saved selection~~ 
 +</code>
  
-==== 'dokuwiki' template ====+To change link title shown in wiki page: 
 +<code>~~EXPORTPDF:saved selection|A Titel that replaces default link title~~</code>
  
-When you are using the newest default template of DokuWiki, the "Add/remove to book" link is automatically added via javascript. It will appear when the user has at least read access to the page of the bookmanager (default ''wiki:ebook'').+Add url parameters to export url: 
 +<code>~~EXPORTPDF:saved selection&book_skipforbiddenpages=1~~ 
 +~~EXPORTPDF:saved selection&book_skipforbiddenpages=1|Alternative title.pdf~~</code>
  
-==== 'default' template ====+===== Installation =====
  
-Use the following to add another button in the upper or bottom button row of the default template((In ''%%/lib/tpl/default/main.php%%'', there are two divs that contain some buttons''%%<div class="bar" id="bar__top">%%'' and ''%%<div class="bar" id="bar%%__%%bottom">%%''Just insert the HTML code inside one of the two divs (left or right)))+Search and install the plugin using the [[plugin:extension|Extension Manager]]Refer to [[:Plugins]] on how to install plugins manually.
  
-<code html> +==== 'dokuwiki' template ====
-<form class="button" method="get" action="<?php echo wl($ID)?>"> +
-  <div class="no"> +
-    <input type="submit" value="Add/Remove selection" class="button" /> +
-    <input type="hidden" name="do" value="addtobook" /> +
-    <input type="hidden" name="id" value="<?php echo $ID?>" /> +
-  </div> +
-</form> +
-</code>+
  
-==== Monobook ==== +When you are using the default template of DokuWiki, the "Add/remove to booklink is automatically added via javascriptIt will appear when the user has at least read access to the page of the bookmanager (default page is ''wiki:ebook'').
- +
-When using the template "[[template:monobook|monobook for DokuWiki]]", to have an Add/Remove link, in ///user/tabs.php//, use this code +
-<code php> +
-//pdfbook plugin: add/remove selection +
-if (file_exists(DOKU_PLUGIN."bookcreator/action.php") && +
-    !plugin_isdisabled("bookcreator")){ +
-    $_monobook_tabs["tab-bookcreator"]["text"] = "Add/Remove to selection"+
-    $_monobook_tabs["tab-bookcreator"]["href"] = wl(getID(), array("do" => "addtobook"), false, "&"); +
-+
-</code> +
- +
-==== Vector ==== +
- +
-Add this code to ''/lib/tpl/vector/conf/boxes.php'' (best way is from line 131 to line 142, between the ODT and PDF export) to create a link in the [[template:vector|vector]] template which adds the displayed page to the book: +
-<code php> +
-//pdfbook plugin: add/remove selection +
-if (file_exists(DOKU_PLUGIN."bookcreator/action.php") && +
-   !plugin_isdisabled("bookcreator")){ +
-   $_vector_boxes["p-coll-print_export"]["xhtml" .= "        <li id=\"coll-create-book\"><a href=\"".wl(cleanID(getId()), array("do" => "addtobook"))."\" rel=\"nofollow\">".hsc($lang["vector_exportbxdef_createbook"])."</a></li>\n"; +
-+
-</code> +
-As a second step, open the language file for the vector template, for example ''/lib/tpl/vector/lang/en/lang.php'' (depends on the language you are usingand add the following line to the code: +
-<code php> +
-$lang["vector_exportbxdef_createbook"] = "Add/Remove to selection"; +
-</code> +
-This is the text which is used for the link to display.+
  
 +==== other templates ====
  
 +Other templates will probably not be supported that good yet. Please request at the issue tracker.
  
 ===== Changing the order of wiki pages ===== ===== Changing the order of wiki pages =====
Line 155: Line 139:
     * [[:last_page]]     * [[:last_page]]
  
-You can also manually create a book from scratch by using the same format.  +You can also manually create a book from scratch by using the same format. 
-  * Take care of prefixing of links by '':'' +  * Take care of prefixing of links by '':''
   * To create a book from scratch, start a new page such as //wiki:ebook:mybookname// (default). The namespace can be changed at admin side configuration.   * To create a book from scratch, start a new page such as //wiki:ebook:mybookname// (default). The namespace can be changed at admin side configuration.
  
-=====Configuration=====+===== Configuration ===== 
 Available configuration options. Available configuration options.
 ^Name           ^Description                                                               ^ ^Name           ^Description                                                               ^
Line 167: Line 152:
 |save_namespace |Namespace where the book manager will save selections.                    | |save_namespace |Namespace where the book manager will save selections.                    |
 |skip_ids       |Don't show tools if pageid contains one of these ids.                     | |skip_ids       |Don't show tools if pageid contains one of these ids.                     |
 +
 +==== Modifying the generated file ====
 +
 +If you like to configure/modify the pdf or odt-file that is generated, you have to refer to the respectively the [[plugin:dw2pdf]] or [[plugin:odt]] plugin. The bookcreator plugin provides only the interface for creating a page selection that is submitting to these plugins for the file generation.
  
 ===== Version history ===== ===== Version history =====
Line 173: Line 162:
  
 {{rss>https://github.com/Klap-in/dokuwiki-plugin-bookcreator/commits/master.atom date}} {{rss>https://github.com/Klap-in/dokuwiki-plugin-bookcreator/commits/master.atom date}}
- 
-  * **''2013-06-12''**  
-    * Removed inline javascript 
-    * Rewritten javascript by using jQuery. JQuery UI for sorting. 
-    * Refactored Bookmanager code 
-    * Included some localisations 
-    * There are some new strings added 
-    * In the 'dokuwiki' template the 'Add/Remove to book' is automatically added 
-    * Removed BOM at begin of ''/de/lang.php'' 
-    * Fixed Call-time pass-by-reference search function 
-    * Adopted by [[user>Klap-in]]. Moved development resources to Github. 
- 
-Original author: [[l.micco@tiscali.it|Luigi Micco]] 
-  * **''2010-04-19''**  
-    * add support for **ARCHIVE** mode 
-    * rewritten part of code to avoid conflict with other scripts  
-    * support for use ACL's permissions on pages and book's namespace 
-  * **''2010-04-15''** 
-    * some bugs removed (thanks to Karl for tips) 
-    * <del>allow **set wich user's group can save/remove** selections</del>   
-    * hide list of selections if empty 
-  * **''2010-04-15''** 
-    * allow to export selection to a **text only** version ([[plugin:text|text]] plugin required)   
-    * solved problems with cache system 
-  * **''2010-04-14''** 
-    * admin side configuration 
-    * **toolbar** like Wikipedia "Book creator" 
-    * support for "**Help page**" 
-    * allow to set a **title for the PDF** document (see [[plugin:dw2pdf|dw2pdf]] update)   
-    * allow to **save and restore** selections 
-    * allow to export selection to a **printable version** 
  
 This plugin was the former Pdfbook Plugin. This plugin was the former Pdfbook Plugin.
  
-=====Bug reports and feature requests=====+===== Bug reports and feature requests =====
  
 Please refer to the [[https://github.com/Klap-in/dokuwiki-plugin-bookcreator/issues|issue tracker]] for reporting issues. Please refer to the [[https://github.com/Klap-in/dokuwiki-plugin-bookcreator/issues|issue tracker]] for reporting issues.
 +
 +===== FAQ =====
 +
 +  * This plugin is almost what I am looking for. Is there a way to add a title page / cover page? (I am using it with dw2pdf to also include a table of contents. I'd be fine with having a wiki page as "title page" before the TOC.)\\ **reaction**: the [[dw2pdf]] plugin, used by the bookcreator plugin for generation of the actual file, has option for adding a cover page. Please refer to [[dw2pdf]]
  
plugin/bookcreator.1454031356.txt.gz · Last modified: 2016-01-29 02:35 by 158.61.0.233

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