Changes

Jump to: navigation, search

Manual Generation 3.0

1,387 bytes added, 00:43, 3 October 2014
See also: one more
[[Category:Documentation]][[Category:Translators/Categories]]Creation of the GRAMPS manual (docbook/pdf/html) starting from the [[Gramps 3.0 Wiki Manual]]. This is a work in progress, no decision has been taken on how to proceed with this.
==How creating a manual starting from wiki ?==
===MediaWiki to OpenDocument===
*[http://www.mediawiki.org/wiki/Extension:OpenDocument_Export OpenDocument Export] extension makes possible to export single pages or [http://www.mediawiki.org/wiki/Extension:Collection collections] from MediaWiki in OpenDocument Text format (.odt).
 
===MediaWiki to PDF===
*[http://www.mediawiki.org/wiki/Extension:PDF_Writer PDF writer] extension makes possible to export single pages or [http://www.mediawiki.org/wiki/Extension:Collection collections] from MediaWiki in PDF format (.pdf).
*[[Manual Generation 3.0 Prince|Conversion using Prince XML]]
===XML to XML===
# Wikipedia use [http://www.mediawiki.org/wiki/Wikipedia_DTD Wikimedia DTD], a format based on XML, for sharing his data. SGML, docbook are based on XML too.
# We can [[Rollover_for_the_manual|make a test ]] for [http://meta.wikimedia.org/wiki/Help:Export exporting our wiki data to Wikimedia DTD].
# To generate a script (XSLT, python, perl, sh ?) for parsing data from Wikimedia DTD to docbook/SGML.
* [http://johnmacfarlane.net/pandoc/ Pandoc] will convert files from one markup format into another.
===Text to XML===
# * All wiki pages are saved as txt: ''header.txt, preface.txt, chapter_01.txt, ...'', which could be included into one [http://txt2tags.sourceforge.net/userguide/includecommand.html#5_9 file] later. # We make a python script to do the conversion for working with [http://txt2tags.sourceforge.net/index.html txt2tags], maybe sed commands according to txt2tags supports [http://txt2tags.sourceforgewordpress.netcom/sample.t2t sample] and current [http:2008/07/www.mediawiki.org/wiki/Help:Formatting Mediawiki grammar] or to modify the GPL script for working with mediawiki code. Also, there is possible output filter [http:/26/7-years-of-txt2tags.sourceforge.net/userguide/PostProc.html#8_5 functionWikipedia] on txt2tags which could help us.# * Output will be a full gramps.xml/gramps.sgml file with utf8 encoding to avoid non-ASCII characters issues. The present Makefiles in GRAMPS can create html/manual/pdf from these xml files. Possible solution for keeping docbook : [http://openjade.sourceforge.net/ OpenJade] + [http://en.wikipedia.org/wiki/DSSSL DSSSL]. Note that yelp may open xhtml too.
We should keep an eye on official developments here: [http://www.mediawiki.org/wiki/DocBook_XML_export]
An alternative is to proceed as [http://en.wikibooks.org/wiki/Wikibooks:Print_versions Wikibooks] do.
===PHP===
* [http://tools.wikimedia.de/~magnus/wiki2xml/w2x.php wiki2xml] is a [http://svn.wikimedia.org/svnroot/mediawiki/trunk/wiki2xml/php/wiki2xml.php GPL script] for parsing MediaWiki. * [http://wikirenderer.berlios.de/en/ WikiRenderer] is a php component which can parse a wiki content, and transform it to XHTML content, to any other markup language, or to an other wiki content with a different syntax. Sounds correct with [http://www.dokuwiki.org/syntax dokuwiki syntax], which is not far away (headline rule inversed) from Mediawiki syntax ! => [http://wikirenderer.berlios.de/en/demo.php Demo]
===wt2db===
[[Manual Html Generation|A Python program]] can be used to generate html from the text of the Gramps manual wiki pages.
===xhtml to ODT===[http://gitorious.org/xhtml2odt xhtml2odt] stylesheets convert namespaced XHTML to [http://en.wikipedia.org/wiki/OpenDocument ODT]. ===html to html translation===  * Translate toolkit
We can try to translate generated html by using [http://sourceforge.net/projects/translate/ translate toolkit]
html2po <html> > <pot>
po2html -t <html> -i <new_po> -o <new_html>
where <x> is the file format, use your names.
 
* GNUnited Nations
 
[http://www.gnu.org/software/gnun/ GNUnited Nations (GNUN)] is a build system for www.gnu.org translations. It generates a PO template (.pot) for an original HTML article, and merges the changes into all translations, which are maintained as PO (.po) files. Finally, it regenerates the translations in HTML format.
 
The goal of GNUN is to make maintenance of gnu.org translations easier and to avoid the effect of seriously outdated translations when a particular team becomes inactive.
===[[Manual_Html_Generation|html]] to docbook===
* [http://wiki.docbook.org/topic/Html2DocBook Html2Docbook] converts project documentation from HTML to DocBook.
# Convert all of your HTML to XHTML using [http://tidy.sourceforge.net/ Tidy]. Enable 'enclose-block-text' in the configfile, else any unenclosed text (where this is allowed under XHTML Transitional but not under XHTML Strict) will vanish.
# Use the XSL stylesheet (below) to convert the XHTML into [http://wiki.docbook.org/topic/DocBook DocBook] (There's no way to merge the multiple XHTML files into a single document, so the stylesheet converts each HTML page into a ''section''). Be sure to pass in the filename (minus the extension) as a parameter. This will become the section id.
# Correct any validity errors. (At this point, there are likely to be a few, depending on how good the original HTML was.)
# Peruse the now valid [http://wiki.docbook.org/topic/DocBook DocBook] document, and look for the following:
*Broken links ''xref'' elements that should be ''link''s*Missing headers (the heading logic isn't perfect. You'll lose at most 1 header per page, though, and most pages come through with all headers intact.)*Overuse of ''emphasis'' and ''emphasis role="bold"''
[http://www.eecs.umichMissing headers (the heading logic isn't perfect.edu/~ppadala/projects/tidy/ html2db] is a small utility to convert HTML to Docbook SGML/XML. It uses [http://tidy.sourceforge.net/ TidyLib] for parsing the HTMLYou'll lose at most 1 header per page, though, and most pages come through with all headers intact.)
Overuse of ''emphasis'' and ''emphasis role="bold"'' *[http://search.cpan.org/dist/html2dbk/ HTML::ToDocBook] is CPAN perl module who converts an XHTML file into DocBook.
==Manual Text Guidelines==
*# <nowiki>{{grampsmanualcopyright}}</nowiki>: the copyright template. This will be stripped out on manual generation.
*# <nowiki>{{man label|Labels}}</nowiki>: template for GUI elements, example: {{man label|Labels}}
*# <nowiki>{{man button|Buttons}}</nowiki>: template for GUI buttons , example {{man button|Buttons}}
*# <nowiki>{{man tip| 1=title |2=text.}}</nowiki>: template to add a tip in the text
*# <nowiki>{{man note| title |text}}</nowiki>: template to add a note to the text
*# <nowiki>{{man warn| title |text}}</nowiki>: template to add a warning to the text
*# <nowiki>{{man index|prevpage|nextpage}}</nowiki>: template to add the bottom index bar. This will be stripped out on manual generation.
*#<nowiki>{{man menu|Edit->Preferences}}</nowiki>: template for the menu items sequence, example {{man menu|Edit->Preferences}}
*# <nowiki>{{languages}}</nowiki>: template to add language bar. This will be stripped out on manual generation.
*The following markup code may be used:
*#<nowiki>''' bold '''</nowiki>: for bold or menuselections in GRAMPS, eg. '''Edit->PreferencesGramps'''
*#<nowiki>'' italic ''</nowiki>: for italic or filenames in GRAMPS, eg. ''filename''
*#<nowiki><code> code sections</code></nowiki>: for commands you type in the command line.
==A Test==
There is a user request for a [http{{bug|2132}}://www.gramps-project.org/bugs/view.php?id=2132 ''downloadable text format users manual] '' on bug manager.
Steps:
# add/clean anchors
# using [http://tidy.sourceforge.net/ Tidy]
 
===See also===
 
* [[User manual]]
* [[Rollover for the manual]]
* [[Manual Generation]]
* [[Manual Generation 3.0 Prince]]
 
[[Category:Documentation]]
[[Category:Translators/Categories]]

Navigation menu