todvora / gitbook-plugin-image-captions

Image captions plugin for GitBook
Apache License 2.0
44 stars 18 forks source link

Add support for Gitbook 3 #8

Closed piranna closed 8 years ago

piranna commented 8 years ago

On gitbook v3.0.0-pre1 they have changed the API, so now the plugin totally crash. Please update it to add support for upcoming versions.

todvora commented 8 years ago

Hi @piranna, Thanks for the heads up. I'll try to make it compatible as soon, as possible.

Best regards, Tomas

piranna commented 8 years ago

You are welcome :-) @sammypesse has told me today that he will add a "legacy plugins" mode, but it will be good to have native support :-) El 29/2/2016 0:37, "Tomas Dvorak" notifications@github.com escribió:

Hi @piranna https://github.com/piranna, Thanks for the heads up. I'll try to make it compatible as soon, as possible.

Best regards, Tomas

— Reply to this email directly or view it on GitHub https://github.com/todvora/gitbook-plugin-image-captions/issues/8#issuecomment-189941401 .

todvora commented 8 years ago
piranna commented 8 years ago

:+1:

SamyPesse commented 8 years ago

@todvora I was going to post an issue about this :) (thanks @piranna )

With GitBook v3, I've improved the documentation for plugins, I've also started a section about gitbook-tester.

Let me know if some informations are missing to bring compatibility with GitBook v3

piranna commented 8 years ago

@todvora I was going to post an issue about this :) (thanks @piranna )

You are welcome :-) I'm writting my thesis with GitBook, so I'm the first one interested on having it correctly working :-D

I've also started a section about gitbook-tester.

That's awesome! This way I could easily test my plugin! :-D

todvora commented 8 years ago

Hi @piranna and @SamyPesse, Thanks for all the information and enhanced documentation. This plugin is since release 0.4.0 compatible with Gitbook 2.X and 3.0.0-pre.9.

I am currently missing a page->html function like gitbook.parsePage in 2.X releases. The 3.x compatibility of image-captions is based on parsing raw markdown content, which is probably not the best solution. It would be cool, if we had some simple possibility to get rendered html of pages.

Best regards, Tomas

SamyPesse commented 8 years ago

Hi @todvora

I'm currently working on GitBook v3, let me which API for plugins you'll need and I can implement it for the next release.

todvora commented 8 years ago

Pefect, thank you! I'm digging through the sources of Gitbook and give you know, what could be handy for me.

One particular thing, which could be improved - speed of the build. In 3.X, comparable builds are about 3 times slower than in 2.X releases:

SamyPesse commented 8 years ago

If you are digging thought the sources, take a look at https://github.com/GitbookIO/gitbook/tree/fixes

It's a rewrite with immutable models and a cleaner api.

I'll take a look at speed of builds.

cycomachead commented 8 years ago

Things seem currently broken with 3.0.0-pre.12? It seems like changes in pre.10 lead to this error, though I haven't had a chance to experiment further.

TypeError: Cannot read property 'walk' of undefined
TypeError: Cannot read property 'walk' of undefined
    at ImageCaptions3.readAllImages (/Volumes/Michael/Users/Michael/Dropbox/Projects/thesis/node_modules/gitbook-plugin-image-captions/src/lib/ImageCaptions3.js:28:15)

I also had a problem with the version check in index.js receiving * as the version, causing the semver check to error. (I temporarily hacked around that one...)

todvora commented 8 years ago

I also had a problem with the version check in index.js receiving * as the version, causing the semver check to error.

This one is already fixed. There has been a change in Gitbook config structure, that holds Gitbook version number.

The walk issue is fixed too. So maybe we can close this issue?

SamyPesse commented 8 years ago

@todvora when do you expect to release the latest fixes?

todvora commented 8 years ago

@SamyPesse Hopefully this week. I need to resolve https://github.com/todvora/gitbook-plugin-image-captions/issues/9 and find some way, how to keep tests compatible with version 2.x and 3.x of Gitbook (mainly due to changes in levels indexing).

todvora commented 8 years ago

Just released 0.4.1 with full support of gitbook@3.0. Closing this issue now, feel free to reopen it or create a new one, if there is something left to fix.

Thanks everyone for your comments, support and hard work!