How to preserve line breaks when generating python docs using sphinx

前端 未结 6 1674
被撕碎了的回忆
被撕碎了的回忆 2020-12-05 04:10

I am using Sphinx for generating docs for a python project. The output html is not preserving the line breaks which are present in the docstring. Example:

Code

6条回答
  •  时光取名叫无心
    2020-12-05 04:34

    In your case you can write:

    def testMethod(arg1,arg2):
      """
      This is a test method
    
      | Arguments:
      | arg1: arg1 description
      | arg2: arg2 description
    
      | Returns:
      | None
      """
      print "I am a test method"
    

提交回复
热议问题