A way to generate documentation

Hello,

I am trying to generate documentation for my scripts and I wanted to use pdoc, pdoc3 and mkdocs. I have docstrings but the problem lies in

import orthanc

I know that python plugins are run by a separate interpreter that makes orthanc module available for import.

What I am trying to figure out is how could I use this interpreter with any of my doc tools?
I was trying with additional python scipts that would have subprocess using bash commands (with installed pdoc3 within the docker) but it did not work.

Could anybody perhaps have a clue or hint as to how could I generate documentation for all my scripts?

Thank you in advance

Hello

If you want to run a doc generation tool on your scripts that balks on the import orthanc execution, maybe you can instead do this:

try:
    import orthanc
except ImportError:
    orthanc = None

As long as you use orthanc only inside functions and that your doc generation tool only reads the function doc strings and does not execute them, you should be good to go.

Would that help?

Hello Bejamin,

I am surprised that I did not figure it out before. Such a simple solution that solves all my problems.

Problem solved.

Thank you so much! Have a great weekend.

1 Like