default=defaultmantidpath,
                        help="Full path to the Mantid compiled binary folder. Default: '%s'. This will be saved to an .ini file" % defaultmantidpath)
    parser.add_argument('-o', '--output', dest='helpoutdir',
                        help="Full path to where the output files should go.")

    args = parser.parse_args()

    # where to put the generated files
    helpsrcdir = os.path.dirname(os.path.abspath(__file__))
    if args.helpoutdir is not None:
        helpoutdir = os.path.abspath(args.helpoutdir)
    else:
        helpoutdir = os.path.join(helpsrcdir, OUTPUTDIR)
    print "Writing algorithm web pages to '%s'" % helpoutdir
    if not os.path.exists(helpoutdir):
        os.makedirs(helpoutdir)
    addWikiDir(helpsrcdir)

    # initialize mantid
    if not args.mantidpath.endswith("bin"):
        args.mantidpath = os.path.join(args.mantidpath, "bin")
    sys.path.append(args.mantidpath)
    import mantid.api
    algos = mantid.api.AlgorithmFactory.getRegisteredAlgorithms(True)

    # setup the qhp file
    qhp = QHPFile("org.mantidproject.algorithms")

    process(algos, qhp, helpoutdir)
    qhp.write(os.path.join(helpoutdir, "algorithms.qhp"))
        % defaultmantidpath,
    )
    parser.add_argument("-o", "--output", dest="helpoutdir", help="Full path to where the output files should go.")

    args = parser.parse_args()

    # where to put the generated files
    helpsrcdir = os.path.dirname(os.path.abspath(__file__))
    if args.helpoutdir is not None:
        helpoutdir = os.path.abspath(args.helpoutdir)
    else:
        helpoutdir = os.path.join(helpsrcdir, OUTPUTDIR)
    print "Writing fit function web pages to '%s'" % helpoutdir
    if not os.path.exists(helpoutdir):
        os.makedirs(helpoutdir)
    addWikiDir(helpsrcdir)

    # initialize mantid
    import wiki_tools

    wiki_tools.initialize_Mantid(args.mantidpath)
    import mantid.api

    functions = mantid.api.FunctionFactory.getFunctionNames()

    # setup the qhp file
    qhp = QHPFile("org.mantidproject.fitfunctions")

    process(functions, qhp, helpoutdir)
    qhp.write(os.path.join(helpoutdir, "fitfunctions.qhp"))