mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Refactoring, Again :)
Added some more notes about how this is working on the documentation. I do think that the overall structure is clearer now, and easiest to understand. After all, that's how it should always be ! --HG-- rename : pelican/processors.py => pelican/generators.py rename : pelican/generators.py => pelican/writers.py
This commit is contained in:
parent
3b7c546136
commit
836d4ea117
12 changed files with 474 additions and 345 deletions
39
bin/pelican
39
bin/pelican
|
|
@ -1,38 +1,3 @@
|
|||
#!/usr/bin/env python
|
||||
import argparse
|
||||
|
||||
from pelican.generators import Generator
|
||||
from pelican.processors import (ArticlesProcessor, PagesProcessor,
|
||||
StaticProcessor, PdfProcessor)
|
||||
|
||||
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')
|
||||
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)
|
||||
|
||||
processors = [ArticlesProcessor, PagesProcessor, StaticProcessor]
|
||||
if generator.settings['PDF_PROCESSOR']:
|
||||
processors.append(PdfProcessor)
|
||||
|
||||
generator.run(processors)
|
||||
print "Enjoy !"
|
||||
from pelican import main
|
||||
main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue