2 # Copyright (C) 2012 W. Trevor King <wking@drexel.edu>
3 # Copyright (C) 2012 Sebastian Pipping <sebastian@pippin.org>
4 # Licensed under GPL v2 or later
6 # This script should be run from the root of the catalyst source.
8 from __future__ import print_function
12 _sys.path.insert(0, 'modules') # so we can find the `catalyst` module
18 if __name__ == '__main__':
19 extractor = re.compile('^modules/(([^ ]+)_target).py$')
20 for filename in sorted(glob.glob('modules/*_target.py')):
21 if 'generic' in filename:
24 match = extractor.match(filename)
25 target_name = match.group(2).replace('_', '-')
26 module_name = match.group(1)
28 __import__(module_name)
29 module = _sys.modules[module_name]
31 print('`%s`;;' % target_name)
32 # Replace blank lines with `+` (asciidoc list item continuation)
33 print(module.__doc__.strip().replace('\n\n', '\n+\n'))