- {% block head %}
-
- {% block title %}Writings by Shoofle{% endblock %}
-
-
-
-
- {% endblock %}
-
-
- {% block body -%}
- {%- include target -%}
- {%- endblock %}
-
-
diff --git a/finalized/articles/article.zip.template.html b/finalized/articles/article.zip.template.html
deleted file mode 100644
index b4b3db4..0000000
--- a/finalized/articles/article.zip.template.html
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
- {% block head %}
-
- {% block title %}Writings by Shoofle{% endblock %}
-
-
-
-
-
- {% endblock %}
-
-
- {% block body -%}
- {%- include target -%}
- {%- endblock %}
-
-
diff --git a/finalized/articles/auriga.article.html b/finalized/articles/auriga.html
similarity index 100%
rename from finalized/articles/auriga.article.html
rename to finalized/articles/auriga.html
diff --git a/finalized/articles/circle_script.article.html b/finalized/articles/circle_script.html
similarity index 100%
rename from finalized/articles/circle_script.article.html
rename to finalized/articles/circle_script.html
diff --git a/finalized/articles/circle_script_generator.article.html b/finalized/articles/circle_script_generator.html
similarity index 100%
rename from finalized/articles/circle_script_generator.article.html
rename to finalized/articles/circle_script_generator.html
diff --git a/finalized/articles/comic_layout_generator.article.html b/finalized/articles/comic_layout_generator.html
similarity index 100%
rename from finalized/articles/comic_layout_generator.article.html
rename to finalized/articles/comic_layout_generator.html
diff --git a/finalized/articles/distributed_speakers.article.html b/finalized/articles/distributed_speakers.html
similarity index 100%
rename from finalized/articles/distributed_speakers.article.html
rename to finalized/articles/distributed_speakers.html
diff --git a/finalized/articles/dont_write_tests.article.html b/finalized/articles/dont_write_tests.html
similarity index 100%
rename from finalized/articles/dont_write_tests.article.html
rename to finalized/articles/dont_write_tests.html
diff --git a/finalized/articles/dynamic_systems_in_games.article.html b/finalized/articles/dynamic_systems_in_games.html
similarity index 100%
rename from finalized/articles/dynamic_systems_in_games.article.html
rename to finalized/articles/dynamic_systems_in_games.html
diff --git a/finalized/articles/easy_peasy_state_machinesy.article.html b/finalized/articles/easy_peasy_state_machinesy.html
similarity index 100%
rename from finalized/articles/easy_peasy_state_machinesy.article.html
rename to finalized/articles/easy_peasy_state_machinesy.html
diff --git a/finalized/articles/game_diary.article.html b/finalized/articles/game_diary.html
similarity index 100%
rename from finalized/articles/game_diary.article.html
rename to finalized/articles/game_diary.html
diff --git a/finalized/articles/game_log.article.html b/finalized/articles/game_log.html
similarity index 100%
rename from finalized/articles/game_log.article.html
rename to finalized/articles/game_log.html
diff --git a/finalized/articles/identities_and_spaces.article.html b/finalized/articles/identities_and_spaces.html
similarity index 100%
rename from finalized/articles/identities_and_spaces.article.html
rename to finalized/articles/identities_and_spaces.html
diff --git a/finalized/articles/language_for_games.template.html b/finalized/articles/language_for_games.template.html
deleted file mode 100644
index 9a12a25..0000000
--- a/finalized/articles/language_for_games.template.html
+++ /dev/null
@@ -1,15 +0,0 @@
-{% extends "articles/article.template.html" %}
-
-{% block title -%}
-Features for a game-focused programming language or library
-{%- endblock %}
-
-{% block body -%}
-
I like making games but sometimes I spend a lot of time doing stuff that is just annoying. What if a language or environment were designed to make those things easy?
-
-{%- include "articles/snorlax_evaluation.article.html" -%}
-
-{%- include "articles/time_integration.article.html" -%}
-
-{%- include "articles/easy_peasy_state_machinesy.article.html" -%}
-{%- endblock %}
\ No newline at end of file
diff --git a/finalized/articles/language_for_games.zip.template.html b/finalized/articles/language_for_games.zip.template.html
deleted file mode 100644
index 9ffcc49..0000000
--- a/finalized/articles/language_for_games.zip.template.html
+++ /dev/null
@@ -1,16 +0,0 @@
-{% extends "articles/article.template.html" %}
-
-{% block title -%}
-Features for a game-focused programming language or library
-{%- endblock %}
-
-{% block body -%}
-
-
I like making games but sometimes I spend a lot of time doing stuff that is just annoying. What if a language or environment were designed to make those things easy?
-
-{%- include "articles/snorlax_evaluation.article.html" -%}
-
-{%- include "articles/time_integration.article.html" -%}
-
-{%- include "articles/easy_peasy_state_machinesy.article.html" -%}
-{%- endblock %}
diff --git a/finalized/articles/mindjail_engine.article.html b/finalized/articles/mindjail_engine.html
similarity index 100%
rename from finalized/articles/mindjail_engine.article.html
rename to finalized/articles/mindjail_engine.html
diff --git a/finalized/articles/nintendo_summarized.article.html b/finalized/articles/nintendo_summarized.html
similarity index 100%
rename from finalized/articles/nintendo_summarized.article.html
rename to finalized/articles/nintendo_summarized.html
diff --git a/finalized/articles/oauth.article.html b/finalized/articles/oauth.html
similarity index 100%
rename from finalized/articles/oauth.article.html
rename to finalized/articles/oauth.html
diff --git a/finalized/articles/object_oriented_programming.article.html b/finalized/articles/object_oriented_programming.html
similarity index 100%
rename from finalized/articles/object_oriented_programming.article.html
rename to finalized/articles/object_oriented_programming.html
diff --git a/finalized/articles/play_for_x.article.html b/finalized/articles/play_for_x.html
similarity index 100%
rename from finalized/articles/play_for_x.article.html
rename to finalized/articles/play_for_x.html
diff --git a/finalized/articles/shoof_shoof_revolution.article.html b/finalized/articles/shoof_shoof_revolution.html
similarity index 100%
rename from finalized/articles/shoof_shoof_revolution.article.html
rename to finalized/articles/shoof_shoof_revolution.html
diff --git a/finalized/articles/snorlax_evaluation.article.html b/finalized/articles/snorlax_evaluation.html
similarity index 100%
rename from finalized/articles/snorlax_evaluation.article.html
rename to finalized/articles/snorlax_evaluation.html
diff --git a/finalized/articles/something_or_other.article.html b/finalized/articles/something_or_other.html
similarity index 100%
rename from finalized/articles/something_or_other.article.html
rename to finalized/articles/something_or_other.html
diff --git a/finalized/articles/spinning.article.html b/finalized/articles/spinning.html
similarity index 100%
rename from finalized/articles/spinning.article.html
rename to finalized/articles/spinning.html
diff --git a/finalized/articles/splatling.article.html b/finalized/articles/splatling.html
similarity index 100%
rename from finalized/articles/splatling.article.html
rename to finalized/articles/splatling.html
diff --git a/finalized/articles/tamari.article.html b/finalized/articles/tamari.html
similarity index 100%
rename from finalized/articles/tamari.article.html
rename to finalized/articles/tamari.html
diff --git a/finalized/articles/tattoo_elements.article.html b/finalized/articles/tattoo_elements.html
similarity index 100%
rename from finalized/articles/tattoo_elements.article.html
rename to finalized/articles/tattoo_elements.html
diff --git a/finalized/articles/text_editors_with_contenteditable.article.html b/finalized/articles/text_editors_with_contenteditable.html
similarity index 100%
rename from finalized/articles/text_editors_with_contenteditable.article.html
rename to finalized/articles/text_editors_with_contenteditable.html
diff --git a/finalized/articles/time_integration.article.html b/finalized/articles/time_integration.html
similarity index 100%
rename from finalized/articles/time_integration.article.html
rename to finalized/articles/time_integration.html
diff --git a/finalized/articles/vim_indenting.article.html b/finalized/articles/vim_indenting.html
similarity index 100%
rename from finalized/articles/vim_indenting.article.html
rename to finalized/articles/vim_indenting.html
diff --git a/finalized/articles/web_420.0.article.html b/finalized/articles/web_420.0.html
similarity index 100%
rename from finalized/articles/web_420.0.article.html
rename to finalized/articles/web_420.0.html
diff --git a/finalized/static/WHA.epub b/finalized/static/WHA.epub
old mode 100755
new mode 100644
diff --git a/finalized/static/sleepy.html b/finalized/static/sleepy.html
old mode 100755
new mode 100644
diff --git a/finalized/static/templates_old/auriga.template.html b/finalized/static/templates_old/auriga.template.html
deleted file mode 100644
index 03a0b2b..0000000
--- a/finalized/static/templates_old/auriga.template.html
+++ /dev/null
@@ -1,9 +0,0 @@
-{% extends "articles/article.template.html" %}
-
-{% block title -%}
-How should this website be laid out?
-{%- endblock %}
-
-{% block body -%}
-{%- include "articles/auriga.article.html" -%}
-{%- endblock %}
\ No newline at end of file
diff --git a/finalized/static/templates_old/distributed_speakers.template.html b/finalized/static/templates_old/distributed_speakers.template.html
deleted file mode 100644
index 18ee10a..0000000
--- a/finalized/static/templates_old/distributed_speakers.template.html
+++ /dev/null
@@ -1,9 +0,0 @@
-{% extends "articles/article.template.html" %}
-
-{% block title -%}
-Impromptu Soundsystems would be a good name for a band.
-{%- endblock %}
-
-{% block body -%}
-{%- include "articles/distributed_speakers.article.html" -%}
-{%- endblock %}
\ No newline at end of file
diff --git a/finalized/static/templates_old/game_log.template.html b/finalized/static/templates_old/game_log.template.html
deleted file mode 100644
index 29b1661..0000000
--- a/finalized/static/templates_old/game_log.template.html
+++ /dev/null
@@ -1,9 +0,0 @@
-{% extends "articles/article.template.html" %}
-
-{% block title -%}
-I occasionally play some videogames.
-{%- endblock %}
-
-{% block body -%}
-{%- include "articles/game_log.article.html" -%}
-{%- endblock %}
\ No newline at end of file
diff --git a/finalized/static/templates_old/language_for_games.template.html b/finalized/static/templates_old/language_for_games.template.html
deleted file mode 100644
index 9a12a25..0000000
--- a/finalized/static/templates_old/language_for_games.template.html
+++ /dev/null
@@ -1,15 +0,0 @@
-{% extends "articles/article.template.html" %}
-
-{% block title -%}
-Features for a game-focused programming language or library
-{%- endblock %}
-
-{% block body -%}
-
I like making games but sometimes I spend a lot of time doing stuff that is just annoying. What if a language or environment were designed to make those things easy?
-
-{%- include "articles/snorlax_evaluation.article.html" -%}
-
-{%- include "articles/time_integration.article.html" -%}
-
-{%- include "articles/easy_peasy_state_machinesy.article.html" -%}
-{%- endblock %}
\ No newline at end of file
diff --git a/finalized/static/templates_old/mindjail_engine.template.html b/finalized/static/templates_old/mindjail_engine.template.html
deleted file mode 100644
index adb5f78..0000000
--- a/finalized/static/templates_old/mindjail_engine.template.html
+++ /dev/null
@@ -1,9 +0,0 @@
-{% extends "articles/article.template.html" %}
-
-{% block title -%}
-The Mindjail Engine!
-{%- endblock %}
-
-{% block body -%}
-{%- include "articles/mindjail_engine.article.html" -%}
-{%- endblock %}
\ No newline at end of file
diff --git a/finalized/static/templates_old/oauth.template.html b/finalized/static/templates_old/oauth.template.html
deleted file mode 100644
index c9a785b..0000000
--- a/finalized/static/templates_old/oauth.template.html
+++ /dev/null
@@ -1,9 +0,0 @@
-{% extends "articles/article.template.html" %}
-
-{% block title -%}
-I have used OAuth, and lived to tell the tale.
-{%- endblock %}
-
-{% block body -%}
-{%- include "articles/oauth.article.html" -%}
-{%- endblock %}
\ No newline at end of file
diff --git a/finalized/static/templates_old/play_for_x.template.html b/finalized/static/templates_old/play_for_x.template.html
deleted file mode 100644
index f0a942e..0000000
--- a/finalized/static/templates_old/play_for_x.template.html
+++ /dev/null
@@ -1,9 +0,0 @@
-{% extends "articles/article.template.html" %}
-
-{% block title -%}
-Play For X
-{%- endblock %}
-
-{% block body -%}
-{%- include "articles/play_for_x.article.html" -%}
-{%- endblock %}
\ No newline at end of file
diff --git a/finalized/static/templates_old/shoof_shoof_revolution.template.html b/finalized/static/templates_old/shoof_shoof_revolution.template.html
deleted file mode 100644
index 7bf7c69..0000000
--- a/finalized/static/templates_old/shoof_shoof_revolution.template.html
+++ /dev/null
@@ -1,9 +0,0 @@
-{% extends "articles/article.template.html" %}
-
-{% block title -%}
-Javascript DDR Clone
-{%- endblock %}
-
-{% block body -%}
-{%- include "articles/shoof_shoof_revolution.article.html" -%}
-{%- endblock %}
\ No newline at end of file
diff --git a/finalized/static/templates_old/spinning.template.html b/finalized/static/templates_old/spinning.template.html
deleted file mode 100644
index d4e824f..0000000
--- a/finalized/static/templates_old/spinning.template.html
+++ /dev/null
@@ -1,9 +0,0 @@
-{% extends "articles/article.template.html" %}
-
-{% block title -%}
-I spin things around!
-{%- endblock %}
-
-{% block body -%}
-{%- include "articles/spinning.article.html" -%}
-{%- endblock %}
\ No newline at end of file
diff --git a/finalized/static/templates_old/tamari.template.html b/finalized/static/templates_old/tamari.template.html
deleted file mode 100644
index 8a25fec..0000000
--- a/finalized/static/templates_old/tamari.template.html
+++ /dev/null
@@ -1,9 +0,0 @@
-{% extends "articles/article.template.html" %}
-
-{% block title -%}
-Tamari Lattices: very pretty.
-{%- endblock %}
-
-{% block body -%}
-{%- include "articles/tamari.article.html" -%}
-{%- endblock %}
\ No newline at end of file
diff --git a/finalized/static/templates_old/text_editors_with_contenteditable.template.html b/finalized/static/templates_old/text_editors_with_contenteditable.template.html
deleted file mode 100644
index ba0ca4e..0000000
--- a/finalized/static/templates_old/text_editors_with_contenteditable.template.html
+++ /dev/null
@@ -1,9 +0,0 @@
-{% extends "articles/article.template.html" %}
-
-{% block title -%}
-contentEditable: Text Editors Made Easy?
-{%- endblock %}
-
-{% block body -%}
-{%- include "articles/text_editors_with_contenteditable.article.html" -%}
-{%- endblock %}
\ No newline at end of file
diff --git a/generate.py b/generate.py
index 2d46b9b..8c1f0b0 100644
--- a/generate.py
+++ b/generate.py
@@ -5,14 +5,12 @@ import shutil
import argparse
parser = argparse.ArgumentParser()
-parser.add_argument("destination", help="where to put the rendered site")
+parser.add_argument("-i", "--input", type=Path, help="source materials")
+parser.add_argument("-o", "--output", type=Path, help="where to put the rendered site")
args = parser.parse_args()
-root_folder = Path(__file__).parent
-source = root_folder / "source"
-finals = root_folder / "finalized"
-if args.destination:
- finals = args.destination()
+source = args.input
+finals = args.output
env = Environment(
loader=FileSystemLoader(source),
@@ -20,14 +18,36 @@ env = Environment(
# clear out the folder finalized
-shutil.copytree(source, finals)
-
# walk the source directory and make all the corresponding files into finalized
-for path_to_file in (source / "articles").glob("*"):
- rel_path = path_to_file.relative_to(source)
-
- if ".article.html" in str(path_to_file):
- with open(finals / rel_path, "w") as output:
- article_template = env.get_template("articles/article.template.html")
- output.write(article_template.render(title="Article", target=str(path_to_file.relative_to(source))))
+article_template = env.get_template("articles/article.template.html")
+
+for path_to_source in source.glob("**/*"):
+ rel_path = path_to_source.relative_to(source)
+ path_to_output = finals / rel_path
+
+ if ".ignore" in str(rel_path):
+ continue
+
+ if path_to_source.is_dir():
+ pass
+
+ elif ".article.html" in str(path_to_source):
+ path_to_output = path_to_output.parent / path_to_output.name.replace(".article","")
+ with open(path_to_output, "w") as output_file:
+ os.makedirs(path_to_output.parent, exist_ok=True)
+ output_file.write(article_template.render(title="Article", target=str(rel_path)))
+
+ elif ".renderme" in str(path_to_source):
+ path_to_output = path_to_output.parent / path_to_output.name.replace(".renderme","")
+ with open(path_to_output, "w") as output_file:
+ os.makedirs(path_to_output.parent, exist_ok=True)
+ output_file.write(env.get_template(rel_path).render())
+
+ elif ".template.html" in str(path_to_source):
+ pass
+
+ else:
+ os.makedirs(path_to_output.parent, exist_ok=True)
+ shutil.copy(path_to_source, path_to_output)
+