|Version 2 (modified by airadier, 7 years ago) (diff)|
WikiPrint Trac Plugin
Make wiki pages easily printable, exporting to PDF (book or article format) or printable HTML format (page contents without trac headers/footers).
- Fully customizable header/footers for PDF
- Syntax highlighting in exported format, using pygments
- Customizable front page for PDF book format
- Automatic creation of Table of Contents if [[PageOutline]] Macro is used
The style of the resulting PDF or HTML can be fully customized using CSS files.
If you have any issues, create a new ticket.
Download the zipped source from [download:tracwikiprintplugin here].
First, install the plugin as usual.
Enable the plugin by adding wikiprint.* = enabled in the components section of the trac.ini file:
[components] ... wikiprint.* = enabled
Additional options can be set by creating a wikiprint section:
[wikiprint] toc_title = Table of Contents #CSS and content files (or URLS, using http://...) css_url = c:/path/to/file.css article_css_url = c:/path/to/article.css book_css_url = c:/path/to/book.css frontpage_url = c:/path/to/frontpage.html extracontent_url = c:/path/to/extracontent.html
Most of these options can be also set from the web administrative interface.
WikiPrint adds several download formats to the bottom of the wiki page. Following is the description of the available formats.
PDF article creates a PDF file out of the wiki page, with no front page. Additional styles will be used from the CSS file defined in article_css option.
If the page uses the [[PageOutline]] macro, it will be replaced by a Table of Contents.
PDF article can be used to combine several wiki pages too, from the administrative interface.
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.
This is specially useful for combining several wiki pages from the administrative interface.
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.
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.
You can specify a Title, Subject, Date and Version for the exported document.
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.
The following tags are supported:
- #TITLE: Replaced with the Title field when combining pages from the administrative interface, or replaced with the Page Name when exporting from the wiki.
- #SUBJECT: Replaced with the Subject field when combining pages from the administrative interface, or blank when exporting from the wiki.
- #DATE: Replaced with the Date field when combining pages from the administrative interface, or the current time when exporting from the wiki.
- #VERSION: Replaced with the Version field when combining pages from the administrative interface, or the current page version when exporting from the wiki.
- 15603 by rjollos on 2016-06-23 21:20:46
2.0.0dev: Refactor code
- Avoid string interpolation in logger
- Fix spelling error
- Separate local import from import of Python packages
- Use context manager to open file
- 15602 by rjollos on 2016-06-23 20:55:09
2.0.0dev: Remove tag_svn_revision attribute from setup.cfg
The attribute isn't supported in setuptools >= 10.
- 14874 by rjollos on 2015-08-12 20:22:03
2.0.0dev: Use Trac 1.0 database API. Fixes #12480.
Patch by sdegrande.
(47.5 KB) -
added by airadier 7 years ago.
xhtml2pdf / PISA Manual
(78.4 KB) -
added by airadier 7 years ago.
WikiPrint Administration screenshot
- admin_makebook.jpg (74.4 KB) - added by airadier 6 years ago.
- admin_options.jpg (93.6 KB) - added by airadier 6 years ago.
Download all attachments as: .zip