Example #1
0
        static void Main(string[] args)
        {
            if (args.Length < 4)
            {
                return;
            }

            string inputDll = Path.GetFullPath(args[0]);
            string inputXml = Path.GetFullPath(args[1]);

            string outputYaml   = Path.GetFullPath(args[2]);
            string outputFolder = Path.GetFullPath(args[3]);

            if (!Directory.Exists(outputFolder))
            {
                Directory.CreateDirectory(outputFolder);
            }
            else
            {
                Directory.GetFiles(outputFolder).ToList().ForEach(x =>
                {
                    if (Path.GetFileNameWithoutExtension(x).ToLower() != "index")
                    {
                        File.Delete(Path.Combine(outputFolder, x));
                    }
                });
            }

            Assembly assembly = Assembly.UnsafeLoadFrom(inputDll);

            XmlDocument xmlDocument = new XmlDocument();

            xmlDocument.Load(inputXml);

            Console.WriteLine("Parsing XmlDocs");
            XmlDocTree xmlDocTree = XmlDocTree.Parse(xmlDocument);

            Console.WriteLine("Parsing DocTree");
            DocTree docTree = DocTree.Parse(assembly, xmlDocTree);

            Console.WriteLine("Printing DocTree");
            Printer.Print(docTree, outputYaml, outputFolder);
        }