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

add api-path to project configuration #112

Merged
merged 4 commits into from
Nov 22, 2024

Conversation

dustinlagoy
Copy link

@dustinlagoy dustinlagoy commented Jul 30, 2024

First, thanks for this very helpful MkDocs plugin!

We have been using it for including our C++ code documentation which has been working well but is missing a useful feature. We generally put auto-generated code documentation in a sub-path of our main documentation to keep it organized, but MkDoxy currently always uses the project name as the output path.

To enable customizing the output path I made api-path a MkDoxy configurable setting.

I am also using the src-dirs as part of the generated API path but that could be removed. Some other options that could work is instead of:

apiPath = os.path.join(
    project_data.get("api-path", "."), project_data.get("src-dirs")
)

are either:

apiPath = os.path.join(project_data.get("api-path", "."), project_name)

or:

apiPath = project_data.get("api-path", project_name)

and assume the user will put the full path for each project in the api-path configuration setting if they want to override the default.

Any of these would work for us. Is there any interest in merging this feature?

Summary by Sourcery

This pull request adds a new 'api-path' configuration setting to the MkDoxy plugin, enabling users to customize the output path for auto-generated code documentation. The API path generation logic has been enhanced to incorporate this new setting along with 'src-dirs' for improved documentation organization.

  • New Features:
    • Introduced a new configurable setting 'api-path' in MkDoxy to allow customization of the output path for auto-generated code documentation.
  • Enhancements:
    • Updated the API path generation logic to use the new 'api-path' setting combined with 'src-dirs' for better organization of generated documentation.

The output api path is now configurable as a part of the project. It
also uses the "src-dirs" as a subpath instead of just the project name.
Copy link

sourcery-ai bot commented Jul 30, 2024

Reviewer's Guide by Sourcery

This pull request introduces a new configuration option 'api-path' to the MkDoxy plugin, allowing users to customize the output path for generated API documentation. The 'apiPath' assignment in the code has been updated to use this new setting along with 'src-dirs' from the project data.

File-Level Changes

Files Changes
mkdoxy/plugin.py Introduced a new configuration option 'api-path' to allow customization of the output path for generated API documentation. Updated the 'apiPath' assignment logic to incorporate this new setting.

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @dustinlagoy - I've reviewed your changes - here's some feedback:

Overall Comments:

  • The feature to customize the API output path is a good addition. However, consider simplifying the implementation by using apiPath = project_data.get("api-path", project_name). This approach provides flexibility for users while maintaining a clear default behavior.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

@JakubAndrysek JakubAndrysek merged commit db75455 into JakubAndrysek:main Nov 22, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants