Over the last few weeks I’ve been working on creating several Titanium modules. To make life easier for myself and my users I’m using html for all of my documentation. The current Titanium 1.8.X module build script doesn’t yet support html documentation., which isn’t a big deal since you can add it into the zip directly.
The below script adds support for html into the build script itself.
- Open your build.py script located in the root of your module project.
- Look for def generate_doc(config)
- Replace that code block with the one below.
def generate_doc(config): docdir = os.path.join(cwd,'documentation') if not os.path.exists(docdir): print "Couldn't find documentation file at: %s" % docdir return None sdk = find_sdk(config) support_dir = os.path.join(sdk,'module','support') sys.path.append(support_dir) try: import markdown2 as markdown except ImportError: import markdown documentation = [] for file in os.listdir(docdir): if file in ignoreFiles or os.path.isdir(os.path.join(docdir, file)): continue html = open(os.path.join(docdir,file)).read() if file.lower().endswith('.md'): html = markdown.markdown(html) else: documentation.append({file:html}); return documentation
This solution worked for me, hopefully it will work for you.