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

Automate Menu Help Updates #2

Open
s4dhulabs opened this issue Oct 3, 2024 · 1 comment
Open

Automate Menu Help Updates #2

s4dhulabs opened this issue Oct 3, 2024 · 1 comment
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@s4dhulabs
Copy link
Owner

Description:
As the framework grows and gains complexity, it has become challenging to keep the menus updated. For instance, if a new command is added, the instructions on how to use it may take time to be updated, resulting in outdated help menus compared to the framework's resources. Currently, this is done in a very rudimentary way, requiring manual editing of several files and modules to work as expected.

Technical Details:
Implement a dynamic system to automatically update the help menus when new commands are added.
Use a configuration file or a centralized registry to store command descriptions. Modify the vmnf_helpers.py file to read from this configuration file or registry. Ensure that the help menu is generated dynamically based on the current commands and their descriptions.

Proposed Solution:
Command Metadata Annotations: Use decorators to annotate command functions with metadata, including descriptions. This metadata can be automatically extracted to update the help menus. Documentation Generation Tool: Integrate a documentation generation tool (e.g., Sphinx) to automatically generate and update help menus based on the codebase.
Database Integration: Store command descriptions in a database and create an API to fetch and update these descriptions dynamically.

Example of Command Metadata Annotations:

commands_registry = {}

def command(description):
    def decorator(func):
        commands_registry[func.__name__] = description
        return func
    return decorator

@command("Run a resource, plugin or case")
def run():
    pass

@command("Start Vimana in an interactive mode")
def start():
    pass

Benefits:

  • Reduces the risk of outdated help menus.
  • Simplifies the process of adding new commands.
  • Improves maintainability and scalability of the framework.
  • Provides a more robust and automated solution for managing command descriptions.

Future Considerations:

  • Explore integrating with a documentation generation tool like Sphinx.
  • Consider using a database to store command descriptions and create an API for dynamic updates.
@s4dhulabs s4dhulabs added documentation Improvements or additions to documentation enhancement New feature or request labels Oct 3, 2024
@s4dhulabs s4dhulabs self-assigned this Oct 3, 2024
@s4dhulabs
Copy link
Owner Author

Dynamic menu enhancements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant