Skip to content

provides a flexible orderable plugins render_filename with entrypoints#59

Open
jpcw wants to merge 1 commit intocollective:masterfrom
jpcw:plugguable_render_filename
Open

provides a flexible orderable plugins render_filename with entrypoints#59
jpcw wants to merge 1 commit intocollective:masterfrom
jpcw:plugguable_render_filename

Conversation

@jpcw
Copy link
Copy Markdown
Member

@jpcw jpcw commented Nov 28, 2013

Flexible orderable plugin system with entrypoints to extend or override render_filename. Multi-registration available, specific target callable with -r, --rdr-fname-plugin-target cli option.
Long version here : https://github.com/jpcw/mr.bob/blob/03aecc4d16c54fa0964544a978128223d7d7d345/docs/source/pluginauthor.rst

@domenkozar
Copy link
Copy Markdown
Member

Is there a reason you didn't implement this as another hook? What is the different between a hook and a plugin?

@jpcw
Copy link
Copy Markdown
Member Author

jpcw commented Nov 29, 2013

the reason is there is
1 -> no pre_render_filename hook possibility today.
2 -> We need this feature, the possibility to skip or continue rendering filename after the hook.
My PR provide both, that said i can submit a pre_render_filename hook capability in c.render
But i think keeping registration of future pre_render_filename hook provide extensibilty flexibility.

behavior could be :
we had a pre_render_filename hook.
it return filename and skip boolean.

the lookup on hook could be in this order :

  • look in entry_points with order parameter (like plugin in this PR)
  • look in [re_render_filename] .ini which permit to load a pre-render class provided in specific need via .py in bobtemplate/something/hooks.py

It will be more flexible :

  • hook can be called via entry_point for any template if needed without specify it in .ini
  • overrided in a specific template via .ini

What do you think about this design ?

@gotcha
Copy link
Copy Markdown
Member

gotcha commented Jun 22, 2015

@domenkozar Should this be closed ?

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.

3 participants