Film Freedom Project (Channel)

Lunagen_Intro-Pt2-Implementation


Listen Later

The second of three parts of an introduction to my "LunaGen" software.

I may add slides to this later, but currently it's just me talking.
This video is also used in my unit-testing.

Transcript:

PT2: IMPLEMENTATION

--

Since I am both the user and developer

for this software,
I chose to use familiar formats:

The structured data language is YAML.

The templating language is Jinja2.

And it's tied together with Python.

In fact, most of the functionality of LunaGen

is really just the functionality of
YAML and Jinja2.

The Python code is quite tiny and simple.

In the simple case,

all it does for each desired page,
is load the YAML and Jinja2,
read the YAML data into a Python namespace,
give that namespace to Jinja2,
render the Jinja2 template,
and write that out to disk.

Even if the page consists primarily of

a long list of repeated elements,
it isn't necessary to do anything in Python,
because Jinja2 supports
that kind of loop functionality.

We only really need Python manipulations

to deal with more complex tree-structure,
such as the relationship between "series"
(or "seasons") and "episodes".

--

I adopted the British TV term "series",
because the US TV term "season" suggests a
rigid annual schedule, which I knew I couldn't
keep up with.

--

And we need Python to handle interlaced content,

where I want to interrupt one content stream
with another.

This is a simple alternation pattern

where secondary content is injected,
one element at a time,
in between the elements from the main stream.

We thus apply the Jinja2 templates

for the chunks of content,
and then insert those chunks into the
master template for a given page.

This is how you get the page structure you

see on our current Lunatics release pages.

This is how I handle things like

monetization, advertising, and announcements.

These secondary blocks can appear

in between the primary content blocks.

--

...more
View all episodesView all episodes
Download on the App Store

Film Freedom Project (Channel)By