Esempio n. 1
0
        public override SourceModel Transform(SourceInfo source)
        {
            IMarkdownTransformer markdown = new MarkdownDeepTransformer();

            var text = File.ReadAllText(source.InputPath);

            var html = markdown.Transform(text);

            return new SourceModel { RawHtml = html };
        }
Esempio n. 2
0
        // Generate the documentation for a source file by reading it in, splitting it
        // up into comment/code sections, highlighting them for the appropriate language,
        // and merging them into an HTML template.
        public override SourceModel Transform(SourceInfo source)
        {
            IMarkdownTransformer markdown = new MarkdownDeepTransformer();

            var sections = Parse(source);

            // Prepares a single chunk of code for HTML output and runs the text of its
            // corresponding comment through **Markdown**, using a C# implementation
            // called [MarkdownSharp](http://code.google.com/p/markdownsharp/).
            foreach (var section in sections)
            {
                section.DocsHtml = markdown.Transform(section.DocsHtml);
                section.CodeHtml = HttpUtility.HtmlEncode(section.CodeHtml);
            }

            return new SourceModel { Sections = sections };
        }