Skip to content

Instantly share code, notes, and snippets.

@danielwertheim
Created February 20, 2012 23:27
Show Gist options
  • Save danielwertheim/1872259 to your computer and use it in GitHub Desktop.
Save danielwertheim/1872259 to your computer and use it in GitHub Desktop.
Wiki controller example
[HandleError]
public class WikiController : Controller
{
[OutputCache(CacheProfile = "KiwiWikiCache")]
public ActionResult Doc(string docId)
{
return View(MvcApplication.MarkdownService.GetDocument(docId));
}
}
<caching>
<outputCacheSettings>
<outputCacheProfiles>
<add name="KiwiWikiCache" duration="3600" varyByParam="docId"/>
</outputCacheProfiles>
</outputCacheSettings>
</caching>
routes.MapRoute(
"Wiki", // Route name
"wiki/{docId}", // URL with parameters
new { controller = "wiki", action = "doc", docId = "home" } // Parameter defaults
);
MarkdownService = new MarkdownService(new FileContentProvider(Server.MapPath("~/App_Data/MarkdownFiles")));
@using Kiwi.Markdown
@model Document
@{
ViewBag.Title = @Model.Title;
}
<h1>@Model.Title</h1>
<div>@Html.Raw(Model.Content)</div>
# Clone and Get the Wiki locally
git clone git@github.com:danielwertheim/TickTack-Website.wiki.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment