public void Render(Context context, Stream input, Stream output)
 {
     var reader = new StreamReader(input);
     var writer = new StreamWriter(output);
     Render(context, reader, writer);
     writer.Flush();
 }
 public override void Render(Context context, StreamReader reader, StreamWriter writer)
 {
     var generator = new ProfileTableGenerator(context.TargetDir, context.Name, false, new ProfileKnowledgeProvider("http://www.hl7.org/implement/standards/fhir/"));
     string s = reader.ReadToEnd();
     var profile = (Profile)FhirParser.ParseResourceFromXml(s);
     var xmldoc = generator.generate(profile, false);
     writer.Write(xmldoc.ToString(SaveOptions.DisableFormatting));
 }
        public override void Render(Context context, StreamReader reader, StreamWriter writer)
        {
            string content = reader.ReadToEnd();
            StringBuilder builder = new StringBuilder();
            builder.Append(context.FileName);
            builder.Append("==");
            builder.Append(content);

            writer.Write(content);
        }
        public override void Render(Context context, StreamReader reader, StreamWriter writer)
        {
            var mark = new Markdown();

            //set preferences of your markdown
            mark.SafeMode = true;
            mark.ExtraMode = true;
            
            string mdtext = reader.ReadToEnd();
            string htmlmd = mark.Transform(mdtext);

            writer.Write(htmlmd);            
        }
示例#5
0
 public void Render(Context context, Stream input, Stream output)
 {
     Stream source = input;
     Stream target = null;
     foreach (IRenderer renderer in Renderers)
     {
         source.Seek(0, SeekOrigin.Begin);
         target = new MemoryStream();
         renderer.Render(context, source, target);
         source = target;
     }
     target.Seek(0, SeekOrigin.Begin);
     target.CopyTo(output);
     output.Flush();
     output.Close();
 }
 public abstract void Render(Context context, StreamReader reader, StreamWriter writer);
示例#7
0
 public Context Clone()
 {
     Context context = new Context();
     context.RootDir = this.RootDir;
     context.TargetRootDir = this.TargetRootDir;
     return context;
 }
示例#8
0
        public static Context Root(string source, string target)
        {
            Context context = new Context();
            context.RootDir = source;
            context.TargetRootDir = target;
            return context;

        }
 public void Render(Context context, Stream input, Stream output)
 {
     //Razor.Render(context, input, output);
 }
示例#10
0
 public Render(Context context, IRenderer renderer)
 {
     this.Context = context;
     this.renderer = renderer;
 }