private LinkTag linkTagForFolder(SpecificationFolder folder) { var specPath = folder.Path(); var url = _urls.UrlFor(specPath); return(new LinkTag(specPath.Parts.Last(), url)); }
public void find_child_folder() { var folder = new SpecificationFolder("pak1"); var child = folder.ChildFolderFor("f1/f2/f3"); child.FullName.ShouldEqual("pak1/f1/f2/f3"); child.Parent.FullName.ShouldEqual("pak1/f1/f2"); child.Parent.Parent.FullName.ShouldEqual("pak1/f1"); child.Parent.Parent.Parent.FullName.ShouldEqual("pak1"); }
public HtmlTag BuildFolderTag(SpecificationFolder folder) { var folderTag = new HtmlTag("li"); var link = linkTagForFolder(folder); folderTag.Add("span").AddClass("folder").Append(link); var ul = folderTag.Add("ul"); var builder = new ChildTagBuilder(this, ul); folder.ImmediateChildren.Each(x => x.AcceptVisitor(builder)); return folderTag; }
public HtmlTag BuildFolderTag(SpecificationFolder folder) { var folderTag = new HtmlTag("li"); var link = linkTagForFolder(folder); folderTag.Add("span").AddClass("folder").Append(link); var ul = folderTag.Add("ul"); var builder = new ChildTagBuilder(this, ul); folder.ImmediateChildren.Each(x => x.AcceptVisitor(builder)); return(folderTag); }
private static void addSpecs(IEnumerable <AssetFile> javascriptFiles, SpecificationFolder packageFolder) { javascriptFiles .Where(Specification.IsSpecification) .GroupBy(DetermineSpecContentFolder) .Each(group => { var folder = packageFolder; if (!group.Key.IsEmpty()) { folder = packageFolder.ChildFolderFor(new SpecPath(group.Key)); } folder.AddSpecs(group); }); }
public void Folder(SpecificationFolder folder) { var tag = _builder.BuildFolderTag(folder); _parent.Append(tag); }
public SpecificationFolder(string name, SpecificationFolder parent) : this(name) { _parent = parent; }
private static void associateHtmlFiles(PackageAssets package, SpecificationFolder packageFolder) { var htmlFiles = package.AllFiles().Where(x => x.MimeType == MimeType.Html).ToList(); packageFolder.AllSpecifications.Each(x => x.SelectHtmlFiles(htmlFiles)); }
private static void addSpecs(IEnumerable<AssetFile> javascriptFiles, SpecificationFolder packageFolder) { javascriptFiles .Where(Specification.IsSpecification) .GroupBy(DetermineSpecContentFolder) .Each(group => { var folder = packageFolder; if (!group.Key.IsEmpty()) { folder = packageFolder.ChildFolderFor(new SpecPath(group.Key)); } folder.AddSpecs(group); }); }
private LinkTag linkTagForFolder(SpecificationFolder folder) { var specPath = folder.Path(); var url = _urls.UrlFor(specPath); return new LinkTag(specPath.Parts.Last(), url); }