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

Custom Instance Representation #5

Open
ryneeverett opened this issue Dec 1, 2015 · 0 comments
Open

Custom Instance Representation #5

ryneeverett opened this issue Dec 1, 2015 · 0 comments
Milestone

Comments

@ryneeverett
Copy link
Owner

ryneeverett commented Dec 1, 2015

It would be nice if shortcodes could have a representation that indicates which instance they are.

  • Add a repr option to shortcodes that takes an unformatted string. E.g.:
#!python

@shortcodes.button(repr='A person named {entity}.')
  • Add a data-repr attribute to insert_shortcodes.js. The value should be the repr string after passing the instance as the "context" to str.format.
  • Add a data-repr attribute to shortcodes. The problem with this is keeping the instance repr's synchronized with the shortcode parameter. In my initial idea it is hardcoded at instance definition, which I would consider unacceptable.
  • Add a view to get the instance -> repr mapping. This will look a lot like render.py.
  • In plugin.js's render:
    • In init callback, call a view to get instance -> repr mapping.
    • Pass instance repr into render.
    • In render, Insert repr rather than displayname if defined.
@ryneeverett ryneeverett changed the title Custom Icon Representation Custom Instance Representation Sep 26, 2016
@ryneeverett ryneeverett added this to the v0.3.0 milestone Oct 9, 2016
ryneeverett added a commit that referenced this issue Oct 11, 2016
The less happening in the tinymce plugin the better because it's hard to
read, potentially fragile when upgrading tinymce, and not portable to
other content editors.

This also will make custom instance representations (#5) easier to
implement.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant