Inheritance: IDocRenderer
Example #1
0
        static void Main(string[] args)
        {
            var wikiRepoPath = args[0];
            var xmlDocFolder = GetXmlDocFolder();
            var scriptsFolder = GetScriptFolder();
            var docRenderer = new GitHubDocRenderer();
            var typeNames = ToolkitTypes.GetTypeNames().Concat(ToolkitTypes.GetAnimationTypeNames());

            foreach(var typeName in typeNames) {
                var renderSampleSiteLink = Documentation.IsRenderSampleSiteLink(typeName);
                var forceHeaderRendering = Documentation.IsForceHeaderRendering(typeName);
                var extenderDoc = new ExtenderDoc(docRenderer, renderSampleSiteLink, forceHeaderRendering);
                var doc = Documentation.Get(typeName, xmlDocFolder, scriptsFolder);

                Documentation animationDocs = null;
                if(Documentation.IsAnimationScriptsRelatedType(typeName))
                    animationDocs = Documentation.GetAnimationScriptsReference(scriptsFolder);

                var markup = extenderDoc.BuildDoc(doc.Types, animationDocs?.Types);
                var markdownFilePath = Path.Combine(wikiRepoPath, typeName + ".md");
                File.WriteAllText(markdownFilePath, markup);

                var htmlDescripton = new HtmlDocRenderer().RenderDescription(doc.Types.FirstOrDefault().Summary);
                SaveHtmlDescription(typeName, htmlDescripton);
                var htmlProperties = new HtmlDocRenderer().RenderMembers(doc.Types.FirstOrDefault());
                SaveHtmlProperties(typeName, htmlProperties);
            }
        }
        public ContentResult Markup(string id) {
            var typeName = id;
            var xmlDocFolder = Server.MapPath("~/bin/");
            var scriptsFolder = Server.MapPath("~/bin/Scripts/");
            var doc = Documentation.Get(typeName, xmlDocFolder, scriptsFolder);

            var docRenderer = new GitHubDocRenderer();
            var extenderDoc = new ExtenderDoc(docRenderer);
            var markup = extenderDoc.BuildDoc(doc.Types);

            return Content(markup);
        }
        public ContentResult Markup(string id)
        {
            var typeName = id;
            var xmlDocFolder = Server.MapPath("~/bin/");
            var scriptsFolder = Server.MapPath("~/bin/Scripts/");
            var doc = Documentation.Get(typeName, xmlDocFolder, scriptsFolder);
            var docRenderer = new GitHubDocRenderer();
            var renderSampleSiteLink = Documentation.IsRenderSampleSiteLink(typeName);
            var forceHeaderRendering = Documentation.IsForceHeaderRendering(typeName);
            var extenderDoc = new ExtenderDoc(docRenderer, renderSampleSiteLink, forceHeaderRendering);

            Documentation animationDocs = null;
            if(Documentation.IsAnimationScriptsRelatedType(typeName))
                animationDocs = Documentation.GetAnimationScriptsReference(scriptsFolder);

            var markup = extenderDoc.BuildDoc(doc.Types, animationDocs?.Types);

            return Content(markup);
        }