.Dd 3/3/13     
.Dt Local 8    
.Os Darwin
.Sh NAME       
.Nm mulle-scion
.Nd create text output from a template and a property list.
.Sh SYNOPSIS      
.Nm
.Op Fl w z Z
.Ar template      
.Ar plist         
.Op Ar outputfile 
.Op Ar arguments 
.Sh DESCRIPTION   
.Nm
is a standalone template renderer that has a built-in Objective-C interpreter.

.El                      
.Pp               
These are optional modes
.Nm  
can run:
.Bl -tag -width "XXXXXXXXXX" -indent 
.It Fl w 
If you give mulle-scion the webserver option if will start a small webserver, 
suitable for demonstration purposes. The remaining arguments of the command line
are treazed as bundle identifiers or paths, to be loaded immediately.
The document root is hardcoded to "/tmp/MulleScionDox" and it should open a
port on 18048 on the localhost interface.
.It Fl z 
Create a compiled '.scionz' template archive. Everything after template is ignored.
.It Fl Z
Create a compiled '.scionZ' template  archive suitable for iOS. Everything after template is ignored.

.El
.Pp               
These are the arguments you can give to 
.Nm  
:
.Bl -tag -width "XXXXXXXXXX" -indent 
.It Ar template  
the template filename or URL. If the file has no extension a .scion will be
appended. The directory of this path will become your root for included 
templates. If the argument starts with a '{' this argument is treated as an
inline template string instead. If you give '-' as a path, the template will
be read from standard input.
.It Ar plist  
A property list filename or URL. If you give '-' as a path, the property list will 
be read from standard input, unless you already used '-' for the template.
You can also give 'none' for no property list. Giving the keyword 'args
makes mulle-scion treat the arguments as key value pairs for a datasource plist.
.It Ar outputfile
The output file to write the output to. If this parameter is '-' or omitted, the 
output is written to standard output.
.It Ar arguments
All other trailing arguments are collected and are available as an array in the
MulleScion variable __ARGV__, unless 'args' has been set. In which case the
arguments become the datasource.
.El 
.Pp                     
.Pp
.Sh ENVIRONMENT     
.Bl -tag -width "outputfile" -indent 
.It Ev MulleScionCacheDirectory
If set this will enable the caching of compiled templates to the specified 
directory. Changes to source templates are not tracked. Use a dependency 
tracker like make for that. 
.El                      
.Bl -tag -width "outputfile" -indent 
.It Ev MulleScionDescriptionPreBlockExpansion
If set to a filepath or '-' the template will be printed out before
block expansion. 
.El
.Bl -tag -width "outputfile" -indent 
.It Ev MulleScionDescriptionPostBlockExpansion
If set to a filepath or '-' the template will be printed out before
block expansion. 
.El                      
.Bl -tag -width "outputfile" -indent 
.It Ev MulleScionDumpPreBlockExpansion
Filepath or '-' to create a dump of the template after block expansion.
A trace is more readable and easier to debug than a dump.
.El                      
.Bl -tag -width "outputfile" -indent 
.It Ev MulleScionDumpPostBlockExpansion
Filepath or '-' to create a dump of the template after block expansion.
This is the most common kind of debug output to generate.
.El                      
.Bl -tag -width "outputfile" -indent 
.It Ev MulleScionTrace
Setting this environment value turns on a limited tracing facility during
the rendering of a template.
.El
.Sh EXAMPLES
.Pp
.Dl "mulle-scion my_template.scion a_datasource.plist output.txt"
.Pp
Fill template file my_template.scion with data from a_datasource.plist and write it to
output.txt.

.Pp
.Dl "mulle-scion 'https://raw.githubusercontent.com/mulle-nat/MulleScion/release/dox/!_Introduction.scion' 'https://raw.githubusercontent.com/mulle-nat/MulleScion/release/dox/properties.plist'
.Pp
As above but using URLs and writing the output to the console

.Pp
.Dl "mulle-scion '{{ [__ARGV__[ 0] stringByResolvingSymlinksInPath] }}' none - /tmp/.."
.Pp
Use mulle-scion to resolve a symlink path /tmp/.. . The script is inlined, there is no property 
list for a datasource and the output is routed to the console.

.Pp
.Dl "mulle-scion '{{ [PATH stringByResolvingSymlinksInPath] }}' keyvalue - "PATH=/tmp/.."
.Pp
As above but using key values as a datasource instead of __ARGV__.

.Pp
.Dl "mulle-scion -w ~/Library/Bundles/MyWebServer.bundle"
.Pp
start a webserver for "/tmp/MulleScionDo"x and load "~/Library/Bundles/MyWebServer.bundle". The bundle 
can add functionality to the template code..


.Sh SEE ALSO 
.Xr make 1 
.Sh AUTHOR
Coded by Nat! for Mulle kybernetiK. There should be a homepage for 
MulleScion at 
.Pp
http://www.mulle-kybernetik.com/software/git/MulleScion
.Pp
The webserver is based on mongoose by Sergey Lyubka. 
.Pp
https://github.com/valenok/mongoose