Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_set_defaults(init_parser,init)
generaterst_parser = subparsers.add_parser("generate-rst", help=inspect.getdoc(generate_rst))
_add_common_args(generaterst_parser,'--project-root','--doc','--examples', '--overwrite')
generaterst_parser.add_argument('--project-name', type=str, help='name of project')
generaterst_parser.add_argument('--host',type=str,help='host to use when generating notebook links',default='GitHub')
generaterst_parser.add_argument('--org',type=str,help='github organization',default='')
generaterst_parser.add_argument('--repo',type=str,help='name of repo',default='')
generaterst_parser.add_argument('--branch',type=str,help='branch to point to in notebook links',default='master')
generaterst_parser.add_argument('--offset',type=int,help='number of cells to delete from top of notebooks',default=0)
generaterst_parser.add_argument('--nblink',type=str,help='where to place notebook links',choices=['bottom', 'top', 'both', 'none'], default='bottom')
generaterst_parser.add_argument('--skip',type=str,help='notebooks to skip running; comma separated case insensitive re to match',default='')
generaterst_parser.add_argument('--keep-numbers',action='store_true',help='whether to keep the leading numbers of notebook URLs and titles')
_set_defaults(generaterst_parser,generate_rst)
build_parser = subparsers.add_parser("build", help=inspect.getdoc(build))
build_parser.add_argument('--what',type=str,help='type of output to generate',default='html')
build_parser.add_argument('--output',type=str,help='where to place output',default="builtdocs")
_add_common_args(build_parser,'--project-root','--doc','--examples', '--overwrite')
build_parser.add_argument('--examples-assets',type=str,default="assets",
help='dir in which assets for examples are located - if relative, should be releative to project-root')
build_parser.add_argument('--clean-dry-run',action='store_true',help='whether to not actually delete files from output (useful for uploading)')
build_parser.add_argument('--inspect-links',action='store_true',help='whether to not to print all links')
_set_defaults(build_parser,build)
# add commands from pyct, for examples
try:
import pyct.cmd
pyct.cmd.add_commands(subparsers,'nbsite',cmds=None,args=args)
# pyct.cmd.add_version(parser, 'nbsite') # once pyct.cmd 0.5.0 lands
except ImportError:
pass