def command_line_options(*args): """ Return the command line options for the moosedocs script. """ # Command-line options parser = argparse.ArgumentParser( description="Tool for building and developing MOOSE and " "MOOSE-based application documentation.") parser.add_argument('--verbose', '-v', action='store_true', help="Execute with verbose (debug) output.") subparser = parser.add_subparsers( title='Commands', dest='command', description="Documentation creation command to execute.") # Add the sub-commands check_parser = subparser.add_parser( 'check', help="Check that the documentation exists and is " "complete for your application and " "optionally generating missing markdown " "files.") commands.check_options(check_parser) build_parser = subparser.add_parser( 'build', help="Build the documentation for serving on " "another system.") commands.build_options(build_parser) latex_parser = subparser.add_parser( 'latex', help="Generate a .tex or .pdf document from a " "markdown file.") commands.latex_options(latex_parser) presentation_parser = subparser.add_parser( 'presentation', help="Convert a markdown file to " "an html presentation.") commands.presentation_options(presentation_parser) subparser.add_parser( 'test', help='Deprecated: use "~/projects/moose/python/run_tests -j8 ' '--re=MooseDocs"') subparser.add_parser('generate', help='Deprecated: use "check --generate"') subparser.add_parser('serve', help='Deprecated: use "build --serve"') return parser.parse_args(*args)
def command_line_options(): """ Return the command line options for the moosedocs script. """ # Command-line options parser = argparse.ArgumentParser(description="Tool for building and developing MOOSE and MOOSE-based application documentation.") parser.add_argument('--verbose', '-v', action='store_true', help="Execute with verbose (debug) output.") parser.add_argument('--config-file', type=str, default=os.path.join('moosedocs.yml'), help="The configuration file to use for building the documentation using MOOSE. (Default: %(default)s)") subparser = parser.add_subparsers(title='Commands', description="Documentation creation command to execute.", dest='command') # Add the sub-commands check_parser = subparser.add_parser('check', help="Perform error checking on documentation.") generate_parser = commands.generate_options(parser, subparser) serve_parser = commands.serve_options(parser, subparser) build_parser = commands.build_options(parser, subparser) latex_parser = commands.latex_options(parser, subparser) presentation_parser = commands.presentation_options(parser, subparser) # Both build and serve need config file for p in [serve_parser, build_parser]: p.add_argument('--theme', help="Build documentation using specified theme. The available themes are: cosmo, cyborg, readthedocs, yeti, journal, bootstrap, readable, united, simplex, flatly, spacelab, amelia, cerulean, slate, mkdocs") p.add_argument('--pages', default='pages.yml', help="YAML file containing the pages that are supplied to the mkdocs 'pages' configuration item. It also supports passing the name of a single markdown file, in this case only this file will be served with the 'Home' page.") p.add_argument('--page-keys', default=[], nargs='+', help='A list of top-level keys from the "pages" file to include. This is a tool to help speed up the serving for development of documentation.') # Parse the arguments options = parser.parse_args() # Set livereload default if options.command == 'serve' and not options.livereload: options.livereload = 'dirtyreload' return options
def command_line_options(*args): """ Return the command line options for the moosedocs script. """ # Command-line options parser = argparse.ArgumentParser(description="Tool for building and developing MOOSE and MOOSE-based application documentation.") parser.add_argument('--verbose', '-v', action='store_true', help="Execute with verbose (debug) output.") parser.add_argument('--config-file', type=str, default='moosedocs.yml', help="The configuration file to use for building the documentation using MOOSE. (Default: %(default)s)") subparser = parser.add_subparsers(title='Commands', description="Documentation creation command to execute.", dest='command') # Add the sub-commands test_parser = commands.test_options(parser, subparser) check_parser = commands.check_options(parser, subparser) generate_parser = commands.generate_options(parser, subparser) serve_parser = commands.serve_options(parser, subparser) build_parser = commands.build_options(parser, subparser) latex_parser = commands.latex_options(parser, subparser) presentation_parser = commands.presentation_options(parser, subparser) # Parse the arguments options = parser.parse_args(*args) return options
def command_line_options(): """ Return the command line options for the moosedocs script. """ # Command-line options parser = argparse.ArgumentParser(description="Tool for building and developing MOOSE and MOOSE-based application documentation.") parser.add_argument('--verbose', '-v', action='store_true', help="Execute with verbose (debug) output.") parser.add_argument('--config-file', type=str, default=os.path.join('moosedocs.yml'), help="The configuration file to use for building the documentation using MOOSE. (Default: %(default)s)") subparser = parser.add_subparsers(title='Commands', description="Documentation creation command to execute.", dest='command') # Add the sub-commands test_parser = commands.test_options(parser, subparser) check_parser = subparser.add_parser('check', help="Perform error checking on documentation.") generate_parser = commands.generate_options(parser, subparser) serve_parser = commands.serve_options(parser, subparser) build_parser = commands.build_options(parser, subparser) latex_parser = commands.latex_options(parser, subparser) presentation_parser = commands.presentation_options(parser, subparser) # Parse the arguments options = parser.parse_args() return options
def command_line_options(*args): """ Return the command line options for the moosedocs script. """ # Command-line options parser = argparse.ArgumentParser(description="Tool for building and developing MOOSE and " "MOOSE-based application documentation.") parser.add_argument('--verbose', '-v', action='store_true', help="Execute with verbose (debug) output.") subparser = parser.add_subparsers(title='Commands', dest='command', description="Documentation creation command to execute.") # Add the sub-commands check_parser = subparser.add_parser('check', help="Check that the documentation exists and is " "complete for your application and " "optionally generating missing markdown " "files.") commands.check_options(check_parser) build_parser = subparser.add_parser('build', help="Build the documentation for serving on " "another system.") commands.build_options(build_parser) latex_parser = subparser.add_parser('latex', help="Generate a .tex or .pdf document from a " "markdown file.") commands.latex_options(latex_parser) presentation_parser = subparser.add_parser('presentation', help="Convert a markdown file to " "an html presentation.") commands.presentation_options(presentation_parser) subparser.add_parser('test', help='Deprecated: use "~/projects/moose/python/run_tests -j8 ' '--re=MooseDocs"') subparser.add_parser('generate', help='Deprecated: use "check --generate"') subparser.add_parser('serve', help='Deprecated: use "build --serve"') return parser.parse_args(*args)
def command_line_options(): """ Return the command line options for the moosedocs script. """ # Command-line options parser = argparse.ArgumentParser( description= "Tool for building and developing MOOSE and MOOSE-based application documentation." ) parser.add_argument('--verbose', '-v', action='store_true', help="Execute with verbose (debug) output.") parser.add_argument( '--config-file', type=str, default=os.path.join('moosedocs.yml'), help= "The configuration file to use for building the documentation using MOOSE. (Default: %(default)s)" ) subparser = parser.add_subparsers( title='Commands', description="Documentation creation command to execute.", dest='command') # Add the sub-commands check_parser = subparser.add_parser( 'check', help="Perform error checking on documentation.") generate_parser = commands.generate_options(parser, subparser) serve_parser = commands.serve_options(parser, subparser) build_parser = commands.build_options(parser, subparser) latex_parser = commands.latex_options(parser, subparser) presentation_parser = commands.presentation_options(parser, subparser) # Both build and serve need config file for p in [serve_parser, build_parser]: p.add_argument( '--theme', help= "Build documentation using specified theme. The available themes are: cosmo, cyborg, readthedocs, yeti, journal, bootstrap, readable, united, simplex, flatly, spacelab, amelia, cerulean, slate, mkdocs" ) p.add_argument( '--pages', default='pages.yml', help= "YAML file containing the pages that are supplied to the mkdocs 'pages' configuration item. It also supports passing the name of a single markdown file, in this case only this file will be served with the 'Home' page." ) p.add_argument( '--page-keys', default=[], nargs='+', help= 'A list of top-level keys from the "pages" file to include. This is a tool to help speed up the serving for development of documentation.' ) # Parse the arguments options = parser.parse_args() # Set livereload default if options.command == 'serve' and not options.livereload: options.livereload = 'dirtyreload' return options