Create ai file utils data model and helper script#7
Create ai file utils data model and helper script#7dawnkelly09 wants to merge 12 commits intostaging-ai-resources-pluginfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces the ai_file_utils plugin, a utility library for MkDocs that provides a standardized schema and API for defining and resolving actions related to AI artifacts in documentation sites. The plugin separates action definition from UI implementation, allowing other plugins to generate consistent action lists (e.g., "View Markdown", "Open in ChatGPT", etc.) for documentation pages.
Changes:
- Added a new plugin with schema-based action resolution supporting links, downloads, clipboard, and LLM integrations
- Implemented interpolation system for dynamic context variables (page URL, filename, content, prompts)
- Included comprehensive documentation and demonstration tests
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
pyproject.toml |
Registered the new ai_file_utils plugin entry point |
plugins/ai_file_utils/plugin.py |
Implemented plugin class with schema loading and action resolution logic |
plugins/ai_file_utils/ai_file_actions.json |
Defined schema for available actions with interpolation templates |
plugins/ai_file_utils/__init__.py |
Empty module initialization file (consistent with other plugins) |
tests/ai_file_utils/test_plugin.py |
Added demonstration test for the plugin's API usage |
docs/ai-file-utils.md |
Added comprehensive documentation explaining usage, schema, and extensibility |
README.md |
Added reference to the new plugin in the main documentation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
eshaben
left a comment
There was a problem hiding this comment.
Started to review this and then I realized what I thought was just going to be like a shared library is an actual plugin. Not sure it needs to be a plugin. Curious about what made you decide that it should be a plugin? And the factors that helped you make this decision
eshaben
left a comment
There was a problem hiding this comment.
Nice work! Looking good!
Co-authored-by: Erin Shaben <eshaben@icloud.com>
This pull request introduces the new
ai_file_utilsplugin, which provides a standardized utility and schema for defining and resolving actions related to AI artifacts in MkDocs-based documentation sites. The plugin enables other plugins to generate consistent action lists (such as "View Markdown", "Open in ChatGPT", etc.) for documentation pages, separating action definition from UI implementation. The update includes plugin registration, documentation, schema definition, implementation, and tests.Key changes:
Plugin Introduction and Integration
ai_file_utilsplugin, registered it inpyproject.toml, and documented its usage and purpose inREADME.md. The plugin is now available for use inmkdocs.ymlwithout additional configuration. [1] [2] [3]Plugin Implementation
AIFileUtilsPlugininplugins/ai_file_utils/plugin.py, which loads an actions schema fromai_file_actions.jsonand provides aresolve_actionsAPI to interpolate context variables (such as page URL, filename, and content) into action definitions.Action Schema Definition
plugins/ai_file_utils/ai_file_actions.json, defining a schema for available actions (e.g., "View Markdown", "Download Markdown", "Copy Markdown", "Open in ChatGPT", "Open in Claude"), including support for interpolation and prompt templates.Documentation
docs/ai-file-utils.md, explaining its purpose, usage, schema fields, interpolation variables, and how to extend it with new actions.Testing
tests/ai_file_utils/test_plugin.pyto demonstrate and verify the plugin's API, ensuring correct interpolation and action resolution for various action types.