diff options
author | nathansmith117 <nathansmith@posteo.com> | 2025-03-31 04:57:56 -0600 |
---|---|---|
committer | nathansmith117 <nathansmith@posteo.com> | 2025-03-31 04:57:56 -0600 |
commit | ab1ec50a9b842dfedc9f5c5ee8c20a48de3f1347 (patch) | |
tree | 7bffafbc3e74a708a1541897f5397104cbf81362 /blog/generate_html.py | |
parent | 61cbae386b256bb6adb0adaa52cd00585a0820e2 (diff) |
Wrote wikipedia article
Diffstat (limited to 'blog/generate_html.py')
-rwxr-xr-x | blog/generate_html.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/blog/generate_html.py b/blog/generate_html.py index 7360fa3..1d8d063 100755 --- a/blog/generate_html.py +++ b/blog/generate_html.py @@ -31,6 +31,7 @@ def main(): with open("template.html", "r") as fp: template = fp.read() + article_list = "<ul>\n" article_html = "" # Get articles from rss @@ -49,10 +50,18 @@ def main(): # Remove article tags. article = article[article.find("<article>")+9::] article = article[:article.find("</article>"):] + + # Add article table to html article_html += make_article_table(article_info, article) + # Add article to list. + article_list += \ + f"<li><a href=\"#{article_info["name"]}\">{article_info["title"]}</a></li>\n" + + article_list += "</ul>" + # Format the articles into the html - template = template.format(articles=article_html) + template = template.format(article_list=article_list, articles=article_html) print(template) if __name__ == "__main__": |