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

Add a couple of hooks #21

Open
certainlyakey opened this issue Jun 1, 2017 · 2 comments
Open

Add a couple of hooks #21

certainlyakey opened this issue Jun 1, 2017 · 2 comments

Comments

@certainlyakey
Copy link

Thanks for the great plugin!

I understand that you want to keep the plugin simple but maybe from developer's point of view it would be really useful if we could have a couple of hooks available for this plugin:

  1. one that would allow to modify the detected pre/code tags content (for example, wrap them in another tag or do search/replace operations);
  2. another that would allow to change the prettyprinted class to something other.
@kasparsd
Copy link
Owner

kasparsd commented Jun 1, 2017

Thanks for the suggestions @certainlyakey! I'm happy to add any hooks that you would find useful.

allow to modify the detected pre/code tags content

I'm not sure if the Prettify library supports that. Can you please look into that?

allow to change the prettyprinted class to something other.

The only issue with that is the CSS styles that come with this plugin -- they would stop working, I think. Secondly, I'm not sure if Prettify supports that.

@certainlyakey
Copy link
Author

certainlyakey commented Jun 1, 2017

Thanks for the reply @kasparsd! I see now that I was a bit too fast to submit an issue.

  1. Actually it seems we can use the Google's prettify's Javascript callback via script URL argument — and the script URL is already conveniently passed through a filter so this one should not be any problem.
  2. Here the prettyprinted class that the plugin adds into WP output has confused me — in the Google's code-prettify docs it's said that the class will be prettyprint so I've thought that you change it somewhere. And it seems that the class is hardcoded, so no way around that, even though I still don't understand about the varying classes names thingie.
    Regarding the CSS styles — it seems they make no use of the prettyprinted/prettyprint class name, so this would not become a trouble probably.

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

2 participants