ford.settings module

Contents

ford.settings module#

class ford.settings.EntitySettings(author=None, category=None, copy_subdir=<factory>, date=None, deprecated=False, display=<factory>, graph=False, graph_maxdepth=10000, graph_maxnodes=1000000000, license=None, num_lines=None, ordered_subpage=<factory>, proc_internals=False, since=None, source=False, summary=None, title=None, version=None)#

Bases: object

author: Optional[str] = None#
category: Optional[str] = None#
copy_subdir: List[Path]#
date: Optional[str] = None#
deprecated: bool = False#
display: List[str]#
classmethod from_markdown_metadata(meta, parent=None)#
classmethod from_project_settings(project_settings)#

Inherit entity-specific settings from project-level settings

graph: bool = False#
graph_maxdepth: int = 10000#
graph_maxnodes: int = 1000000000#
license: Optional[str] = None#
num_lines: Optional[int] = None#
ordered_subpage: List[str]#
proc_internals: bool = False#
since: Optional[str] = None#
source: bool = False#
summary: Optional[str] = None#
title: Optional[str] = None#
update(metadata, parent=None)#

Update self with values from a dict

Return type:

None

version: Optional[str] = None#
class ford.settings.ExtraFileType(extension, comment, lexer=None)#

Bases: object

comment: str#
extension: str#
classmethod from_string(string)#
lexer: Optional[str] = None#
class ford.settings.ProjectSettings(alias=<factory>, author=None, author_description=None, author_pic=None, bitbucket=None, coloured_edges=False, copy_subdir=<factory>, creation_date='%Y-%m-%dT%H:%M:%S.%f%z', css=None, dbg=True, display=<factory>, doc_license='', docmark='!', docmark_alt='*', email=None, encoding='utf-8', exclude=<factory>, exclude_dir=<factory>, extensions=<factory>, external=<factory>, externalize=False, extra_filetypes=<factory>, extra_mods=<factory>, extra_vartypes=<factory>, facebook=None, favicon=PosixPath('favicon.png'), fixed_extensions=<factory>, fixed_length_limit=True, force=False, fpp_extensions=<factory>, github=None, gitlab=None, gitter_sidecar=None, google_plus=None, graph=False, graph_dir=None, graph_maxdepth=10000, graph_maxnodes=1000000000, hide_undoc=False, incl_src=True, include=<factory>, license='', linkedin=None, lower=False, macro=<factory>, mathjax_config=None, max_frontpage_items=10, md_base_dir=PosixPath('.'), md_extensions=<factory>, media_dir=None, output_dir=PosixPath('doc'), page_dir=None, parallel=2, predocmark='>', predocmark_alt='|', preprocess=True, preprocessor='pcpp -D__GFORTRAN__ --passthru-comments', print_creation_date=False, privacy_policy_url=None, proc_internals=False, project='Fortran Program', project_bitbucket=None, project_download=None, project_github=None, project_gitlab=None, project_sourceforge=None, project_url='', project_website=None, quiet=False, revision=None, search=True, show_proc_parent=False, sort='src', source=False, src_dir=<factory>, summary=None, terms_of_service_url=None, twitter=None, version=None, warn=False, website=None, year='2024')#

Bases: object

alias: Dict[str, str]#
author: Optional[str] = None#
author_description: Optional[str] = None#
author_pic: Optional[str] = None#
bitbucket: Optional[str] = None#
coloured_edges: bool = False#
copy_subdir: List[Path]#
creation_date: str = '%Y-%m-%dT%H:%M:%S.%f%z'#
css: Optional[Path] = None#
dbg: bool = True#
display: List[str]#
doc_license: str = ''#
docmark: str = '!'#
docmark_alt: str = '*'#
email: Optional[str] = None#
encoding: str = 'utf-8'#
exclude: List[str]#
exclude_dir: List[Path]#
extensions: List[str]#
external: Dict[str, str]#
externalize: bool = False#
extra_filetypes: Dict[str, ExtraFileType]#
extra_mods: Dict[str, str]#
extra_vartypes: list#
facebook: Optional[str] = None#
favicon: Path = PosixPath('favicon.png')#
fixed_extensions: list#
fixed_length_limit: bool = True#
force: bool = False#
fpp_extensions: list#
classmethod from_markdown_metadata(meta, parent=None)#
github: Optional[str] = None#
gitlab: Optional[str] = None#
gitter_sidecar: Optional[str] = None#
google_plus: Optional[str] = None#
graph: bool = False#
graph_dir: Optional[Path] = None#
graph_maxdepth: int = 10000#
graph_maxnodes: int = 1000000000#
hide_undoc: bool = False#
incl_src: bool = True#
include: List[Path]#
license: str = ''#
linkedin: Optional[str] = None#
lower: bool = False#
macro: list#
mathjax_config: Optional[Path] = None#
max_frontpage_items: int = 10#
md_base_dir: Path = PosixPath('.')#
md_extensions: list#
media_dir: Optional[Path] = None#
normalise_paths(directory=None)#
output_dir: Path = PosixPath('doc')#
page_dir: Optional[Path] = None#
parallel: int = 2#
predocmark: str = '>'#
predocmark_alt: str = '|'#
preprocess: bool = True#
preprocessor: str = 'pcpp -D__GFORTRAN__ --passthru-comments'#
print_creation_date: bool = False#
privacy_policy_url: Optional[str] = None#
proc_internals: bool = False#
project: str = 'Fortran Program'#
project_bitbucket: Optional[str] = None#
project_download: Optional[str] = None#
project_github: Optional[str] = None#
project_gitlab: Optional[str] = None#
project_sourceforge: Optional[str] = None#
project_url: str = ''#
project_website: Optional[str] = None#
quiet: bool = False#
relative: bool#
revision: Optional[str] = None#
search: bool = True#
show_proc_parent: bool = False#
sort: str = 'src'#
source: bool = False#
src_dir: List[Path]#
summary: Optional[str] = None#
terms_of_service_url: Optional[str] = None#
twitter: Optional[str] = None#
version: Optional[str] = None#
warn: bool = False#
website: Optional[str] = None#
year: str = '2024'#
ford.settings.convert_setting(default_type, key, value)#

Convert an individual value’s type to be consistent with a given dataclass for the given key.

Return type:

Any

ford.settings.convert_to_bool(name, option)#

Convert value ‘option’ to a bool, with a nice error message on failure. Expects a list from the markdown meta-data extension

Return type:

bool

ford.settings.convert_types_from_commandarguments(settings, cargs, parent=None)#

Convert the cargs dict’s value’s types to be consistent with a given dataclass if set and override them in settings.

ford.settings.convert_types_from_metapreprocessor(cls, settings, parent=None)#

Convert a dict’s value’s types to be consistent with a given dataclass

ford.settings.default_cpus()#
Return type:

int

ford.settings.is_optional_type(tp, sub_tp)#

Returns True if tp is Optional[sub_tp]

Return type:

bool

ford.settings.is_same_type(type_in, tp)#

Returns True if type_in is the same type as either tp or Optional[tp]

Return type:

bool

ford.settings.load_markdown_settings(directory, project_file, filename=None)#
Return type:

Tuple[ProjectSettings, str]

ford.settings.load_toml_settings(directory)#

Load Ford settings from fpm.toml file in directory

Settings should be in [extra.ford] table

Return type:

Optional[ProjectSettings]