From 43d40f7fce533f90560f76c19b45861a950a3c8d Mon Sep 17 00:00:00 2001
From: Cas Rusnov
Date: Sun, 14 Apr 2019 17:50:56 -0700
Subject: [PATCH] Major code import.
---
demo/.meta | 7 +
demo/atom.xml | 33 ++++
demo/atom.xml.meta | 5 +
demo/bar/baz/quux/quuux | 0
demo/blog_posts/anotherpost.cont | 5 +
demo/blog_posts/anotherpost.cont.meta | 4 +
demo/blog_posts/test.cont | 1 +
demo/blog_posts/test.cont.meta | 4 +
demo/foo.cont | 1 +
demo/foo.cont.meta | 5 +
demo/index.cont | 19 +++
demo/mapping.json | 0
demo/passthrough.md | 9 ++
demo/passthrough.md.meta | 3 +
demo/readme.md | 9 ++
demo/readme.md.meta | 3 +
demo/templates/debug.jinja2 | 32 ++++
demo/templates/default-fs.jinja2 | 6 +
demo/templates/default.jinja2 | 13 ++
pixywerk2/__init__.py | 0
pixywerk2/__main__.py | 119 ++++++++++++++
pixywerk2/defaults/chains.yaml | 104 +++++++++++++
pixywerk2/metadata.py | 145 +++++++++++++++++
pixywerk2/processchain.py | 180 ++++++++++++++++++++++
pixywerk2/processors/__init__.py | 1 +
pixywerk2/processors/jinja2.py | 32 ++++
pixywerk2/processors/jinja2_page_embed.py | 76 +++++++++
pixywerk2/processors/passthrough.py | 68 ++++++++
pixywerk2/processors/process_less.py | 1 +
pixywerk2/processors/process_md.py | 69 +++++++++
pixywerk2/processors/process_pp.py | 1 +
pixywerk2/processors/process_sass.py | 1 +
pixywerk2/processors/process_styl.py | 1 +
pixywerk2/processors/processors.py | 63 ++++++++
pixywerk2/template_tools.py | 80 ++++++++++
pixywerk2/tests/unit/__init__.py | 0
pixywerk2/tests/unit/test_processchain.py | 6 +
pixywerk2/utils.py | 42 +++++
setup.py | 58 +++++++
tox.ini | 22 +++
40 files changed, 1228 insertions(+)
create mode 100755 demo/.meta
create mode 100644 demo/atom.xml
create mode 100644 demo/atom.xml.meta
create mode 100755 demo/bar/baz/quux/quuux
create mode 100644 demo/blog_posts/anotherpost.cont
create mode 100644 demo/blog_posts/anotherpost.cont.meta
create mode 100644 demo/blog_posts/test.cont
create mode 100644 demo/blog_posts/test.cont.meta
create mode 100755 demo/foo.cont
create mode 100755 demo/foo.cont.meta
create mode 100644 demo/index.cont
create mode 100755 demo/mapping.json
create mode 100644 demo/passthrough.md
create mode 100644 demo/passthrough.md.meta
create mode 100644 demo/readme.md
create mode 100644 demo/readme.md.meta
create mode 100755 demo/templates/debug.jinja2
create mode 100755 demo/templates/default-fs.jinja2
create mode 100755 demo/templates/default.jinja2
create mode 100644 pixywerk2/__init__.py
create mode 100644 pixywerk2/__main__.py
create mode 100644 pixywerk2/defaults/chains.yaml
create mode 100644 pixywerk2/metadata.py
create mode 100644 pixywerk2/processchain.py
create mode 100644 pixywerk2/processors/__init__.py
create mode 100644 pixywerk2/processors/jinja2.py
create mode 100644 pixywerk2/processors/jinja2_page_embed.py
create mode 100644 pixywerk2/processors/passthrough.py
create mode 100644 pixywerk2/processors/process_less.py
create mode 100644 pixywerk2/processors/process_md.py
create mode 100644 pixywerk2/processors/process_pp.py
create mode 100644 pixywerk2/processors/process_sass.py
create mode 100644 pixywerk2/processors/process_styl.py
create mode 100644 pixywerk2/processors/processors.py
create mode 100644 pixywerk2/template_tools.py
create mode 100644 pixywerk2/tests/unit/__init__.py
create mode 100644 pixywerk2/tests/unit/test_processchain.py
create mode 100644 pixywerk2/utils.py
create mode 100644 setup.py
create mode 100644 tox.ini
diff --git a/demo/.meta b/demo/.meta
new file mode 100755
index 0000000..77f863c
--- /dev/null
+++ b/demo/.meta
@@ -0,0 +1,7 @@
+{
+"site_root":"https://example.com",
+"title":"Test Metadata",
+"author": "Test User",
+"author_email": "test_user@example.com",
+"uuid_oid_root": "pixywerk-demo"
+}
diff --git a/demo/atom.xml b/demo/atom.xml
new file mode 100644
index 0000000..43512f7
--- /dev/null
+++ b/demo/atom.xml
@@ -0,0 +1,33 @@
+
+
+
+
+ {{ metadata.title }}
+ {{ metadata.subtitle }}
+
+
+ urn:uuid:{{ metadata.uuid }}
+ {{ get_time_iso8601(metadata['build-time']) }}
+
+ {% set posts = get_file_list('blog_posts/*.cont') %}
+ {% for post in posts %}
+ {% set post_meta = get_file_metadata(post['file_path']) %}
+
+ {{ post_meta.title }}
+
+ urn:uuid:{{ post_meta.uuid }}
+ {{ get_time_iso8601(post_meta.stat.mtime) }}
+ {{post_meta.summary }}
+
+
+
+
+
+
+
+ {{ post_meta.author }}
+ {{ post_meta.author_email }}
+
+
+ {% endfor %}
+
diff --git a/demo/atom.xml.meta b/demo/atom.xml.meta
new file mode 100644
index 0000000..dee5897
--- /dev/null
+++ b/demo/atom.xml.meta
@@ -0,0 +1,5 @@
+{
+"type": "templatable",
+"title": "Test RSS Feed",
+"subtitle": "Some Subtitle"
+}
\ No newline at end of file
diff --git a/demo/bar/baz/quux/quuux b/demo/bar/baz/quux/quuux
new file mode 100755
index 0000000..e69de29
diff --git a/demo/blog_posts/anotherpost.cont b/demo/blog_posts/anotherpost.cont
new file mode 100644
index 0000000..cbd4708
--- /dev/null
+++ b/demo/blog_posts/anotherpost.cont
@@ -0,0 +1,5 @@
+Some more post
+
+
+la la la
+
diff --git a/demo/blog_posts/anotherpost.cont.meta b/demo/blog_posts/anotherpost.cont.meta
new file mode 100644
index 0000000..b9a84d5
--- /dev/null
+++ b/demo/blog_posts/anotherpost.cont.meta
@@ -0,0 +1,4 @@
+{
+"title":"Another Post(tm)",
+"summary":"Yet another post"
+}
diff --git a/demo/blog_posts/test.cont b/demo/blog_posts/test.cont
new file mode 100644
index 0000000..637d210
--- /dev/null
+++ b/demo/blog_posts/test.cont
@@ -0,0 +1 @@
+Some content.
diff --git a/demo/blog_posts/test.cont.meta b/demo/blog_posts/test.cont.meta
new file mode 100644
index 0000000..2bc3818
--- /dev/null
+++ b/demo/blog_posts/test.cont.meta
@@ -0,0 +1,4 @@
+{
+"title":"Test.cont",
+"summary":"Some empty test content"
+}
diff --git a/demo/foo.cont b/demo/foo.cont
new file mode 100755
index 0000000..28a04cb
--- /dev/null
+++ b/demo/foo.cont
@@ -0,0 +1 @@
+yo fresh
\ No newline at end of file
diff --git a/demo/foo.cont.meta b/demo/foo.cont.meta
new file mode 100755
index 0000000..59f3331
--- /dev/null
+++ b/demo/foo.cont.meta
@@ -0,0 +1,5 @@
+{
+"foo":"bar",
+"title":"A title",
+"summary":"Just a post."
+}
diff --git a/demo/index.cont b/demo/index.cont
new file mode 100644
index 0000000..0c9ab9e
--- /dev/null
+++ b/demo/index.cont
@@ -0,0 +1,19 @@
+Index of all content
+{% for f in get_file_list('*', sort_order='file_name') %}
+{{get_file_name(f['file_name'])}}
+{% endfor %}
+
+Including foo.cont.meta:
+
+{{ get_file_content('foo.cont.meta') }}
+
+
+
+Metadata
+
diff --git a/demo/mapping.json b/demo/mapping.json
new file mode 100755
index 0000000..e69de29
diff --git a/demo/passthrough.md b/demo/passthrough.md
new file mode 100644
index 0000000..373643d
--- /dev/null
+++ b/demo/passthrough.md
@@ -0,0 +1,9 @@
+# README #
+
+This is a test of the emergency compiled HTML system. This is only a *test*.
+
+[Foo!](foo.html)
+
+{% for i in range(100) %}
+* {{ i }}
+{% endfor %}
diff --git a/demo/passthrough.md.meta b/demo/passthrough.md.meta
new file mode 100644
index 0000000..d35f55b
--- /dev/null
+++ b/demo/passthrough.md.meta
@@ -0,0 +1,3 @@
+{
+"pragma":["no-proc"]
+}
diff --git a/demo/readme.md b/demo/readme.md
new file mode 100644
index 0000000..373643d
--- /dev/null
+++ b/demo/readme.md
@@ -0,0 +1,9 @@
+# README #
+
+This is a test of the emergency compiled HTML system. This is only a *test*.
+
+[Foo!](foo.html)
+
+{% for i in range(100) %}
+* {{ i }}
+{% endfor %}
diff --git a/demo/readme.md.meta b/demo/readme.md.meta
new file mode 100644
index 0000000..a266664
--- /dev/null
+++ b/demo/readme.md.meta
@@ -0,0 +1,3 @@
+{
+"title":"Yo, markdown"
+}
\ No newline at end of file
diff --git a/demo/templates/debug.jinja2 b/demo/templates/debug.jinja2
new file mode 100755
index 0000000..bcc22fb
--- /dev/null
+++ b/demo/templates/debug.jinja2
@@ -0,0 +1,32 @@
+
+
+Debug for {{path}}
+
+
+
+{{path}}
+Content
+
+{{content}}
+
+
+Environment
+
+key value
+{% for k in environ.keys() %}
+{{k}} {{environ[k]}}
+{% endfor %}
+
+
+Metadata
+
+
diff --git a/demo/templates/default-fs.jinja2 b/demo/templates/default-fs.jinja2
new file mode 100755
index 0000000..09b2c85
--- /dev/null
+++ b/demo/templates/default-fs.jinja2
@@ -0,0 +1,6 @@
+
+file type size last change
+{% for f in files.keys() %}
+{{f}} {{files[f].type}} {{files[f].size}} {{files[f].ctime | date}}
+{% endfor %}
+
diff --git a/demo/templates/default.jinja2 b/demo/templates/default.jinja2
new file mode 100755
index 0000000..64e5dcc
--- /dev/null
+++ b/demo/templates/default.jinja2
@@ -0,0 +1,13 @@
+
+
+{{metadata.title}}
+
+
+
+{{content}}
+
+