Content Extraction

In addition to snippets manipulation that is applicable to any language, Znai can extract content of methods. Head over to Python Content Extraction to learn more :include-python: python/example.py {entry: "Animal.says", bodyOnly: true} print("hello") class Animal: """ animal top level class doc string ``` code block ``` """ def says(self): """ animal **talks** `code` """ print("hello")

Description Extraction

Znai provides plugin to extract PyDoc content. Use it to extract high level description and merge it with the rest of the documentation. Convert method parameters into API Parameters Head over to Python Description Extraction to learn more :include-python-doc-params: python/pydoc-params.py {entry: "my_func", title: "result and parameters"} text inside my *func* doc * list one * list two Parameters ---------- label : str label to use to *render* item in the store price : fin.money.Money price associated with the **item** Returns ------- str status of the operation `OK` for good def my_func(label, price): """ text inside my *func* doc * list one * list two Parameters ---------- label : str label to use to *render* item in the store price : fin.money.Money price associated with the **item** Returns ------- str status of the operation `OK` for good """ return "OK"

Auto Reference

Znai provides plugins to automatically create reference documentation for methods and classes. Head over to Python Auto Reference to learn more :include-python-method: fin.money.render_money render_money render money to a string returns str money represented as text amount fin.money.Money amount to print message str message to use for audit def render_money(amount: Money, message: str = "") -> str: """ render money to a string Parameters -------------- amount: amount to print message: message to use for audit Returns ------- money represented as text """ return f"{message} {amount.amount} {amount.currency}"