Add initial implementation of the mkdocs-color-swatch-plugin #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new MkDocs plugin,
mkdocs-color-swatch-plugin
, which allows users to add inline color swatches to their Markdown documentation. The changes include the implementation of the plugin, its supporting assets, workflows for testing and publishing, and updates to documentation and configuration files.Plugin Implementation:
mkdocs_color_swatch_plugin/plugin.py
: Implements theColorSwatchPlugin
class, which integrates the plugin into MkDocs. It handles the injection of CSS and JavaScript assets and registers theColorSwatchExtension
for Markdown processing.mkdocs_color_swatch_plugin/color_swatch.py
: Defines theColorSwatchExtension
andColorSwatchInlineProcessor
to parse and render custom Markdown syntax for color swatches.Supporting Assets:
mkdocs_color_swatch_plugin/assets/color-swatch.css
): Provides styles for the color swatches, including hover animations and tooltips.mkdocs_color_swatch_plugin/assets/color-swatch.js
): Adds interactivity for copying color codes to the clipboard and displaying toast notifications.Workflow and Configuration:
.github/workflows
):build.yml
: Automates the build, test, and publish process for the plugin.test.yml
: Runs tests using pytest on pull requests and manual triggers.pyproject.toml
: Defines the project metadata, dependencies, and entry points for the plugin.mkdocs.yml
: Configures the demo site for the plugin.Documentation:
README.md
: Provides an overview of the plugin, including features, installation instructions, syntax usage, and contribution guidelines.docs/index.md
): Demonstrates the plugin's functionality with sample color swatches.