예제 #1
0
 // -------------------------------------------------------------------
 // Protected
 // -------------------------------------------------------------------
 protected override void DoProcess(CarbonFile source)
 {
     string content = source.ReadAsString();
     string[] segments = content.Split(StripFromTemplates, StringSplitOptions.RemoveEmptyEntries);
     content = string.Join(" ", segments);
     this.templateSegments.Add($"{source.FileNameWithoutExtension}: '{content}'");
 }
예제 #2
0
        // -------------------------------------------------------------------
        // Protected
        // -------------------------------------------------------------------
        protected override void DoProcess(CarbonFile source)
        {
            // Skip template scripts
            if (source.FileNameWithoutExtension.EndsWith("template", StringComparison.OrdinalIgnoreCase))
            {
                return;
            }

            var localContext = new JavaScriptProcessingContext(source);
            string content = source.ReadAsString();

            this.ProcessSource(localContext, ref content);

            // In debug mode append the file name of the source
            if (this.GetContext<JavaScriptBuildingContext>().IsDebug)
            {
                this.AppendFormatLine("// {0}", source.FileNameWithoutExtension);
            }

            this.AppendLine(content);
        }