Command Line Options#
As well as setting options in the project file, you can set or override all of them on the command line. This is useful for integrating Ford into a build system for setting preprocessor defines, include paths, or the version number, for example.
Added in version 7.0: The --config flag can be used to set any option. It takes a
TOML-formatted, semi-colon separated string, for example:
ford example-project-file.md --config="search=false; parallel=4"
ford - CLI interface#
Document a program or library written in modern Fortran. Any command-line options over-ride those specified in the project file.
ford [-h] [-d SRC_DIR] [-p PAGE_DIR] [-o OUTPUT_DIR] [-s CSS]
[-r REVISION] [--exclude EXCLUDE] [--exclude_dir EXCLUDE_DIR]
[-e EXTENSIONS] [-m MACRO] [-w] [-f] [-g] [--no-search] [-q] [-V]
[--debug] [-I INCLUDE] [--config CONFIG]
[--externalize | --no-externalize] [-L EXTERNAL]
project_file
ford positional arguments#
project_file- file containing the description and settings for the project
ford options#
-dSRC_DIR,--src_dirSRC_DIR- directories containing all source files for the project (default:./src)-pPAGE_DIR,--page_dirPAGE_DIR- directory containing static pages (default: None)-oOUTPUT_DIR,--output_dirOUTPUT_DIR- directory in which to place output files (default:./doc)-rREVISION,--revisionREVISION- source code version number or revision of the project to document--excludeEXCLUDE- list of files which should not be included in the documentation--exclude_dirEXCLUDE_DIR- list of directories whose contents should not be included in the documentation-eEXTENSIONS,--extensionsEXTENSIONS- extensions which should be scanned for documentation (default:f90, f95, f03, f08)-mMACRO,--macroMACRO- preprocessor macros (optionally with values) to be applied to preprocessed files-f,--force- try to continue to read files even if there are fatal errors--no-search- don’t process documentation to produce a search feature--debug- display traceback if fatal exception occurs and print faulty line-IINCLUDE,--includeINCLUDE- list of directories to be searched forincludefiles--configCONFIG- Any other FORD options as a semicolon-separated TOML string. Options set through this have lower precedence than other command line options
ford external projects#
--externalize- export information about Fortran objects to JSON file for other FORD projects to use (default: True)--no-externalize- don’t export information to JSON file-LEXTERNAL,--external_linksEXTERNAL-- external projects to link to.
If an entity is not found in the sources, FORD will try to look it up in those external projects. If those have documentation generated by FORD with the externalize option, a link will be placed into the documentation wherever this entity is referred to. FORD will look in the provided paths for a modules.json file.