(self, only_with_docstrings=True)
| 378 | return docs |
| 379 | |
| 380 | def create_method_markdown(self, only_with_docstrings=True): |
| 381 | method_docs = [] |
| 382 | if self.methods: |
| 383 | # reorder self.methods so __init__ comes first, if it isn't already |
| 384 | methods = self.methods[:] |
| 385 | for idx, meth in enumerate(self.methods): |
| 386 | if meth.name == "__init__": |
| 387 | if idx != 0: |
| 388 | methods.remove(meth) |
| 389 | methods.insert(0, meth) |
| 390 | break |
| 391 | |
| 392 | for item in methods: |
| 393 | if only_with_docstrings and not item.docstring: |
| 394 | continue |
| 395 | if not check_excluded(item.method_name) and not check_excluded( |
| 396 | item.name |
| 397 | ): |
| 398 | doc = item.create_markdown() |
| 399 | method_docs.append(doc) |
| 400 | |
| 401 | # join the methods into a single string |
| 402 | method_docs = "\n".join(method_docs) |
| 403 | return method_docs |
| 404 | |
| 405 | |
| 406 | # ---------------------------------------------------------------------------- |
no test coverage detected