NiklasRosenstein / pydoc-markdown

Create Python API documentation in Markdown format.
http://niklasrosenstein.github.io/pydoc-markdown/
Other
453 stars 102 forks source link

How to igonre module imports #269

Closed nrbnlulu closed 2 years ago

nrbnlulu commented 2 years ago

Discussed in https://github.com/NiklasRosenstein/pydoc-markdown/discussions/263

Originally posted by **nrbnlulu** May 26, 2022 Currently generating docs for one module like this ```py context = Context(directory=root_dir) loader = PythonLoader(search_path=['gqlauth'], modules=['decorators']) renderer = MarkdownRenderer(render_module_header=False,) loader.init(context) renderer.init(context) header = """ # Decorates --- """ modules = loader.load() with open(root_dir / 'docs' / 'decorators.md', 'w+') as f: f.write(header + renderer.render_to_string(modules)) ``` this is the result: ![image](https://user-images.githubusercontent.com/88795475/170564425-12fcadb8-2219-4da0-ae8b-0d8461ca1460.png) I want only the functions or classes how can I remove the import statements?
NiklasRosenstein commented 2 years ago

Closing in favour of the discussion.