moin icon indicating copy to clipboard operation
moin copied to clipboard

Built-in Converter issues

Open JanHoefelmeyer opened this issue 3 years ago • 1 comments

In addition to https://github.com/moinwiki/moin/issues/1298: Converting to Docbook seems to fail in general with no further info given. There also seem to be some general errors when converting that pop up multiple times, like stylings being added as plaintext instead of applied when converting moinwiki to markdown, the image issues mentioned in https://github.com/moinwiki/moin/issues/1298 or missing newlines when converting moin/creole to ReST.

Are these issues part of not yet implemented features or issues of the converter itself?

JanHoefelmeyer avatar Sep 07 '22 14:09 JanHoefelmeyer

Those are bugs that have never been addressed. Looking at moin/converters/_tests, there is no test for test_docbook_in_out.py. There are tests for test_html_in_out.py, markdown_in_out, and moinwiki_in_out.

If you want to work on this, checkout the bottom of /moin/utils/tree.py:

# MoinMoin namespaces - any-converter-in => Moin DOM => any-converter-out
#
# Namespaces are used to prevent naming collisions
#    moin_page is used to define many types of elements on the moin DOM
#    xinclude is used to describe transclusions on the moin DOM
#    xlink is used to describe links on the moin DOM
#    the html_in and html_out converters use the html namespace to process file input and output
#    the html_in and mediawiki_in converters place style attributes on the moin DOM using the html namespace
#        TODO: the above may be an error, the moin_page namespace should be used
#    the docbook_in and docbook_out converters use the docbook namespace to process file input and output
#    xml is used by html_in, html_out, and markdown_in to place ID attributes on the moin DOM
#        TODO: the above may be an error, the moin_page namespace should be used
#    xml is used in several tests
#    the dc namespace is not used
#    the mathml namespace is not used
#    the svg namespace is not used

moin_page = Namespace('http://moinmo.in/namespaces/page')

# Well-known namespaces
dc = Namespace('http://purl.org/dc/elements/1.1/')
html = Namespace('http://www.w3.org/1999/xhtml')
mathml = Namespace('http://www.w3.org/1998/Math/MathML')
svg = Namespace('http://www.w3.org/2000/svg')
xinclude = Namespace('http://www.w3.org/2001/XInclude')
xlink = Namespace('http://www.w3.org/1999/xlink')
docbook = Namespace('http://docbook.org/ns/docbook')
xml = Namespace('http://www.w3.org/XML/1998/namespace')

During the early years of moin2 development there were defined namespaces without the comments describing the intended usage. The comments reflect my best guess as to intended usage. Several conversion bugs have been fixed by correcting the namespaces.

Don't know if the docbook to docbook conversion problems are due to use of wrong namespaces or not.

RogerHaase avatar Sep 07 '22 19:09 RogerHaase