Skip to content

Commit 3589047

Browse files
committed
clean up
1 parent 5c2af60 commit 3589047

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

src/Elastic.Documentation.Configuration/Plugins/DetectionRules/TableOfContents/DetectionRulesReference.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
33
// See the LICENSE file in the project root for more information
44

5-
using System.IO.Abstractions;
65
using Elastic.Documentation.Configuration.Builder;
76
using Elastic.Documentation.Configuration.DocSet;
8-
using Elastic.Documentation.Navigation;
97

108
namespace Elastic.Documentation.Configuration.Plugins.DetectionRules.TableOfContents;
119

@@ -50,7 +48,7 @@ private IReadOnlyCollection<ITableOfContentsItem> CreateTableOfContentItems(Conf
5048

5149
private IReadOnlyCollection<ITableOfContentsItem> ReadDetectionRuleFolder(IDocumentationSetContext context, string detectionRuleFolder)
5250
{
53-
var detectionRulesFolder = System.IO.Path.Combine(ParentPath, detectionRuleFolder).TrimStart(System.IO.Path.DirectorySeparatorChar);
51+
var detectionRulesFolder = Path.Combine(ParentPath, detectionRuleFolder).TrimStart(Path.DirectorySeparatorChar);
5452
var fs = context.ReadFileSystem;
5553
var sourceDirectory = context.DocumentationSourceDirectory;
5654
var directory = fs.DirectoryInfo.New(fs.Path.GetFullPath(fs.Path.Combine(sourceDirectory.FullName, detectionRulesFolder)));
@@ -60,10 +58,10 @@ private IReadOnlyCollection<ITableOfContentsItem> ReadDetectionRuleFolder(IDocum
6058
.Where(f => !f.Directory!.Attributes.HasFlag(FileAttributes.Hidden) && !f.Directory!.Attributes.HasFlag(FileAttributes.System))
6159
.Where(f => f.Extension is ".md" or ".toml")
6260
.Where(f => f.Name != "README.md")
63-
.Where(f => !f.FullName.Contains($"{System.IO.Path.DirectorySeparatorChar}_deprecated{System.IO.Path.DirectorySeparatorChar}"))
61+
.Where(f => !f.FullName.Contains($"{Path.DirectorySeparatorChar}_deprecated{Path.DirectorySeparatorChar}"))
6462
.Select(f =>
6563
{
66-
var relativePath = System.IO.Path.GetRelativePath(sourceDirectory.FullName, f.FullName);
64+
var relativePath = Path.GetRelativePath(sourceDirectory.FullName, f.FullName);
6765
if (f.Extension == ".toml")
6866
{
6967
var rule = DetectionRule.From(f);

tests-integration/Elastic.Assembler.IntegrationTests/NavigationBuildingTests.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,6 @@ private static void RecurseNav(INodeNavigationItem<INavigationModel, INavigation
128128
if (nav.NavigationRoot.Parent is null or not SiteNavigation && nav is not CrossLinkNavigationLeaf)
129129
{
130130
}
131-
// currently this uses an odd construction:
132-
// https://github.com/elastic/docs-content/blob/main/troubleshoot/toc.yml#L146
133-
// working to smooth this out upstream
134-
// https://github.com/elastic/docs-content/pull/3730
135-
if (nav.Url == "/docs/troubleshoot/ingest/opentelemetry")
136-
continue;
137131
nav.NavigationRoot.Parent.Should().NotBeNull($"{nav.Url}");
138132
nav.NavigationRoot.Parent.Should().BeOfType<SiteNavigation>($"{nav.Url}");
139133
}

0 commit comments

Comments
 (0)