Exemplo n.º 1
0
        public ActionResult Page(string folder, string file)
        {
            var content = System.IO.File.ReadAllText(
                Path.Combine(this.AppPath, folder, file + ".md"));

            content = content.Replace(
                "![image](~",
                string.Format("![image]({0}", this.UriPath));

            var transformer = new Strike.IE.Markdownify();

            string markdown = transformer.Transform(content);

            //<pre><code class="([a-z]*-[a-z]*)"

            //<pre class="$1 prettyprint"><code

            markdown = markdown.Replace("<pre", "<pre class=\"prettyprint\"");

            return(View(new Models.Page(file, markdown)));
        }
Exemplo n.º 2
0
        public ActionResult Page(string folder, string file)
        {
            var content = System.IO.File.ReadAllText(
                Path.Combine(this.AppPath, folder, file + ".md"));

            content = content.Replace(
                "![image](~",
                string.Format("![image]({0}", this.UriPath));

            var transformer = new Strike.IE.Markdownify();

            string markdown = transformer.Transform(content);

            //<pre><code class="([a-z]*-[a-z]*)"

            //<pre class="$1 prettyprint"><code

            markdown = markdown.Replace("<pre", "<pre class=\"prettyprint\"");

            return View(new Models.Page(file, markdown));
        }