When I looked into CYOA, I opted for Ink. It's using a nice text-based language, a bit like markdown. It worked well for me, and I think it's a good option if you want to use a text editor.
Theoretically, epub format is ideal for a cyoa format book. Each choice at the end of the page can be a hyperlink to the next (internal) file, and the pages/files themselves could be marked non-linear (so that someone can't just page through to see all the pages).
Unfortunately, Apple and the others who have authored epub clients do not implement it correctly and behave as if non-linear pages are supposed to be some sort of footnote, and pop up models to display them, rather than just treating them as the reflowable content that they should be. Not marking them as non-linear is also problematic, because something about it seems off when you can just scrub through pages in linear order. It's unlikely to ever be fixed either, so the format itself is ruined for this purpose.
I've been tinkering on and off with a javascript hack that I hope would prevent swiping through files/chapters, but I could never get it to work right. There's not alot of documentation even saying what javascript is permitted in epub... there are a few of the Jackson Fighting Fantasy books that I'd like to convert and keep the hit points and dice rolls entirely within epub (I think CYOA had this as well with a "flip a coin and if it's heads turn to page X").
Ink looks iteresting! Twinery provides a nice visual editor for the passages and branches which I found appealing. Ultimately, I used Mermaid to create visual snapshots of the story which were useful when editing the physical book.
When I looked into CYOA, I opted for Ink. It's using a nice text-based language, a bit like markdown. It worked well for me, and I think it's a good option if you want to use a text editor.
I wrote about my experiments here: https://laurent.le-brun.eu/blog/my-adventures-with-narrative...