Thanks for the response. The more I research it, the more I come to realize that plain Markdown is probably the way to go.
I must have evaluated about 10 different Markdown editors so far though. Every one seems to be missing at least one key feature I need. I was getting quite frustrated.
But Typora looks fantastic! It hits on all the requirements (code fencing with syntax highlighting, tables, table of contents generation and internal hyperlinks that work in generated PDF's) that have been hard to come by. I've already started playing with it and I'm very impressed!
I really appreciate your answer, you actually made my day. And your JS book looks very well written. Very approachable and concise. Kudos!