Skip to content

Commit 2f66eb9

Browse files
Fix articles
1 parent 7935db5 commit 2f66eb9

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

articles/hardcoded/element/article.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
An **element** is a generic class that can represent almost all in-game entities. The built-in element types are:
44

5-
$$special:elements_list$$
5+
{{elements_list}}

articles/hardcoded/element/article.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
title: "Element"
1+
title: "MTA Elements"
22
content: "article.md"
33
author: "multitheftauto"
44
date: "January 1, 2025"

web/scripts/builder.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import http
66
import subprocess
77
import signal
8+
import re
89
from datetime import date
910
from pathlib import Path
1011

@@ -388,14 +389,15 @@ def create_element_page(self, element):
388389
self.logger.info(f"Generated {output_path} for element {element['name']}")
389390

390391
def process_special_article_content(self, content):
391-
specials = utils.get_special_strings(content)
392+
specials = re.findall(r'\{\{.*?\}\}', content)
393+
specials = [s[2:-2] for s in specials]
392394
for special in specials:
393395
if special == 'elements_list':
394396
html_list = "<ul>"
395397
for element in self.elements:
396398
html_list += f"<li><a href='{element['path_html']}'>{element['name'].capitalize()}</a></li>"
397399
html_list += "</ul>"
398-
content = content.replace(f"$$special:{special}$$", html_list)
400+
content = content.replace(f"{{{{elements_list}}}}", html_list)
399401

400402
return content
401403

web/scripts/utils.py

-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,3 @@ def to_html(markdown_text, single_paragraph=False):
2424
if single_paragraph:
2525
html = re.sub(r'<p>(.*?)</p>', r'\1', html)
2626
return html
27-
28-
def get_special_strings(str):
29-
# Find all instances of $$special:ANY_TEXT$$ in the string
30-
return re.findall(r'\$\$special:(.*?)\$\$', str)

0 commit comments

Comments
 (0)