GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||
GeezerVison is showing www.mediawiki.org — Extension:DocBookExport - MediaWiki
The DocBookExport extension lets you create a DocBook from selected wiki pages. You can download the DocBook as an XML file. Other formats supported are ODT, HTML and PDF. InstallationMake sure that you installed all required dependencies on your server.
Configuration
DependenciesOn the wiki, install the Figures extension, which supports defining figures in MediaWiki. On either the wiki's server, or any other server, install the following:
sudo wget github.com/jgm/pandoc/releases/download/2.16.2/pandoc-2.16.2-1-amd64.deb sudo dpkg -i pandoc-2.16.2-1-amd64.deb For HTML outputTo download the output as an HTML file, install the following, on the same server that holds html_to_docbook:
sudo apt install xsltproc For PDF outputTo download the output in PDF format, install the following software, on the same server that holds html_to_docbook:
sudo apt-get install fop For Zip outputTo download DocBook files in Zip format, install the following, on the same server that holds html_to_docbook:
sudo apt-get install php7.0-zip service apache2 restart UsageTo create a book, first define the page structure using the #docbook parser function. Here is an example call: {{#docbook:
page structure=
? Bowling Introduction
+ Intro Chapters
* How I buy shoes(orientation=landscape)
* Testing page
** Buying clothes intro,Buying shoes(title=Buying the right clothes,header=section header,header_left=section left header)
? Appendix
|title=My Guide to Bowling
|productname=MY PRODUCT NAME(class=trade)
|corpauthor=Wikiworks
|biblioid=MY Bibliod(class=pubnumber)
|volumenum=1
|revhistory=13.1,24 June 2020
|keywordset=KEYWORD1,KEYWORD2
|subjectset=DO NOT REMOVE
|subtitle=Edition M Version 1
|cover page=Cover Contents
|header=My Guide to Bowling
|footer=My Guide to Bowling
|header_left=My Guide to Bowling Left
|footer_left=My Guide to Bowling Left
|header_right=My Guide to Bowling Right
|footer_right=My Guide to Bowling Right
|index=1
|index term categories=index terms(group by=Index has Group)
|index terms=shoe,clothes
|orientation=portrait
|section_autolabel_max_depth=6
|external_link_color=green
|size=A4
|columns=1
|timestamp=1
|watermark.text=DRAFT
|watermark.rotation=-45 deg
|watermark.color=#f2f2f2
|watermark.font.family=Sans
|watermark.font.size=12pt
|title.font.family=Helvetica
|body.font.family=Times Roman
|body.font.size=12pt
|footnote.font.family=Times Roman
|footnote.font.size=8pt
|margin-inner=0.5in
|margin-outer=0.5in
|margin-top=0.5in
|margin-bottom=0.5in
|xsl_import_path=/var/www/html/mycustomxsl
}}
On saving the page, a link will be generated which directs you to a special page Special:GetDocbook. The request is then pushed to the server handling HTML-to-DocBook generation. Once the DocBook is generated, links will be made available on the Special page to download the DocBook: in XML, HTML, ODT and PDF formats. The parameters shown can be customized as follows:
DocBook supports figures which are images or other media that can be referenced elsewhere in the document. A separate list of figures is also prepared. To define a figure you need to use the Figures extension. Grouping of indexes is possible as well. To use this feature add the following wikitext to the index term page (create if required) specifying the group name: {{#docbook_index:grouping=Group_name}}
Another approach to add grouping is by specifying a Semantic MediaWiki property which contains the group name, this can only be done for index term categories and can be specified using "group by" parameter as follows: |index term categories=index terms(group by=Index has Group) While styling in wiki pages is easy using CSS, the same styling is not carried forward to the DocBook. This can be a problem with tables which sometimes should have different widths for different columns. To solve this you can specify a class with the following format: colwidth-80-20, the extension will then convert it to the following DocBook XML which ensures that the column width is maintained in the DocBook: <colspec colwidth="80*" align="left"/>
<colspec colwidth="20*" align="left"/>
Similarly, for a three-column table specify the class as "colwidth-80-10-10". CreditsThis extension has been written by WikiWorks. Process diagramThe following diagram shows how the various software and utilities are used together to create the different output formats that DocBookExport supports, and hopefully makes it easier to understand which dependencies are needed for which outputs. Note that docbook2odf comes pre-bundled with the html_to_docbook library; the rest would need to be installed individually, if they are not already on your system. Development and helpYou are welcome to submit bug fixes in Gerrit and bug reports and feature requests in Wikimedia Phabricator under phab:tag/mediawiki-extensions-docbookexport. Please also feel free to contact the author or WikiWorks for consulting on further developments, feature requests or bug fixes on this extension. See also
| ||||||||||||||||||||||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. | ||||||||||||||||||||||||||