readthedocs / recommonmark

A markdown parser for docutils
https://recommonmark.readthedocs.io/
MIT License
340 stars 252 forks source link

parser: multiple warning messages due to missing visit_document() method #177

Closed drrosa closed 2 years ago

drrosa commented 5 years ago

We are seeing a lot of warnings like the following for every .md document: .../python3.6/site-packages/recommonmark/parser.py:75: UserWarning: Container node skipped: type=document

It looks like def default_depart(self, mdnode) generates a warning for every container node of type document because the method visit_document does not exist?

PR https://github.com/readthedocs/recommonmark/pull/106 addresses part of this issue by providing useful debug info, but the warnings are still getting generated.

jpmckinney commented 5 years ago

I'm using Sphinx programmatically, so I created a subclass:

class CustomCommonMarkParser(CommonMarkParser):
    def visit_document(self, node):
        pass

and then later (I need to not add 'recommonmark' to the extensions config):

app.add_source_suffix('.md', 'markdown')
app.add_source_parser(CustomCommonMarkParser)
drrosa commented 4 years ago

@jpmckinney Thanks for sharing a workaround to this issue!

abhilash1in commented 4 years ago

I'm still seeing this warning with recommonmark 0.6.0

joe7575 commented 4 years ago

I'm still seeing this warning with recommonmark 0.6.0

The same with me.

...\site-packages\recommonmark\parser.py:75: UserWarning: Container node skipped: type=document

bmxp commented 3 years ago

I still got the same warning in version 0.7.1. @ericholscher Could you please add

    def visit_document(self, mdnode):
        pass

to parser.py or are there arguments against it?