@@ -153,18 +153,26 @@ def _render_dot_image(
153153 fname = f"graphtik-{ hasher .hexdigest ()} .{ img_format } "
154154 abs_fpath = Path (self .outdir , self .imagedir , fname )
155155
156- ## Don not re-write images, that have content-named path,
156+ ## Do not re-write images, that have content-named path,
157157 # so they are never out-of-date.
158158 #
159159 self .env .graphtik_image_purgatory .register_doc_fpath (
160160 self .env .docname , abs_fpath
161161 )
162+ if self .config .graphtik_save_dot_files :
163+ self .env .graphtik_image_purgatory .register_doc_fpath (
164+ self .env .docname , abs_fpath .with_suffix (".txt" )
165+ )
166+
162167 if not abs_fpath .is_file ():
163168 abs_fpath .parent .mkdir (parents = True , exist_ok = True )
164169 dot .write (abs_fpath , format = img_format )
165170 if img_format == "png" :
166171 cmap = dot .create (format = "cmapx" , encoding = "utf-8" ).decode ("utf-8" )
167172 node .cmap = cmap
173+ if self .config .graphtik_save_dot_files :
174+ with open (abs_fpath .with_suffix (".txt" ), "w" ) as f :
175+ f .write (str (dot ))
168176
169177 ## XXX: used to work till active-builder attributes were transfered to self.
170178 # rel_fpath = Path(self.imgpath, fname)
0 commit comments