@@ -712,43 +712,6 @@ def render(self, markdown: str, force_rendering:bool=False) -> str:
712712 else :
713713 return error_message
714714
715- def _save_debug_file (self , page :Page ,
716- rendered_markdown :str ) -> str :
717- """
718- Saves a page to disk for debug/testing purposes,
719- with a reconstituted YAML front matter.
720-
721- Argument:
722- - page: the Page (page.markdown contains the old markdown)
723- - rendered_mardkown (the new markdown)
724-
725- Returns the saved document.
726- """
727- dest_file = os .path .join (self .rendered_macros_dir ,
728- page .file .src_path )
729- debug (f"Saving page '{ page .title } ' in destination file:" ,
730- dest_file )
731- # Create the subdirectory hierarchy if necessary
732- os .makedirs (os .path .dirname (dest_file ), exist_ok = True )
733- if page .meta :
734- # recreate the YAML header:
735- yaml_values = yaml .dump (dict (page .meta ),
736- default_flow_style = False , sort_keys = False )
737- document = '\n ' .join ([ '---' ,
738- YAML_HEADER_WARNING ,
739- yaml_values .strip (),
740- '---' ,
741- rendered_markdown
742- ])
743- else :
744- # re-generate the document with YAML header
745- document = rendered_markdown
746- # write on file:
747- debug ("Saved " )
748- with open (dest_file , 'w' ) as f :
749- f .write (document )
750- return document
751-
752715
753716 # ----------------------------------
754717 # Standard Hooks for a mkdocs plugin
@@ -989,11 +952,6 @@ def on_page_markdown(self, markdown, page:Page,
989952 for func in self .post_macro_functions :
990953 func (self )
991954
992- # save the rendered page, with its YAML header
993- if get_log_level ('DEBUG' ):
994- self ._save_debug_file (page ,
995- rendered_markdown = self .markdown )
996-
997955 return self .markdown
998956
999957 def on_post_build (self , config : config_options .Config ):
0 commit comments