Andy
Andy

Reputation: 1423

How to make Sphinx recognize the `:param` element?

I want to use Sphinx to generate html documents, and although I can generate them successfully, Sphinx does not recognize elements like :param content:.

Wrong document

Figure 1: Wrong document

Correct document

Figure 2: Correct document

Here you can see the specific code file, using . \make.bat html to generate the documentation: Shared/sphinx-document-generation at master - Andy-AO/Shared

After checking the documentation of the autodoc extension, I still can't find the relevant settings, maybe I'm missing something important.

Why is this happening? How can I get Sphinx to recognize these elements?

Upvotes: 2

Views: 721

Answers (1)

Andy
Andy

Reputation: 1423

Thank @mzjn, the problem has been solved, it is the format of reStructuredText is wrong.

  1. There should be a blank line between other content and Field lists

    ×

            """
            describe
                :param child_node: this is child_node
    

            """
            describe
    
            :param child_node: this is child_node
    
  2. There should be spaces between the Field and the content of the Field

    • × - :param content:the object to be added
    • √ - :param content: the object to be added

Upvotes: 1

Related Questions