Takenet.MarkDocs is a ASP.NET MVC library that provides markdown documentation.
- Change the
markdocs
section inWeb.Config
with GitHub project documentation sources.
- You can generate your access token on this link
- An optional default language could be defined on top level element
<markdocs defaultLanguage="en">
The markdocs
section will be created during the NuGet package installation.
- Create/Change your
mvc.sitemap
node to host the documentation links
<mvcSiteMapNode title="Documentation" controller="Docs" action="Show"
dynamicNodeProvider="YourNamespace.DocsDynamicNodeProvider, YourAssembly">
</mvcSiteMapNode>
The type YourNamespace.DocsDynamicNodeProvider
referenced above will be created during the NuGet package installation.
You need to configure your DI to inject the MarkDocsProvider
on your DocsController
and DocsDynamicNodeProvider
. This example uses SimpleInjector:
container.RegisterSingleton<MarkDocsProvider>();
The NuGet package installer will create a DocsController
with a Show
action to load your markdown documents and display them in a view.
You need to create a view inside the folder Views/Docs
named Show.cshtml
to display your markdown document.
On the GitHub project that will host your documentation files, create a docs
folder in the root folder.
If you want to localize your docs, create a folder for each culture. At the moment, only TweLetterCultureCodes are supported as culture options. Name your folder accordingly. Ex:
- docs
- en
- 1-index.md
- 2-about.md
- pt
- 1-index.md
- 2-about.md
You need to prefix your markdown files with a number and a dash. The number will be used to sort the documentation files and the equivalent SiteMap items.
The SiteMap itens can be localized if your enable localization in the Web.Config
file.
The localization resources must match the part of the file name discarding the sort index and the extension and should be available in your AppGlobal_Resources
.
Apache License 2.0