New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get line number of classes and functions... #268
Comments
Would calling |
A yes Maybe i can add a PR here... But if this project doesn't need this information, it makes no sense isn't it? |
Using pdoc as a library is absolutely an intended use case. :) I've opened #269 with a possible API! 😃 |
The generated README is online here: https://github.com/boxine/bx_py_utils#existing-stuff Another problematic part is to get the relativ path of the source file. I made a helper for this here: But i think i missed something. Think pdoc should hold this path already, isn't it? |
|
No. With this I get the absolute file path. I need the relative path. |
https://docs.python.org/3/library/pathlib.html#pathlib.PurePath.relative_to should have you covered :) |
Yes, i use it in my solution, see above... The problem is: what's the base path of the project? |
I'm not quite sure I understand what you want to achieve with the base path of your Python module here. Let's assume you want to document url = f"https://github.com/boxine/bx_py_utils/blob/master/{ x.modulename.replace('.', '/') }.py#L4" Does that make sense? |
The original issue has been fixed, so I'm closing this here! 😃 |
I implement a README generate using pdoc here: boxine/bx_py_utils#76
Example result is currently: https://github.com/boxine/bx_py_utils/blob/auto-doc/README.md
The idea is to add links to the github code view page, e.g.:
https://github.com/boxine/bx_py_utils/blob/auto-doc/bx_py_utils/auto_doc.py#L18
But I can't find a way to get the line number of the functions and classes from pdoc.
In short i do:
In the end i process a list of
pdoc.doc.Class
andpdoc.doc.Function
instances.Is it possible to the the line numbers of these instances?!?
The text was updated successfully, but these errors were encountered: