Plugins - #161
Open
stormdragon2976 wants to merge 8 commits into
Open
Plugins#161stormdragon2976 wants to merge 8 commits into
stormdragon2976 wants to merge 8 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 is a way for people to write and use plugins. Plugins are sourced into the program itself, so everything is available to them. the call to call_plugins could probably be added in a few more places, but this is a good starting point.
Plugins can be added in a subdirectory called plugins, or system wide in /usr/share/bashblog/plugins. I can write more information for the readme, but basically each of them can be in a file, and they are each written as a series of functions. For example, this plugin will show what you were listening to as you wrote the current post:
So, each plugin must start with the keyword plugin_ followed by where it's called, in this case pre_edit, and then should have a unique identifier, _composed. I think this will add a whole lot more flexibility to an already powerful system, and the lines of code it took to do it were minimal.