pelican/bin/pelican
Alexis Metaireau c989db50c9 Refactoring, again.
Separate Generator and Processors. Place clear for upcoming changes about pages
only websites powered by pelican !
2010-11-05 00:22:03 +00:00

35 lines
1.5 KiB
Python
Executable file

#!/usr/bin/env python
import argparse
from pelican.utils import clean_output_dir
from pelican.generators import Generator
from pelican.processors import (ArticlesProcessor, PagesProcessor,
StaticProcessor)
parser = argparse.ArgumentParser(description="""A tool to generate a
static blog, with restructured text input files.""")
parser.add_argument(dest='path',
help='Path where to find the content files (default is "content").')
parser.add_argument('-t', '--theme-path', dest='theme',
help='Path where to find the theme templates. If not specified, it will'
'use the default one included with pelican.')
parser.add_argument('-o', '--output', dest='output',
help='Where to output the generated files. If not specified, a directory'
' will be created, named "output" in the current path.')
parser.add_argument('-m', '--markup', default='rst, md', dest='markup',
help='the markup language to use. Currently only ReSTreucturedtext is'
' available.')
parser.add_argument('-s', '--settings', dest='settings',
help='the settings of the application. Default to None.')
if __name__ == '__main__':
args = parser.parse_args()
markup = [a.split()[0] for a in args.markup.split(',')]
generator = Generator(args.settings, args.path, args.theme,
args.output, markup)
clean_output_dir(args.output)
generator.run([ArticlesProcessor, PagesProcessor, StaticProcessor])
print "Enjoy !"