@@ -144,7 +144,6 @@ def on_config(self, config: config_options.Config, **kwargs) -> Dict[str, Any]:
144144
145145 return config
146146
147-
148147 def parallel_compute_commit_timestamps (self , files , original_source : Optional [Dict ] = None , is_first_commit = False ):
149148 pool = multiprocessing .Pool (processes = min (10 , multiprocessing .cpu_count ()))
150149 results = []
@@ -154,9 +153,7 @@ def parallel_compute_commit_timestamps(self, files, original_source: Optional[Di
154153 # Support plugins like monorep that might have moved the files from the original source that is under git
155154 if original_source and abs_src_path in original_source :
156155 abs_src_path = original_source [abs_src_path ]
157- result = pool .apply_async (
158- self .util .get_git_commit_timestamp , args = (abs_src_path , is_first_commit )
159- )
156+ result = pool .apply_async (self .util .get_git_commit_timestamp , args = (abs_src_path , is_first_commit ))
160157 results .append ((abs_src_path , result ))
161158 pool .close ()
162159 pool .join ()
@@ -173,10 +170,10 @@ def on_files(self, files: Files, config: MkDocsConfig):
173170 """
174171 if not self .config .get ("enabled" ) or not self .config .get ("enable_parallel_processing" ):
175172 return
176-
173+
177174 # Support monorepo/techdocs, which copies the docs_dir to a temporary directory
178- if "monorepo" in config .get (' plugins' , {}):
179- original_source = config .get (' plugins' ).get (' monorepo' ).merger .files_source_dir
175+ if "monorepo" in config .get (" plugins" , {}):
176+ original_source = config .get (" plugins" ).get (" monorepo" ).merger .files_source_dir
180177 else :
181178 original_source = None
182179
@@ -185,7 +182,6 @@ def on_files(self, files: Files, config: MkDocsConfig):
185182 if not self .created_commits :
186183 self .parallel_compute_commit_timestamps (files = files , original_source = original_source , is_first_commit = True )
187184
188-
189185 def on_page_markdown (self , markdown : str , page : Page , config : config_options .Config , files , ** kwargs ) -> str :
190186 """
191187 Replace jinja2 tags in markdown and templates with the localized dates.
@@ -240,7 +236,9 @@ def on_page_markdown(self, markdown: str, page: Page, config: config_options.Con
240236 if getattr (page .file , "generated_by" , None ):
241237 last_revision_hash , last_revision_timestamp = "" , int (time .time ())
242238 else :
243- last_revision_hash , last_revision_timestamp = self .last_revision_commits .get (page .file .abs_src_path , (None , None ))
239+ last_revision_hash , last_revision_timestamp = self .last_revision_commits .get (
240+ page .file .abs_src_path , (None , None )
241+ )
244242 if last_revision_timestamp is None :
245243 last_revision_hash , last_revision_timestamp = self .util .get_git_commit_timestamp (
246244 path = page .file .abs_src_path ,
@@ -314,8 +312,10 @@ def on_page_markdown(self, markdown: str, page: Page, config: config_options.Con
314312 if getattr (page .file , "generated_by" , None ):
315313 first_revision_hash , first_revision_timestamp = "" , int (time .time ())
316314 else :
317- first_revision_hash , first_revision_timestamp = self .created_commits .get (page .file .abs_src_path , (None , None ))
318- if first_revision_timestamp is None :
315+ first_revision_hash , first_revision_timestamp = self .created_commits .get (
316+ page .file .abs_src_path , (None , None )
317+ )
318+ if first_revision_timestamp is None :
319319 first_revision_hash , first_revision_timestamp = self .util .get_git_commit_timestamp (
320320 path = page .file .abs_src_path ,
321321 is_first_commit = True ,
0 commit comments