public override bool Execute(DocInput input)
        {
            var file = input.DirectoryFlag.AppendPath("outline.txt");

            if (!Directory.Exists(input.DirectoryFlag))
            {
                Console.WriteLine("Creating the documentation folder at " + input.DirectoryFlag);
                Directory.CreateDirectory(input.DirectoryFlag);

                Console.WriteLine("Creating an empty outline file at " + file);
                File.Create(file);
                return(true);
            }


            if (!File.Exists(file))
            {
                ConsoleWriter.Write(ConsoleColor.Yellow, "Could not find the expected file " + file);
                return(true);
            }

            var top = new OutlineReader(file).ReadFile();

            OutlineWriter.WriteToFiles(input.DirectoryFlag, top);

            return(true);
        }
示例#2
0
        private IEnumerable <Topic> theLoadedTopics()
        {
            var directory = Context.Service <DocSettings>().Root;
            var top       = new OutlineReader(_outlineFile).ReadFile();

            OutlineWriter.WriteToFiles(directory, top);

            var readTop = TopicLoader.LoadDirectory(directory);

            readTop.ParseAndOrder().Wait();

            return(readTop.AllTopicsInOrder());
        }
示例#3
0
        private IEnumerable <OutlineFile> theWrittenFiles()
        {
            var directory = Context.Service <DocSettings>().Root;
            var top       = new OutlineReader(_outlineFile).ReadFile();

            OutlineWriter.WriteToFiles(directory, top);

            var fileSet = new FileSet
            {
                Include = "*.md;order.txt"
            };

            return(new FileSystem().FindFiles(directory, fileSet).Select(file =>
            {
                return new OutlineFile
                {
                    Path = file.PathRelativeTo(directory).Replace(Path.DirectorySeparatorChar, '/'),
                };
            }));
        }