So, LaTeX was not considered?
It is nicely editable in text editors, versionable with git, has CLI tools, has templates that can be used as-is or customized to the gills.
To top it off, it has 30 years of development and packages at its dispsosal that can solve almost every need that arises.