Are you asking for a way to automatically convert plain text source code into html code that formats/displays the various commands, parameters and comments differently?
Example: https://www.b4x.com/js/ Prism is a popular JavaScript text highlighter: https://prismjs.com/index.html It is the same library that is installed in the forum and highlights the code. The B4X rules and a modified CSS file are attached. Note that it is not 100% perfect due to it being a...