Package: fairyscript
Write manuscripts in screenplay style and export them to various
formats.DescriptionFairyScript provides a human-readable yet still regular format for
writing manuscripts in plaintext. These manuscripts can then be compiled
with fairyscript to various other formats, either for consumption by
other programs or for ease-of-use by humans.There are three main values that FairyScript provides:Storing manuscripts as plaintext rather than as binary or XML-based files (such
as those used by Microsoft Word) consumes less space.Using the .FEY format allows the manuscript to be compiled to other formats when
necessary.The .FEY format provided by FairyScript is easier to read than formats that are
directly used by manuscript execution systems, such as Ren’py.Supported FormatsFairyScript provides the .FEY format for files. It is capable of
interpreting manuscripts written in this format, and compiling them to
the following formats:.FEY -> .RPY (Ren’py Script).FEY -> .DOCX (Word Office)InstallationTo install FairyScript to the system, dopip install fairyscript.
This will make thefairyccommand available on the system.Requirements:Python (2.7, or 3.3 or later)lxml, which can be installed from pip.ply, which can be installed from pip.To execute the FairyScript compiler from a local download without
installing it, run the localfairyc.py(and substitute executing
this file for thefairyccommand found in the documentation). Note
that the above dependencies must first be resolved.FairyScript also requires python-docx (for writing to Word documents).
However, the original codebase has been modified to support additional
features that FairyScript requires, and so it is included in the
FairyScript codebase. For license information on this package, please
see the appropriate LICENSE file.Compiler UsageThe FairyScript compiler (fairyc) is used to compile .FEY format
manuscript files into other file types. It is invoked by execution from
the command line.The typical usage offairycis to either compile .FEY files to
prettier, more human-readable formats or to compile .FEY files to
executable scripts.To compile a FEY manuscript to Ren’Py:$fairycrenpyinput_file.fey-orenpy_script.rpyTo compile a FEY manuscript to Microsoft Office:$fairycrenpyinput_file.fey-omy_script.docx--wordWhen invoked with no arguments,fairycwill read manuscript
statements from stdin, compile them to Ren’Py script format, and then
output them to stdout:$generate_fey|fairycrenpy|process_outputInput files are specified by passing each as an argument; to specify
multiple input files, pass in multiple arguments. All input files are
read in the order that they are given. If no input files are given,fairycwill read from stdin.In this example, three files are compiled to a single Ren’Py script:$fairycrenpymain_path.feybranch1.feybranch2.fey-omy_script.rpyThe output file is specified with the-ooption. Only one output
file may be specified. If the-ois not given,fairycwill write
the output to stdout. Note that due to the inherent limitations of the
DOCX format, writing to stdout is not permitted when compiling to
Microsoft Word format.Without any additional specification,fairycwill compile the input
to Ren’Py script format. This can be changed by changing the subcommand
given.renpyis used to specify Ren’Py,docxspecifies DOCX
format output,lexspecifies lexer symbols only,astspecifies
outputting the abstract syntax tree without compiling, andanalyzeperforms static analysis on the code and outputs the results as plain
text.By default,fairycexpects input to be in FEY manuscript format, but
it can also parse files that have already been lexed as well as compile
abstract syntax trees. Use the-f(long version--format) option
to set the type of file being processed. The argument to-foption
must befeyfor processing FEY manuscript format,lexfor
processing lexed symbols directly, orastfor processing abstract
syntax trees.The following example parses a file containing pre-lexed symbols and
then compiles the result to a Ren’Py format script:$fairycrenpy-flexscript_symbols.lex-omy_script.rpyIn addition to the options listed above, there are many options that are
specific to the compiler for a particular format. For a full list of
options, invokefairycwith the-hoption:$fairyc-hFEY: The FairyScript LanguageThe FairyScript Language is documented in full in the filefairyscript.mdin the docs directory of fairyscript.