private IEnumerable <Topic> allTopicsInOrder() { var topic = TopicLoader.LoadDirectory(_directory); topic.ParseAndOrder().Wait(); return(topic.AllTopicsInOrder().ToArray()); }
public void find_the_project_root_from_a_solution_with_multiple_docs_returns_null() { var folder = ".".ToFullPath().ParentDirectory().ParentDirectory().ParentDirectory(); TopicLoader.FindProjectRootFolder(folder).ShouldBeNull(); }
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); }
public IGrammar TheTopicsAre() { return(this["BuildTopic"].AsTable("The topics in this directory are") .After(() => { _top = TopicLoader.LoadDirectory(_directory); _top.ParseAndOrder().Wait(); })); }
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))); }
public static TopicToken LoadIndex(string directory) { var root = TopicLoader.LoadFromFolder(directory); var token = new TopicToken(root.Index); token.Key = "index"; return(token); }
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); }
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()); }
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); }); }
// 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); }); })); }