NEF

an even <i>smaller</i> static site generator

<hr>

from the mind that brought you <b>UNK</b>, comes the new and improved SON OF
UNK, <b>NEF</b>.  Where <b>UNK</b> was a bloated <i>one thousand bytes</i>, the
entirety of <b>NEF</b> is <i>four hundred forty-four</i>, over a fifty per cent
<i>reduction</i> in size.

<h2>installation</h2>

clone this repo.
<b>NEF</b> requires a POSIX environment.

<h2>use</h2>

create the following files and directories in the same directory as <b>NEF</b>:

<ul>
    <li><b>L</b>, the <i>Layout</i> file, which gets expanded by <b>NEF</b>.
        if <b>L</b> isn't provided, a default <b>L</b> will be generated.
    <li><b>H</b>, the <i>Html</i> generator, which converts the input files to
        HTML.  if <b>H</b> isn't provided, a default function H is called, which
        is pretty stupid: it wraps blank-line-separated paragraphs in 
        <code>&lt;p&gt;</code> blocks.  otherwise, it's pure HTML (mostly; see
        <b>layouts</b>, below).
    <li><b>I/</b>, where the <i>Input</i> files, like pages, go.
        each page should have a name of the form 
        <code>NAME.OUT-FMT.IN-FMT</code>, where
        <code>NAME</code> is the basename of the file,
        <code>OUT-FMT</code> is the output format (usually HTML),
        and <code>IN-FMT</code> is the input format (whatever -- in this repo
        it's called <code>.h</code>).
    <li><b>S/</b>, where the <i>Static</i> files, like CSS and images, go.
</ul>

<h2>layouts</h2>

the <b>L</b> file is basically a big here-doc, meaning that you can write
arbitrary shell in it however you'd like.  the following variables and functions
are made available to <b>L</b>'s environment (in addition, of course, to
whatever <b>NEF</b>'s environment is):

<ul>
    <li><b>X</b>, the <i>eXpander</i>.  it turns <b>L</b> into a here-doc.
        <i>make sure to escape your files properly!</i>
    <li><b>H</b>, the <i>Htmlizer</i>.  it's a dumb awk function.  even if you
        have a file <b>H</b> in <b>NEF</b>'s directory, this function will 
        still be here, taunting you with its stupidity.
    <li><b>P</b>, aliased to <code>echo</code>.
    <li><b>T</b>, aliased to <code>sed q</code>, which pulls the first line from
        a file.  aka, the <i>Title</i>.
    <li><b>\$H</b>, which keeps track of whether you're using the <b>H</b> file
        or function.  you probably don't need this.  but it's here.
    <li><b>\$F</b>, the <i>Filename</i> of the current input file.
    <li><b>\$N</b>, the <i>baseName</i> (without <code>I/</code>) of the current
        input file.
</ul>

the default <b>L</b> <i>also</i> runs each input file through the
<b>X</b> function (<b>UNK</b> devotees will be aware of the <b>X</b> function;
it's basically <a href=https://github.com/zimbatm/shab>shab</a> but stupider and
smaller), meaning that input files can basically function as templates
themselves, and create their own fun.

<h2>uh, yeah, that's it</h2>

look, the script is a super short POSIX shell script.  it's barely usable by
itself.  you're probably going to throw it out and write something else --
that's what I do.

<h2>legal</h2>

<b>UNK</b> used the <a href="http://www.wtfpl.net/">WTFPL</a>, which is the
shortest license I've been able to find.  however, for <b>NEF</b>, 443 bytes is
<i>far</i> too long: it basically <i>doubles</i> the size of the repo!  so I
wrote my own license, which I'm calling the <b>good choices license</b>, or
<b>GCL</b> for short.  you can read the LICENSE file, or just read it here:

<blockquote>
(c) 2020 Case Duckworth &lt;acdw@acdw.net&gt;

Everyone is permitted to do whatever with this software, without limitation.
This software comes without any warranty whatsoever.
Don't hurt yourself.
Make good choices.
</blockquote>

a trim 169 bytes, exclusive of the copyright information!

<h2>contributing</h2>

uh... send me an email?  yeah.  do that.
