示例#1
0
        internal DocsProject GenerateAssemblyFiles()
        {
            if (!Assemblies.Any())
            {
                throw new ArgumentException("Assemblies property must contain at least one Assembly to document.");
            }

            // Create, validate, and log assemblies folder
            LogVerbose($"Creating {Settings.AssembliesFolder} folder...");
            Directory.CreateDirectory(Settings.AssembliesFolder);
            ValidateFolder(Settings.TempFolder);
            LogVerbose($"Creating {Settings.AssembliesFolder} folder complete.");

            Assemblies.ToList().ForEach(a => {
                var outfile = Path.Combine(Settings.AssembliesFolder, a.ToFileName() + ".md");
                var file    = new DocsFile(outfile, DocsFileType.Assembly, DocsProjectOutputFormat.Markdown)
                              .SetTitle(a.GetSimpleName())
                              .UseEngine(new AssemblyFileGenerator(a, Settings, a.GetSimpleName()));
                //.Compile();

                file.Compile();
                Console.WriteLine($"Assembly file created for {a.GetSimpleName()} at {outfile}");
            });

            return(this);
        }
示例#2
0
        internal DocsProject GenerateIndexFile()
        {
            // Throw error if no assemblies in Assemblies property.
            if (!Assemblies.Any())
            {
                throw new ArgumentException("Assemblies property must contain at least one Assembly to document.");
            }

            var filename = Path.Combine(Settings.OutputFolder, "index.md");
            var file     = new DocsFile(filename, DocsFileType.Index, DocsProjectOutputFormat.Markdown)
                           .SetTitle(Settings.ProjectName)
                           .UseEngine(new IndexFileGenerator(Assemblies, Settings));

            //.Compile();

            file.Compile();

            //dll.GetAllNamespaces().ToList().ForEach(a => output.WriteLine("[" + a + "](./namespaces/" + a.Replace(".", "-") + ".md)"));
            // File.WriteAllLines(filename, output.ToString().Split(Environment.NewLine, StringSplitOptions.None));
            LogVerbose($"Index file created at {filename}");

            return(this);
        }