@ -28,6 +28,7 @@ from .template_tools import (
file_raw ,
file_raw ,
time_iso8601 ,
time_iso8601 ,
)
)
from . utils import deep_merge_dicts
logger = logging . getLogger ( )
logger = logging . getLogger ( )
@ -97,27 +98,28 @@ def main() -> int:
" author " : " " ,
" author " : " " ,
" author_email " : " " ,
" author_email " : " " ,
}
}
for var in args . define :
if args . define :
default_metadata [ var [ 0 ] ] = var [ 1 ]
for var in args . define :
default_metadata [ var [ 0 ] ] = var [ 1 ]
meta_tree = MetaTree ( args . root , default_metadata )
meta_tree = MetaTree ( args . root , default_metadata )
file_list_cache = cast ( Dict , { } )
file_list_cache = cast ( Dict , { } )
file_cont_cache = cast ( Dict , { } )
file_cont_cache = cast ( Dict , { } )
file_name_cache = cast ( Dict , { } )
file_name_cache = cast ( Dict , { } )
file_raw_cache = cast ( Dict , { } )
file_raw_cache = cast ( Dict , { } )
file_json_cache = cast ( Dict , { } )
flist = file_list ( args . root , file_list_cache )
flist = file_list ( args . root , file_list_cache )
default_metadata [ " globals " ] = {
default_metadata [ " globals " ] = {
" get_file_list " : flist ,
" get_file_list " : flist ,
" get_hier " : file_list_hier ( args . root , flist ) ,
" get_hier " : file_list_hier ( args . root , flist ) ,
" get_file_name " : file_name ( args . root , meta_tree , process_chains , file_name_cache ) ,
" get_file_name " : file_name ( args . root , meta_tree , process_chains , file_name_cache ) ,
" get_file_content " : file_content ( args . root , meta_tree , process_chains , file_cont_cache ) ,
" get_file_content " : file_content ( args . root , meta_tree , process_chains , file_cont_cache ) ,
" get_json " : file_json ( args . root , file_json_cache ) ,
" get_json " : file_json ( args . root ) ,
" get_raw " : file_raw ( args . root , file_raw_cache ) ,
" get_raw " : file_raw ( args . root , file_raw_cache ) ,
" get_file_metadata " : file_metadata ( meta_tree ) ,
" get_file_metadata " : file_metadata ( meta_tree ) ,
" get_time_iso8601 " : time_iso8601 ( " UTC " ) ,
" get_time_iso8601 " : time_iso8601 ( " UTC " ) ,
" get_date_iso8601 " : date_iso8601 ( " UTC " ) ,
" get_date_iso8601 " : date_iso8601 ( " UTC " ) ,
" pygments_get_css " : pygments_get_css ,
" pygments_get_css " : pygments_get_css ,
" pygments_markup_contents_html " : pygments_markup_contents_html ,
" pygments_markup_contents_html " : pygments_markup_contents_html ,
" merge_dicts " : deep_merge_dicts ,
}
}
for root , _ , files in os . walk ( args . root , followlinks = args . follow_links ) :
for root , _ , files in os . walk ( args . root , followlinks = args . follow_links ) :