MCPcopy Create free account
hub / github.com/NanoComp/meep / create_method_markdown

Method create_method_markdown

doc/generate_py_api.py:380–403  ·  view source on GitHub ↗
(self, only_with_docstrings=True)

Source from the content-addressed store, hash-verified

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# ----------------------------------------------------------------------------

Callers 1

create_markdownMethod · 0.95

Calls 3

check_excludedFunction · 0.85
removeMethod · 0.45
create_markdownMethod · 0.45

Tested by

no test coverage detected