55import http
66import subprocess
77import signal
8- import re
98from datetime import date
109from pathlib import Path
1110
@@ -387,19 +386,6 @@ def create_element_page(self, element):
387386 html_file .write (html_content )
388387
389388 self .logger .info (f"Generated { output_path } for element { element ['name' ]} " )
390-
391- def process_special_article_content (self , content ):
392- specials = re .findall (r'\{\{.*?\}\}' , content )
393- specials = [s [2 :- 2 ] for s in specials ]
394- for special in specials :
395- if special == 'elements_list' :
396- html_list = "<ul>"
397- for element in self .elements :
398- html_list += f"<li><a href='{ element ['path_html' ]} '>{ element ['name' ].capitalize ()} </a></li>"
399- html_list += "</ul>"
400- content = content .replace (f"{{{{elements_list}}}}" , html_list )
401-
402- return content
403389
404390 def create_function_page (self , function ):
405391 function_template = self .input_env .get_template ('function.html' )
@@ -417,7 +403,7 @@ def create_function_page(self, function):
417403
418404 def create_article_page (self , article ):
419405 article_template = self .input_env .get_template ('article.html' )
420- article ["content_html" ] = self . process_special_article_content ( article ["content_html" ])
406+ article ["content_html" ] = utils . replace_special_variables ( self , article ["content_html" ])
421407 html_content = self .render_page (article ['title' ], article_template .render (article = article ))
422408
423409 article_folder = OUTPUT_HTML_PATH + article ["path_html" ]
0 commit comments