Ejemplo n.º 1
0
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
Ejemplo n.º 2
0
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
Ejemplo n.º 3
0
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
Ejemplo n.º 4
0
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