Mercurial > piecrust2
comparison piecrust/commands/builtin/scaffolding.py @ 535:03c3a77fda60 2.0.0b2
prepare: More help about scaffolding.
| author | Ludovic Chabant <ludovic@chabant.com> |
|---|---|
| date | Wed, 29 Jul 2015 09:13:54 -0700 |
| parents | 5bbeb11fe8d9 |
| children | 87f1e79d3fbe |
comparison
equal
deleted
inserted
replaced
| 534:5bbeb11fe8d9 | 535:03c3a77fda60 |
|---|---|
| 51 help=("Creates an empty page in the '%s' source." % | 51 help=("Creates an empty page in the '%s' source." % |
| 52 src.name)) | 52 src.name)) |
| 53 src.setupPrepareParser(p, app) | 53 src.setupPrepareParser(p, app) |
| 54 p.add_argument('-t', '--template', default='default', | 54 p.add_argument('-t', '--template', default='default', |
| 55 help="The template to use, which will change the " | 55 help="The template to use, which will change the " |
| 56 "generated text and header.") | 56 "generated text and header. Run `chef help " |
| 57 "scaffolding` for more information.") | |
| 57 p.set_defaults(source=src) | 58 p.set_defaults(source=src) |
| 58 | 59 |
| 59 def run(self, ctx): | 60 def run(self, ctx): |
| 60 if not hasattr(ctx.args, 'source'): | 61 if not hasattr(ctx.args, 'source'): |
| 61 raise Exception("No source specified. " | 62 raise Exception("No source specified. " |
| 190 "PieCrust setup a page for you in the correct place, with " | 191 "PieCrust setup a page for you in the correct place, with " |
| 191 "some hopefully useful default text.") + | 192 "some hopefully useful default text.") + |
| 192 "\n\n" + | 193 "\n\n" + |
| 193 textwrap.fill("The following templates are available:") + | 194 textwrap.fill("The following templates are available:") + |
| 194 "\n\n" + | 195 "\n\n" + |
| 195 help_list) | 196 help_list + |
| 197 "\n" + | |
| 198 "You can add user-defined templates by creating pages in a " | |
| 199 "`scaffold/pages` sub-directory in your website.") | |
| 196 return help_txt | 200 return help_txt |
| 197 | 201 |
