https://teibyexample.org/ https://en.wikipedia.org/wiki/Text_Encoding_Initiative
The whole set is enormous as it can encode all kinds of modern and ancient forms of literature with many kinds of annotations, even parallel versions of the same text as often happens with old works for which there is no known “original”. You can encode scribal variations etc.
There have been several attempts to create a simplified subset that would be useful for what we could call a normal modern book, but they haven’t got very far because it is still cumbersome and the tooling needed to work effectively with it is not freely available. I’m working on such tooling in my spare time, more focused on DocBook as the vast majority of what I write is technical documentation.
The simplified subset from TEI themselves is called TEI Lite: https://tei-c.org/guidelines/customization/lite/
If TEI sounds interesting to you, there is an application called TEI Publisher, Free Software under the GPLv3, that you might use: https://teipublisher.com/
Actually, looking at it again it now looks quite good. I’ll give it a try later.
Edit 24 minutes later: tried to install TEI Publisher, it works on top of the eXist XML DB, and after installing it, starting it gives me an “Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException”. Ah well...
Nowadays, I still write, and I use Markdown like you are "supposed to"… But it does never feel quite right.