Esempio n. 1
0
 internal ValueCollection(OrderedDictionaryG <TKey, TValue> parent)
 {
     this.parent = parent;
 }
Esempio n. 2
0
    public void MakePRPLDocs(Main main, string srcDir, string outputDir)
    {
        this.main      = main;
        resultHTMLFile = null;
        cmdCount       = 0;
        currentSection = null;
        sectionDict    = new OrderedDictionaryG <string, List <Tuple <int, string> > >();
        System.Text.StringBuilder sbcommands = new System.Text.StringBuilder();

        srcDir    = srcDir.Trim();
        outputDir = outputDir.Trim();

        if (srcDir != "" && !srcDir.EndsWith("/") && !srcDir.EndsWith("\\"))
        {
            srcDir = srcDir + "/";
        }
        if (outputDir != "" && !outputDir.EndsWith("/") && !outputDir.EndsWith("\\"))
        {
            outputDir = outputDir + "/";
        }

        // read document index file - each line has filename of next syntax files
        try {
            docIndexLines = System.IO.File.ReadAllLines(srcDir + "prpldocindex.txt");
            foreach (string i in docIndexLines)
            {
                ProcessDocFile(srcDir, i.Trim(), sbcommands);
            }

            System.Text.StringBuilder sb = new System.Text.StringBuilder();

/* stringBuilder sb contains final output HTML header, CSS and JavaScript
 * /* */
            #region HTML/CSS
            sb.Append(@"
<html>
<head>
<style type='text/css'>

    html {font-family: Monaco, Consolas, 'Andale Mono', 'DejaVu Sans Mono', monospace;}
	a {text-decoration: none;}
	a:link {color: green;}
	a:visited {color: green;}
	a:hover {color: blue;}
	a:active {color: black;}	
    code {
        font-size: 90%;
        line-height: 1.2em;
        font-family: Monaco, Consolas, 'Andale Mono', 'DejaVu Sans Mono', monospace;
        white-space: pre;
        white-space: pre-wrap;
        white-space: -moz-pre-wrap;
        white-space: -o-pre-wrap;
        display: block;
        color: #555555;
		background: #f4f4f4;
	}
	.command_syntax { padding: 1px 5px; font-size: 110%; font-weight:bold; background-color: #bfc7cf; color: #000000; width:850px; }
	.command_body{ padding: 1px 1px 50px 15px; width:840px; }
	.example{ padding: 0px 0px 5px 0px; }
	.description{ padding: 0px 0px 5px 0px; width:840px; }
	.index {border-spacing:20px;}
	.index tr{vertical-align:top;}
	.section {width: 400px; background-color:#d0d0d0; border-spacing:1px;}
    .section th{ font-size: 120%;}
	.section td{ padding: 0px 0px 0px 4px;}
	.section tr:nth-child(odd) {background-color: #f7f7f7;}
	.section tr:nth-child(even) {background-color: #ffffff;}
	.sectionHead{background-color:#e0e7ef !important;}
	.backtotop{font-size:60%; padding:0; float:right}
</style >
</head >
");
            #endregion

            GenerateDocSections(sb);
            sb.Append("<br/>");
            sb.Append(sbcommands);
            sb.Append(@"</html>");
            System.IO.File.WriteAllText(outputDir + "PRPLDocs.html", sb.ToString());
            resultHTMLFile = outputDir + "PRPLDocs.html";
            main.LogMessage("\n      Processed Total " + cmdTotal + " comands.");
            Debug.Log("      Processed " + cmdTotal + " comands.");
            main.LogMessage("COMPLETE: HTML file created: " + resultHTMLFile);
        } catch (Exception e) {
            main.LogMessage("ERROR: " + e.Message);
            main.LogMessage(e.StackTrace);
        }
    }