5
5
import http
6
6
import subprocess
7
7
import signal
8
- import re
9
8
from datetime import date
10
9
from pathlib import Path
11
10
@@ -387,19 +386,6 @@ def create_element_page(self, element):
387
386
html_file .write (html_content )
388
387
389
388
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
403
389
404
390
def create_function_page (self , function ):
405
391
function_template = self .input_env .get_template ('function.html' )
@@ -417,7 +403,7 @@ def create_function_page(self, function):
417
403
418
404
def create_article_page (self , article ):
419
405
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" ])
421
407
html_content = self .render_page (article ['title' ], article_template .render (article = article ))
422
408
423
409
article_folder = OUTPUT_HTML_PATH + article ["path_html" ]
0 commit comments