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

Adding directive plugins #196

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

pedrohdz
Copy link

@pedrohdz pedrohdz commented Aug 8, 2019

Hey all!
Before I proceed, please keep in mind that this is a proof of concept/work in progress. I would like to get general feedback before finishing up the code, adding tests (including fixing the existing tests), updating the documentation, and so on.

I just want to make sure I'm heading the the correct general direction first.

There are a couple of high level parts to this:

  1. Add the --directive-plugin|-D [DIRECTIVE_PLUGIN_MODULE] argument to the hovercraft command to make it easier to add third-party Docutils directives.
  2. Simplify/standardize adding builtin Docutil directives. Take a peek at hovercraft/directive/null.py in the PR.

I started implementing a PlantUML plugin which can be found at pedrohdz/muextensions. The documentation on how to use it with Hovercraft! is in the README. Here is the general idea:

python3.7 -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install muextensions \
    https://github.com/pedrohdz/hovercraft/archive/directives.zip
hovercraft --directive-plugin muextensions.contrib.hovercraft demo.rst

Please let me know what you all think. I can add the finishing touches if this is looking good so far, along with implementing any recommendations.

Thanks!

pedrohdz added a commit to pedrohdz/muextensions that referenced this pull request Aug 8, 2019
@@ -1,37 +1,223 @@

Copy link
Owner

Choose a reason for hiding this comment

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

The .gitignore should only contains things relevant to the project. Other things such as files specifically for your editor should be in your personal global gitignore.

@regebro
Copy link
Owner

regebro commented Sep 15, 2019

I like the idea of a plugin architecture, but so far you don't do anything but register the plugins, so you need to flesh this out a bit first before I can have an opinion.

@pedrohdz
Copy link
Author

Hey @regebro !
Thanks for taking a quick peek. Maybe I should not be using the work "plugin" at all here? :-)

The use case I am after here is the ability to register Docutil directives. As far as I can tell, thing we need to accomplishing this is registering the directive on start up. Are there other plugin points I missed?

I could use a different naming convention that does not include the name "plugin" not sure what that would be though. Open to suggestions. It is a "directive plugin" though.

Another option is generalizing the naming so it can be expanded to include other types of plugins in the future. If that is the goal, what other types of plugins are you envisioning, use cases, connection points?

Let me know! And thanks again!

@regebro
Copy link
Owner

regebro commented Oct 14, 2019

Yeah, calling it a plugin when you are only registering directives seems overkill. And you don't need to first register the plugin to later register the directive, I think, you could just register the directive directly.

I'll think about what other plugin points there could be. If I can't come up with anything we'll just add directives.

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