diff --git a/.github/scripts/generate_faq_html.py b/.github/scripts/generate_faq_html.py index dfabda6..767239c 100644 --- a/.github/scripts/generate_faq_html.py +++ b/.github/scripts/generate_faq_html.py @@ -1,13 +1,15 @@ import json # Constants -faq_json_location = "faq.json" +faq_json_location = "data/faq.json" faq_html_template_location = "data/faq.html.template" +faq_html_output_location = "faq.html" template_insertion_location = "" def faq_html(entry): - question = entry.get("question", "Question is null or undefined") - answer = entry.get("answerHTML", "Answer is null or undefined") + if not entry.get("question") or not entry.get("answer"): + return "" + author = entry.get("author", "Unknown") return f"""
@@ -17,10 +19,10 @@ def faq_html(entry):
-

{question}

+

{entry['question']}

- {answer} + {entry['answer']}
— {author}
@@ -34,4 +36,4 @@ def faq_html(entry): html_template = html_template.replace(template_insertion_location, text_to_insert) -open("faq.html", "w").write(html_template) \ No newline at end of file +open(faq_html_output_location, "w").write(html_template) \ No newline at end of file diff --git a/data/faq.json b/data/faq.json index 906e175..33bef1a 100644 --- a/data/faq.json +++ b/data/faq.json @@ -290,4 +290,4 @@ "answerHTML": "

Techmino has received a warning about Copyright infringement from The Tetris Company. Techmino is no longer available on the App Store.

A TestFlight was made for Techmino, but unfortunately, the maximum number of members had been reached, therefore, you can't download Techmino on iOS anymore. We apologize for the inconvenience. If it says the beta isn't accepting more testers, unfortunately, it is not available at this time.

", "author": "nekonaomii (edited by NOT_A_ROBOT)" } -] \ No newline at end of file +]