Exemple #1
0
        private IEnumerable <Topic> allTopicsInOrder()
        {
            var topic = TopicLoader.LoadDirectory(_directory);

            topic.ParseAndOrder().Wait();
            return(topic.AllTopicsInOrder().ToArray());
        }
Exemple #2
0
        public void find_the_project_root_from_a_solution_with_multiple_docs_returns_null()
        {
            var folder =
                ".".ToFullPath().ParentDirectory().ParentDirectory().ParentDirectory();

            TopicLoader.FindProjectRootFolder(folder).ShouldBeNull();
        }
Exemple #3
0
        public void find_the_project_root_folder_when_you_are_at_the_root()
        {
            var folder =
                ".".ToFullPath().ParentDirectory().ParentDirectory().ParentDirectory().AppendPath("Sample.Docs");

            TopicLoader.FindProjectRootFolder(folder)
            .ShouldEqual(folder);
        }
Exemple #4
0
 public IGrammar TheTopicsAre()
 {
     return(this["BuildTopic"].AsTable("The topics in this directory are")
            .After(() =>
     {
         _top = TopicLoader.LoadDirectory(_directory);
         _top.ParseAndOrder().Wait();
     }));
 }
Exemple #5
0
        public void ReadTopics()
        {
            Topic = TopicLoader.LoadDirectory(_settings.Root);

            Topic.ParseAndOrder().Wait();

            _topicByUrl.ClearAll();
            Topic.AllTopicsInOrder().Each(x => _topicByUrl[x.Url] = x);
        }
        public IEnumerable <string> DetermineDocumentsFolders()
        {
            if (DirectoryFlag.IsNotEmpty())
            {
                return(new[] { DirectoryFlag });
            }

            return(TopicLoader.FindDocumentDirectories(Environment.CurrentDirectory));
        }
        public IEnumerable <IPackageInfo> Load(IPackageLog log)
        {
            var reader  = new PackageManifestReader(new FileSystem(), folder => folder);
            var docDirs = TopicLoader.FindDocumentDirectories(_directory);

            return(docDirs
                   .Where(BottlesFilter.ShouldLoad)
                   .SelectMany(dir => loadPackageFromDirectory(dir, reader)));
        }
Exemple #8
0
        public static TopicToken LoadIndex(string directory)
        {
            var root  = TopicLoader.LoadFromFolder(directory);
            var token = new TopicToken(root.Index);

            token.Key = "index";

            return(token);
        }
Exemple #9
0
        public void find_the_project_root_folder_from_a_child()
        {
            var folder =
                ".".ToFullPath().ParentDirectory().ParentDirectory().ParentDirectory().AppendPath("Sample.Docs");

            TopicLoader.FindProjectRootFolder(folder.AppendPath("colors")).ShouldEqual(folder);
            TopicLoader.FindProjectRootFolder(folder.AppendPath("deep")).ShouldEqual(folder);
            TopicLoader.FindProjectRootFolder(folder.AppendPath("deep", "1.b")).ShouldEqual(folder);
        }
Exemple #10
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());
        }
Exemple #11
0
        public void smoke_test_can_load_project_root_from_folder_outside_of_fubumvc_app()
        {
            var folder =
                ".".ToFullPath().ParentDirectory().ParentDirectory().ParentDirectory().AppendPath("FubuDocs.Docs");

            var project = TopicLoader.LoadFromFolder(folder);

            project.ShouldNotBeNull();
            project.AllTopics().Count().ShouldBeGreaterThan(5);

            project.AllTopics().Each(x => {
                Debug.WriteLine(x);
            });
        }
Exemple #12
0
        // SAMPLE: grammar-from-igrammar-return
        public IGrammar CheckTopic()
        {
            return(Paragraph("Check the properties of a topic at the root of the topic directory", _ =>
            {
                _ += this["ForFile"];
                _ += c =>
                {
                    var topic = TopicLoader.LoadTopic(_location, true);
                    topic.ParseFile();
                    c.State.CurrentObject = topic;
                };

                _.VerifyPropertiesOf <Topic>(x =>
                {
                    x.Check(y => y.Key);
                    x.Check(y => y.Title);
                    x.Check(y => y.UrlSegment);
                });
            }));
        }