From 9f9667e258ba856aee4c512a3921de81eb8b43d5 Mon Sep 17 00:00:00 2001 From: "R. Kent James" Date: Fri, 22 Mar 2024 14:02:15 -0700 Subject: [PATCH 1/3] Allow running rosdoc2 as a module with installing --- rosdoc2/main.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rosdoc2/main.py b/rosdoc2/main.py index e793041..775f4c1 100644 --- a/rosdoc2/main.py +++ b/rosdoc2/main.py @@ -86,3 +86,6 @@ def main(sysargs=None): # Finally call the subparser's main function with the processed args # and the extras which the preprocessor may have returned sys.exit(args.main(args) or 0) + +if __name__ == '__main__': + main() From 1a2563172d54e81e1c520737c9409607c4a523e1 Mon Sep 17 00:00:00 2001 From: "R. Kent James" Date: Fri, 22 Mar 2024 14:10:09 -0700 Subject: [PATCH 2/3] Document how to run directly as a module --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 0955808..1d94431 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,12 @@ rosdoc2 open ./doc_output/index.html For more advanced usage see the documentation. +It may be helpful during rosdoc2 development to run a version of rosdoc2 without installing it. This can be done +(after doing an initial normal install to make sure prerequisites are available) by running, from the rosdoc2 main directory: +```bash +python3 -m rosdoc2.main +``` + ### Set up a ROS 2 package to be used with this tool In many cases, C/C++ packages require no configuration, and will work if you simply layout your package in a standard configuration and the tool will do the rest. From 07057f6fbda2813a8d9eeed856092a2bd2b86b8a Mon Sep 17 00:00:00 2001 From: "R. Kent James" Date: Fri, 22 Mar 2024 14:16:52 -0700 Subject: [PATCH 3/3] Add blank like to keep flake happy --- rosdoc2/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/rosdoc2/main.py b/rosdoc2/main.py index 775f4c1..a5ea53c 100644 --- a/rosdoc2/main.py +++ b/rosdoc2/main.py @@ -87,5 +87,6 @@ def main(sysargs=None): # and the extras which the preprocessor may have returned sys.exit(args.main(args) or 0) + if __name__ == '__main__': main()