Changes between Version 41 and Version 42 of TracWikiPrintPlugin
- Timestamp:
- Aug 20, 2015, 9:48:03 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracWikiPrintPlugin
v41 v42 18 18 Existing bugs and feature requests for TracWikiPrintPlugin are [report:9?COMPONENT=TracWikiPrintPlugin here]. 19 19 20 If you have any issues, create a [http://trac-hacks.org/newticket?component=TracWikiPrintPlugin&owner=airadiernew ticket].20 If you have any issues, create a [/newticket?component=TracWikiPrintPlugin new ticket]. 21 21 22 22 [[TicketQuery(component=TracWikiPrintPlugin&group=type,format=progress)]] … … 24 24 == Download 25 25 26 Download the zipped source from [download:tracwikiprintplugin here]. In addition to official Debian packages, there is an [http://dl.dropbox.com/u/4213259/deb/trac-wikiprint_1.8.4%2Br7935-0.1_all.deb unofficial Debian package] (with [http://dl.dropbox.com/u/4213259/deb/trac-wikiprint_1.8.4%2Br7935.orig.tar.gz src], [http://dl.dropbox.com/u/4213259/deb/trac-wikiprint_1.8.4%2Br7935-0.1.dsc dsc], and[http://dl.dropbox.com/u/4213259/deb/trac-wikiprint_1.8.4%2Br7935-0.1.debian.tar.gz debian changes]).26 Download the zipped source from [download:tracwikiprintplugin here]. In addition to official Debian packages, there is an [http://dl.dropbox.com/u/4213259/deb/trac-wikiprint_1.8.4%2Br7935-0.1_all.deb unofficial Debian package] (with [http://dl.dropbox.com/u/4213259/deb/trac-wikiprint_1.8.4%2Br7935.orig.tar.gz src], [http://dl.dropbox.com/u/4213259/deb/trac-wikiprint_1.8.4%2Br7935-0.1.dsc dsc], and [http://dl.dropbox.com/u/4213259/deb/trac-wikiprint_1.8.4%2Br7935-0.1.debian.tar.gz debian changes]). 27 27 28 28 == Source … … 32 32 === Patches 33 33 34 If you are running Windows & IIS and you shouldneed to access resources locally and not via web browser (images, fonts), you may try the #9854 hotfix. Now in testing, please keep the ticket updated with results in order to release this.34 If you are running Windows & IIS and you need to access resources locally and not via web browser (images, fonts), you may try the #9854 hotfix. Now in testing, please keep the ticket updated with results in order to release this. 35 35 36 36 == Installation … … 38 38 There are several '''dependencies''': 39 39 40 * [http://www.xhtml2pdf.com/ xhtml2pdf] and [ http://pypi.python.org/pypi/pisa PISA]: The python library used to convert HTML to PDF. You can install it with ''easy_install pisa''. The version supported by this plugin is 3.0.32. Others might work (3.0.29 is known to have a bug in TOC creation).40 * [http://www.xhtml2pdf.com/ xhtml2pdf] and [pypi:pisa PISA]: The Python library used to convert HTML to PDF. You can install it with ''easy_install pisa''. The version supported by this plugin is 3.0.32. Others might work (3.0.29 is known to have a bug in TOC creation). 41 41 * [http://www.reportlab.org/ ReportLab version 2.2]: This is a dependency of xhtml2pdf. If using easy_install, it should be automatically installed. 42 42 * [http://code.google.com/p/html5lib/ HTML5lib]: Same as previous. 43 43 * [http://pybrary.net/pyPdf/ pyPDF]: Same as previous. 44 * [http://www.pythonware.com/products/pil/ PIL (Python Imaging Library)]: I'm not sure if this is a dependency of xhtml2pdf, but anyways, ''easy_install PIL'' should do the work.45 * [http://pygments.org/ Pygments]: Python syntax highlighter. You need this for syntax highlighting in Trac ,too.44 * [http://www.pythonware.com/products/pil/ PIL] (Python Imaging Library): I'm not sure if this is a dependency of xhtml2pdf, but anyways, ''easy_install PIL'' should do the work. 45 * [http://pygments.org/ Pygments]: Python syntax highlighter. You need this for syntax highlighting in Trac too. 46 46 47 47 To install dependencies (PIL/!!ReportLab/HTML5Lib/Pygments/pyPDF): … … 50 50 * `aptitude install python-imaging python-reportlab python-html5lib python-pygments python-pypdf` 51 51 * On Fedora/Redhat: 52 * `yum install 52 * `yum install python-imaging python-reportlab python-html5lib python-pygments pyPdf` 53 53 54 54 To install plugin: … … 63 63 wikiprint.* = enabled 64 64 }}} 65 65 66 After enabled, two new administrative panels will be available under the '''Wikiprint''' section, and 3 new formats will be available in the ''Download in other formats'' section at the end of the wiki page: 66 67 … … 69 70 * Printable HTML 70 71 71 == Settings72 == Configuration 72 73 73 74 If you're behind a '''proxy''', add something like this to your .wsgi file so '''remote''' resources can be downloaded when creating pdfs: … … 91 92 ... 92 93 }}} 94 93 95 Additional options can be set by creating a ''wikiprint'' section in your `trac.ini` file: 94 96 … … 118 120 !WikiPrint allows customization of documents by three different options: 119 121 120 * '''css_url''': A path or URL to a file with CSS styles that will be applied to the exported output. If left blank, a default CSS is used. If you are creating a custom CSS, use the default CSS as start, and change as needed. Some tweaking is needed in order to make xhtml2pdf/PISA librarygenerate PDF correctly.122 * '''css_url''': A path or URL to a file with CSS styles that will be applied to the exported output. If left blank, a default CSS is used. If you are creating a custom CSS, use the default CSS as start, and change as needed. Some tweaking is needed in order to make xhtml2pdf/PISA library generate PDF correctly. 121 123 * '''article_css_url''': A path or URL to a file with CSS styles that will be used only when exporting to '''PDF Article''' format. The default one defines the page margins, and creates ''header'' and ''footer'' frames, which contents will be defined in the ''extracontent_url'' file. 122 124 * '''book_css_url''': A path or URL to a file with CSS styles that will be used only when exporting to '''PDF Book''' format. The default one defines the default page with no header or footer, which will be used for the front page, and a ''standard'' templage page, which will be used for successive pages, with header and footer. 123 125 124 For more information about the styles that affect the PDF output, see the [attachment:"pisa-en.pdf" xhtml2pdf 126 For more information about the styles that affect the PDF output, see the [attachment:"pisa-en.pdf" xhtml2pdf manual]. 125 127 126 128 === Customizing front page, header, footer, contents 127 129 128 * '''frontpage_url''': 130 * '''frontpage_url''': A path or URL to a file with HTML ('''It doesn't have to be a well formed xhtml document, so don't include begin/end tags, body, etc., see the default one'''), that will be used as the front page when exporting to ''PDF Book''. Some special tags can be used to insert the title, version, date, etc. See ''Tag Replacement'' 129 131 * '''extracontent_url''': A path or URL to a file with HTML that will be inserted at the beginning of the document before passing it to to ''xhtml2pdf''. This should be used to define the contents of the '''header''' and '''footer'''. See xhtml2html documentation, and the default article CSS contents and default extra contents for an example. 130 132 131 133 === Authentication 132 134 133 When using cookie based authentication (like AccountManager), the ''xhtml2pdf'' library is given a temporary cookie to authenticate in behave of the user, so the conversion process will have the same permissions as theuser downloading the .pdf, but '''you must make sure that the project URL is accessible locally from the trac server itself'''.135 When using cookie based authentication (like AccountManager), the ''xhtml2pdf'' library is given a temporary cookie to authenticate in behave of the user, so the conversion process will have the same permissions as the user downloading the .pdf, but '''you must make sure that the project URL is accessible locally from the trac server itself'''. 134 136 135 137 Optionally, is HTTP Basic or Digest authentication is used, wikiprint can be configured to log in using '''httpauth_user''' and '''httpauth_password''' options. … … 137 139 Not available in administrative interface yet: 138 140 139 * '''rebase_links''': When generating PDF or printable HTML, change the base URL to the base URL specified with this option. Useful for changing local references(something like "http://localhost:8080") to a global address (like http://mycompany.com/trac).141 * '''rebase_links''': When generating PDF or printable HTML, change the base URL to the base URL specified with this option. Useful for changing local references (something like "http://localhost:8080") to a global address (like http://mycompany.com/trac). 140 142 * '''omit_links''': Remove internal wiki links from generated PDFs. 141 * '''omit_macros''': A comma separated list of macro names that will be omited when converting the wiki document to the selected output (PDF or printableHTML).143 * '''omit_macros''': A comma separated list of macro names that will be omited when converting the wiki document to the selected output (PDF or printable HTML). 142 144 143 145 == Permissions … … 147 149 * WIKIPRINT_ADMIN: Allow users to acces the ''Wikiprint Options'' admin page, and configure wikiprint options. 148 150 * WIKIPRINT_BOOK: Allow users to access the ''Make Book'' admin page. 149 * WIKIPRINT_FILESYSTEM: When setting up header, footer, style, etc. the user can enter a path to a file from the file system. In order for this to work, the user must have this ''WIKIPRINT_FILESYSTEM'' permission. Otherwise, this could mean a security risk, as the user might display ''/etc/passwd'' or critical files. This is not a WikiPrint problem, as anyone with TRAC_ADMIN permissions would be able to install and run a potentially insecure plugin. So, make sure you trust users with TRAC_ADMIN permissions, and you give WIKIPRINT_FILESYSTEMpermission only to trusted users.151 * WIKIPRINT_FILESYSTEM: When setting up header, footer, style, etc. the user can enter a path to a file from the file system. For this to work, the user must have this ''WIKIPRINT_FILESYSTEM'' permission. Otherwise, this could mean a security risk, as the user might display ''/etc/passwd'' or critical files. This is not a WikiPrint problem, as anyone with TRAC_ADMIN permissions would be able to install and run a potentially insecure plugin. So, make sure you trust users with TRAC_ADMIN permissions and give WIKIPRINT_FILESYSTEM permission only to trusted users. 150 152 151 153 == Exporting and formats … … 163 165 === PDF Book 164 166 165 This format will create a book-like PDF document. A front page that can show title, subject, date and version is inserted at the beginning of the document. A 'Table of Contents' is also inserted after the frontpage. Any further ocurrences of ![[PageOutline]] will be removed. Different wiki pages will be separated by a page break.167 This format will create a book-like PDF document. A front page that can show title, subject, date and version is inserted at the beginning of the document. A 'Table of Contents' is also inserted after the front page. Any further ocurrences of ![[PageOutline]] will be removed. Different wiki pages will be separated by a page break. 166 168 167 169 This is specially useful for combining several wiki pages from the administrative interface: … … 171 173 === Printable HTML 172 174 173 This option will just convert to wiki text to HTML, and display it in the browser with some styles, so it can be printed directly from thebrowser.175 This option will just convert to wiki text to HTML, and display it in the browser with some styles, so it can be printed directly from the browser. 174 176 175 177 === Combining pages 176 178 177 When enabling the plugin, a new !WikiPrint panel will be available in administration. From this panel, you canselect a set of pages, and export them to any of the supported formats.179 When enabling the plugin, a new !WikiPrint panel will be available in administration. From this panel, you can select a set of pages, and export them to any of the supported formats. 178 180 179 181 You can specify a Title, Subject, Date and Version for the exported document. … … 181 183 === Tag replacement 182 184 183 When defining the contents of the ''front page'' file (using HTML), or the ''extra contents'' file (HTML for header, footer or other frames), some special tags canbe used, and they will be replaced before exporting the document.185 When defining the contents of the ''front page'' file (using HTML), or the ''extra contents'' file (HTML for header, footer or other frames), some special tags can be used, and they will be replaced before exporting the document. 184 186 185 187 The following tags are supported: