From: Cédric V. R. <ced...@gm...> - 2018-05-26 09:38:15
|
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 |