Skip to content
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

Bug: Documentation for second level directories and their child dirs fails to link to source code #19

Closed
FredHappyface opened this issue Mar 14, 2022 · 4 comments
Labels
🐞 bug Something isn't working 🎉 fix released This issue has been addressed in the latest release 👋 response needed Awaiting for a response from a reporter

Comments

@FredHappyface
Copy link

Hi thanks for all your work on this

Describe the bug
When running the following for a complex lib, documentation for second level directories and their child dirs fails to link to source code

handsdown --source-code-path ../.. --cleanup

To Reproduce
Steps to reproduce the behavior:

  1. Create a python module such that my_module/__init__.py imports from my_module/foo/bar.py
  2. Run handsdown --source-code-path ../.. --cleanup
  3. Result: Viewing source code for my_module/foo/bar.py fails as the link is for ../../my_module/foo/bar.py rather than ../../../my_module/foo/bar.py

Expected behavior
Viewing source code for my_module/foo/bar.py succeeds as the link is ../../../my_module/foo/bar.py. I imagine the implementation for this would be similar to linking back to the root MODULES.md (../../MODULES.md#cli2gui-modules) This may change the path passed too as if the repo looks like

my_module/
docs/

Then it would make more sense to run handsdown --source-code-path .. --cleanup in place of handsdown --source-code-path ../.. --cleanup (if --source-code-path is specified the relative paths can be built similarly to how they are to link to MODULES.md)

Screenshots
If applicable, add screenshots to help explain your problem.

image

To clarify the screenshot:

  • the link points to docs/cli2gui/application/application.py
  • rather than cli2gui/application/application.py

Desktop:

  • OS: Windows 10 21h1
  • Python 3.10
  • Version 1.0.0

Additional context
I've included some of this above. Please let me know if you'd like anything clarifying - it's a little late so apologies if any of the above came out as utter nonsense

Thank you for your time :)

@FredHappyface FredHappyface added the 🐞 bug Something isn't working label Mar 14, 2022
@vemel
Copy link
Owner

vemel commented Mar 15, 2022

Thank you for the report, I will take a look.

@FredHappyface
Copy link
Author

Thanks :)

@vemel
Copy link
Owner

vemel commented Mar 18, 2022

Took me a while to come up with a proper fix, but I got back with good news. The new 1.1.0 release should calculate paths to source code automatically, so you do not have to pass --source-code-path CLI argument. You can still pass it to add a prefix to source code URLs.

Please let me know if the new version works for you as expected.

@vemel vemel added 🎉 fix released This issue has been addressed in the latest release 👋 response needed Awaiting for a response from a reporter labels Mar 18, 2022
FredHappyface added a commit to FHPythonUtils/FHMake that referenced this issue Mar 22, 2022
@FredHappyface
Copy link
Author

Hi thanks so much for the quick fix and apologies for the delay in getting back to you - busy weekend!

Works perfectly, thank you ♥

@vemel vemel closed this as completed Mar 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working 🎉 fix released This issue has been addressed in the latest release 👋 response needed Awaiting for a response from a reporter
Projects
None yet
Development

No branches or pull requests

2 participants