clayrisser / sphinx-markdown-parser

write markdown inside of docutils & sphinx projects
https://codejam.ninja
Other
19 stars 8 forks source link

Instruction in `README` not working #1

Closed idnsunset closed 5 years ago

idnsunset commented 5 years ago

I am new to sphinx with markdown as source file. When I am following the instruction in README one by one, it seems to be not working. The following are what I've encountered.

  1. Your package is named sphinx_markdown_parser, but the instruction states from recommonmark.parser import MarkdownParser.

  2. In order to use your package, I just copied all the files from sphinx_markdown_parser directory into recommonmark's to overwrite its original source files and add

    def setup(app):
       app.add_config_value('recommonmark_config', {
               'parser': 'Markdown'
               }, True)

    to conf.py but got an error stating like Source parser for markdown not registered.

  3. Finally, I tried to use source_parser (which has been marked deprecated since sphinx v1.8) in conf.py, but still got an error:

Exception occurred:
  File "c:\python37\lib\site-packages\recommonmark\markdown_parser.py", line 490, in visit_html
    self.current_node.append(raw)
AttributeError: 'Text' object has no attribute 'append'
clayrisser commented 5 years ago

Look at the example

https://github.com/codejamninja/sphinx-markdown-parser/blob/master/examples/javascript/docs/conf.py

clayrisser commented 5 years ago

@idnsunset can you send me a link to your setup?

clayrisser commented 5 years ago

I updated the setup documentation. You can also refer to the setup in this file.

https://github.com/codejamninja/sphinx-markdown-parser/blob/master/examples/javascript/docs/conf.py