Created
February 20, 2012 23:27
-
-
Save danielwertheim/1872259 to your computer and use it in GitHub Desktop.
Wiki controller example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [HandleError] | |
| public class WikiController : Controller | |
| { | |
| [OutputCache(CacheProfile = "KiwiWikiCache")] | |
| public ActionResult Doc(string docId) | |
| { | |
| return View(MvcApplication.MarkdownService.GetDocument(docId)); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <caching> | |
| <outputCacheSettings> | |
| <outputCacheProfiles> | |
| <add name="KiwiWikiCache" duration="3600" varyByParam="docId"/> | |
| </outputCacheProfiles> | |
| </outputCacheSettings> | |
| </caching> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| routes.MapRoute( | |
| "Wiki", // Route name | |
| "wiki/{docId}", // URL with parameters | |
| new { controller = "wiki", action = "doc", docId = "home" } // Parameter defaults | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| MarkdownService = new MarkdownService(new FileContentProvider(Server.MapPath("~/App_Data/MarkdownFiles"))); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @using Kiwi.Markdown | |
| @model Document | |
| @{ | |
| ViewBag.Title = @Model.Title; | |
| } | |
| <h1>@Model.Title</h1> | |
| <div>@Html.Raw(Model.Content)</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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