Removing docinfo in "body" part with html5 writer

Cédric Van Rompay <[email protected]>
Newsgroups gmane.text.docutils.user
Message-ID <CAJKLPhzoDtZZJ-PUx+w0Q9nwFikwRTapcFwyRJqR-EzbA0i1ug@mail.gmail.com>
Hi,

When switching from "html" to "html5" writer, I got the following
problem: the docinfo is now included in the "body" parts when using
"publish_parts".

For details see my question of StackOverflow:
https://stackoverflow.com/q/50423279/3025740

As I say in StackOverflow it seems to contradict the documentation
which says that "body" should not contain the docinfo.

Searching in docutils mailing list, I found this message suggesting to
use "strip_elements_with_classes":
https://sourceforge.net/p/docutils/mailman/message/35973538/

But it does not seem to work for me.

Code example:

    import docutils.core

    SOURCE = '''\
    :key: value

    Title
    ========

    Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
nonumy eirmod
    tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
voluptua. At
    vero eos et accusam et justo duo dolores et ea rebum. Stet clita
kasd gubergren,
    no sea takimata sanctus est Lorem ipsum dolor sit amet.
    '''

    docutils_params = {
        'input_encoding': 'utf-8',
        'strip_elements_with_classes': ['docinfo simple']
    }

    body = docutils.core.publish_parts(
        SOURCE,
        writer_name='html5',
        settings_overrides=docutils_params
    )['body']

    print(body)

(using Python 3)

Any idea ?

-- 
Cédric Van Rompay

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Docutils-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/docutils-users

Please use "Reply All" to reply to the list.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.