bookdown icon indicating copy to clipboard operation
bookdown copied to clipboard

Problems with `bookdown:::preview_book()` when a change is made to `README.md`

Open IndrajeetPatil opened this issue 3 years ago • 2 comments

If I am using bookdown:::preview_book() and make any change to README.md, rendering seems to go awry.

Two things happen:

  • Following new files are created: _main.html and _main.md

  • Rendering starts to fail with the following error:

<simpleError in xml_children(x)[[search]]: subscript out of bounds>

Is this expected behaviour?

IndrajeetPatil avatar Aug 20 '22 10:08 IndrajeetPatil

I don't think that is expected behavior. We should have a look a the watcher function which is supposed to update the preview. Maybe it is catching up on README.md where it should not as I believe not part of the book... 🤔

Also this is with bs4_book() right ?

It is possible that what I described above is true but never caused issue with gitbook() if the rendering function handled that better.

Just idea, I would need to create a dummy project to test this and dig into it. Are you interested in looking deeper and fix ? No problem if you're not, I'll do it when working on bookdown. Just if you do, that is helpful too ! 😉

cderv avatar Aug 26 '22 14:08 cderv

Sorry for the late response, @cderv.

Also this is with bs4_book() right ?

Yes, that is correct.

Are you interested in looking deeper and fix ?

Ideally, yes, but I am not sure if I can find time anytime soon. 😢 If I find time before you start working on bookdown again and manage to solve this, will definitely make a PR!

IndrajeetPatil avatar Sep 02 '22 14:09 IndrajeetPatil