Skip to content

Missing Hook 'page:after' #724

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

Closed
rahul286 opened this issue Apr 25, 2015 · 3 comments
Closed

Missing Hook 'page:after' #724

rahul286 opened this issue Apr 25, 2015 · 3 comments

Comments

@rahul286
Copy link

We are using hook 'page:after' in our code for gitbook plugin - https://www.npmjs.com/package/gitbook-plugin-edit-link

It seems the hook we were using is removed.

Hook 'page:after' 'used by plugin 'gitbook-plugin-edit-link' has been removed or is deprecated

Sorry if I missed related announcement or documentation. Is this replaced by new hook?

I tried page:before and only page but both gave similar error. Can you please suggest alternative?

@leesei
Copy link

leesei commented Jul 10, 2015

Use template block tags, see #793.

@todvora
Copy link

todvora commented Jul 10, 2015

Hi @leesei ,
but what if you want to modify the page itself, without adding any tags? The edit-link plugin adds some navigation to the page layout. I am using this hook in plugin image-captions to add figcaption to the images. There is no need of any custom tag, just a possibility to modify already rendered page. Adding custom tag would mean unnecessary work for users without any real benefit.

Thanks, Tomas

@leesei
Copy link

leesei commented Jul 11, 2015

I see. I was answering generally to why the warning is shown and the official alternative, not to some specific use case.
I agree to your concern and that could be another issue discussing the merits of the change and whether template blocks can really replace page hooks. I also think the change was not properly announced and discussed among the community.

For the two mentioned plugins:
image-caption could be rewritten as template blocks.
I don't have a solution for edit-link, I have yet to look into GitBook 2.x source to look for alternatives.

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

No branches or pull requests

4 participants