# HG changeset patch # User Jeff Hammel # Date 1312225251 25200 # Node ID 665b2ae2ecc66df327583ca56e9ba1b46219e0d0 stub project for DocumentIt diff -r 000000000000 -r 665b2ae2ecc6 README.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/README.txt Mon Aug 01 12:00:51 2011 -0700 @@ -0,0 +1,4 @@ +DocumentIt +========== + +Mirror documentation to https://developer.mozilla.org/en/Mozmill diff -r 000000000000 -r 665b2ae2ecc6 document_it.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/document_it.py Mon Aug 01 12:00:51 2011 -0700 @@ -0,0 +1,61 @@ +#!/usr/bin/env python + +""" +update documentation for Mozmill +""" + +import os +import sys +import urllib2 +from optparse import OptionParser + +# necessary imports +try: + import markdown +except ImportError: + raise ImportError("markdown is not installed, run (e.g.):\neasy_install Markdown") + +DEST='http://developer.mozilla.org/' +DIR=os.path.dirname(os.path.abspath(__file__)) +README=['README.md', 'README.txt', 'README'] + +def find_readme(directory): + """find a README file in a directory""" + for name in README: + path = os.path.join(directory, name) + if os.path.exists(path): + return path + +def main(args=sys.argv[1:]): + + # parse command line options + usage = '%prog [options]' + parser = OptionParser(usage=usage, description=__doc__) + parser.add_option('-d', '--directory', dest='directory', + help='render the documentation to this directory') + parser.add_option('-p', '--package', dest='packages', + action='append', + help='package to operate on') + parser.add_option('--list', dest='list', action='store_true', + help="list packages") + options, args = parser.parse_args(args) + + # find packages + packages = options.__dict__.pop('packages') + if not packages: + packages = [i for i in os.listdir(DIR) + if os.path.isdir(os.path.join(DIR, i)) + and find_readme(os.path.join(DIR, i))] + if options.list: + for i in packages: + print i + + # run setup_development.py in this directory + # to ensure documentation is up to date + # TODO; as yet unneeded + + # render and upload READMEs + # TODO + +if __name__ == '__main__': + main() diff -r 000000000000 -r 665b2ae2ecc6 setup.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/setup.py Mon Aug 01 12:00:51 2011 -0700 @@ -0,0 +1,35 @@ +import os +from setuptools import setup + +try: + here = os.path.dirname(os.path.abspath(__file__)) + description = file(os.path.join(here, 'README.txt')).read() +except IOError: + description = None + +version = '0.0' + +deps = [] + +setup(name='document_it', + version=version, + description="mirror text documentation to MDN", + long_description=description, + classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers + keywords='mozilla', + author='Jeff Hammel', + author_email='jhammel@mozilla.com', + url='http://k0s.org/mozilla/hg/DocumentIt', + license='MPL', + py_modules=['document_it'], + packages=[], + include_package_data=True, + zip_safe=False, + install_requires=deps, + entry_points=""" + # -*- Entry points: -*- + [console_scripts] + document_it = document_it:main + """, + ) +