コード例 #1
0
        static HarloweTranscoder()
        {
            TwineHtmlImporter.RegisterTranscoder <HarloweTranscoder>(weight: 100);

            // Supported code generation macros
            CodeGenMacros["put"]         =
                CodeGenMacros["move"]    =
                    CodeGenMacros["set"] = BuiltInCodeGenMacros.Assignment;

            CodeGenMacros["unless"]           =
                CodeGenMacros["if"]           =
                    CodeGenMacros["elseif"]   =
                        CodeGenMacros["else"] = BuiltInCodeGenMacros.Conditional;

            CodeGenMacros["link"]                       =
                CodeGenMacros["linkreplace"]            =
                    CodeGenMacros["linkgoto"]           =
                        CodeGenMacros["linkreveal"]     =
                            CodeGenMacros["linkrepeat"] = BuiltInCodeGenMacros.Link;

            CodeGenMacros["goto"]    = BuiltInCodeGenMacros.GoTo;
            CodeGenMacros["print"]   = BuiltInCodeGenMacros.Print;
            CodeGenMacros["display"] = BuiltInCodeGenMacros.Display;

            CodeGenMacros["replace"]         =
                CodeGenMacros["append"]      =
                    CodeGenMacros["prepend"] = BuiltInCodeGenMacros.Enchant;

            CodeGenMacros["click"]                                                       =
                CodeGenMacros["clickreplace"]                                            =
                    CodeGenMacros["clickappend"]                                         =
                        CodeGenMacros["clickprepend"]                                    =
                            CodeGenMacros["mouseover"]                                   =
                                CodeGenMacros["mouseoverreplace"]                        =
                                    CodeGenMacros["mouseoverappend"]                     =
                                        CodeGenMacros["mouseoverprepend"]                =
                                            CodeGenMacros["mouseout"]                    =
                                                CodeGenMacros["mouseoutreplace"]         =
                                                    CodeGenMacros["mouseoutappend"]      =
                                                        CodeGenMacros["mouseoutprepend"] = BuiltInCodeGenMacros.EnchantIntoLink;

            CodeGenMacros["live"] = BuiltInCodeGenMacros.Live;
            CodeGenMacros["stop"] = BuiltInCodeGenMacros.Stop;

            CodeGenMacros["align"]                                                =
                CodeGenMacros["font"]                                             =
                    CodeGenMacros["css"]                                          =
                        CodeGenMacros["background"]                               =
                            CodeGenMacros["color"]                                =
                                CodeGenMacros["colour"]                           =
                                    CodeGenMacros["textcolor"]                    =
                                        CodeGenMacros["textcolour"]               =
                                            CodeGenMacros["textstyle"]            =
                                                CodeGenMacros["textrotate"]       =
                                                    CodeGenMacros["transition"]   =
                                                        CodeGenMacros["t8n"]      =
                                                            CodeGenMacros["hook"] = BuiltInCodeGenMacros.Style;
        }
コード例 #2
0
        static SugarTranscoder()
        {
            TwineHtmlImporter.RegisterTranscoder <SugarTranscoder>();

            CodeGenMacros["set"]     =
                CodeGenMacros["run"] = BuiltInCodeGenMacros.Assignment;

            CodeGenMacros["if"]                    =
                CodeGenMacros["elseif"]            =
                    CodeGenMacros["else"]          =
                        CodeGenMacros["/if"]       =
                            CodeGenMacros["endif"] = BuiltInCodeGenMacros.Conditional;

            CodeGenMacros["for"]                    =
                CodeGenMacros["/for"]               =
                    CodeGenMacros["continue"]       =
                        CodeGenMacros["break"]      =
                            CodeGenMacros["endfor"] = BuiltInCodeGenMacros.Loop;

            CodeGenMacros["silently"]            =
                CodeGenMacros["/silently"]       =
                    CodeGenMacros["endsilently"] = BuiltInCodeGenMacros.Silent;
            CodeGenMacros["nobr"]            =
                CodeGenMacros["/nobr"]       =
                    CodeGenMacros["endnobr"] = BuiltInCodeGenMacros.Collapse;
            CodeGenMacros["br"] = BuiltInCodeGenMacros.LineBreak;

            CodeGenMacros["display"] = BuiltInCodeGenMacros.Display;
            CodeGenMacros["goto"]    = BuiltInCodeGenMacros.GoTo;

            CodeGenMacros["="]         =
                CodeGenMacros["print"] = BuiltInCodeGenMacros.Print;

            CodeGenMacros["back"]       =
                CodeGenMacros["return"] = BuiltInCodeGenMacros.Back;

            // Unsupported macros. Recognize them but don't output anything
            CodeGenMacros["remember"]  = null;
            CodeGenMacros["actions"]   = null;
            CodeGenMacros["choice"]    = null;
            CodeGenMacros["script"]    = null;
            CodeGenMacros["/script"]   = null;
            CodeGenMacros["endscript"] = null;
        }