In a previous post I showed how Google Apps Script could return the contents of a script as Json so you could format that for including script samples on web sites.
Today, here is how to use the html service to format that code. It takes arguments of ?module=xxx&template=yyy and will use html template yyy, to publish module xxx.
Here is Google Apps Script, using the html service to publish script code. eg http://bit.ly/YRcqIS