I wrote a bash script for generating manuals for GNU software in different formats a decade and a half back. The script made it's way into GNU texinfo, and has undergone several revisions since. It is still used in order to generate manuals for different software on https://www.gnu.org/software/