Skip to content

Commit

Permalink
try to fix ci script 3
Browse files Browse the repository at this point in the history
  • Loading branch information
Not-A-Normal-Robot committed Jan 7, 2024
1 parent 45d7e24 commit a749bb4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions .github/scripts/generate_faq_html.py
Original file line number Diff line number Diff line change
@@ -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 = "<INSERT_QUESTIONS>"

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"""
<div class="question">
Expand All @@ -17,10 +19,10 @@ def faq_html(entry):
<path fill="currentColor" d="M7 14l5-5 5 5z"></path>
</svg>
</div>
<h2 class="question-title">{question}</h2>
<h2 class="question-title">{entry['question']}</h2>
</button>
<div class="answer">
{answer}
{entry['answer']}
<div class="answer-source">— {author}</div>
</div>
</div>
Expand All @@ -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)
open(faq_html_output_location, "w").write(html_template)
2 changes: 1 addition & 1 deletion data/faq.json
Original file line number Diff line number Diff line change
Expand Up @@ -290,4 +290,4 @@
"answerHTML": "<p>Techmino has received a warning about Copyright infringement from The Tetris Company. Techmino is no longer available on the App Store.</p><p>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.</p>",
"author": "nekonaomii (edited by NOT_A_ROBOT)"
}
]
]

0 comments on commit a749bb4

Please sign in to comment.