Skip to content

Commit

Permalink
move /docs/source to /docs (#277)
Browse files Browse the repository at this point in the history
* move /docs/source to /docs

* update tests to new paths
  • Loading branch information
Mpdreamz authored Jan 21, 2025
1 parent 5b7a700 commit 4ae4f03
Show file tree
Hide file tree
Showing 71 changed files with 24 additions and 24 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions tests/Elastic.Markdown.Tests/Directives/DirectiveBaseTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ protected DirectiveTest(ITestOutputHelper output, [LanguageInjection("markdown")

FileSystem = new MockFileSystem(new Dictionary<string, MockFileData>
{
{ "docs/source/index.md", new MockFileData(documentContents) }
{ "docs/index.md", new MockFileData(documentContents) }
}, new MockFileSystemOptions
{
CurrentDirectory = Paths.Root.FullName
Expand All @@ -67,7 +67,7 @@ protected DirectiveTest(ITestOutputHelper output, [LanguageInjection("markdown")
// nasty but sub implementations won't use class state.
AddToFileSystem(FileSystem);

var root = FileSystem.DirectoryInfo.New(Path.Combine(Paths.Root.FullName, "docs/source"));
var root = FileSystem.DirectoryInfo.New(Path.Combine(Paths.Root.FullName, "docs/"));
FileSystem.GenerateDocSetYaml(root);

Collector = new TestDiagnosticsCollector(output);
Expand All @@ -76,7 +76,7 @@ protected DirectiveTest(ITestOutputHelper output, [LanguageInjection("markdown")
Collector = Collector
};
Set = new DocumentationSet(context);
File = Set.GetMarkdownFile(FileSystem.FileInfo.New("docs/source/index.md")) ?? throw new NullReferenceException();
File = Set.GetMarkdownFile(FileSystem.FileInfo.New("docs/index.md")) ?? throw new NullReferenceException();
Html = default!; //assigned later
Document = default!;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Elastic.Markdown.Tests/Directives/ImageTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class ImageBlockTests(ITestOutputHelper output) : DirectiveTest<ImageBloc
)
{
protected override void AddToFileSystem(MockFileSystem fileSystem) =>
fileSystem.AddFile(@"docs/source/img/observability.png", "");
fileSystem.AddFile(@"docs/img/observability.png", "");

[Fact]
public void ParsesBlock() => Block.Should().NotBeNull();
Expand Down
8 changes: 4 additions & 4 deletions tests/Elastic.Markdown.Tests/FileInclusion/IncludeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ protected override void AddToFileSystem(MockFileSystem fileSystem)
{
// language=markdown
var inclusion = "*Hello world*";
fileSystem.AddFile(@"docs/source/_snippets/test.md", inclusion);
fileSystem.AddFile(@"docs/_snippets/test.md", inclusion);
}

[Fact]
Expand Down Expand Up @@ -53,7 +53,7 @@ protected override void AddToFileSystem(MockFileSystem fileSystem)
{
// language=markdown
var inclusion = "*Hello {{foo}}*";
fileSystem.AddFile(@"docs/source/_snippets/test.md", inclusion);
fileSystem.AddFile(@"docs/_snippets/test.md", inclusion);
}

[Fact]
Expand Down Expand Up @@ -126,7 +126,7 @@ protected override void AddToFileSystem(MockFileSystem fileSystem)
{
// language=markdown
var inclusion = "*Hello world*";
fileSystem.AddFile(@"docs/source/test.md", inclusion);
fileSystem.AddFile(@"docs/test.md", inclusion);
}

[Fact]
Expand Down Expand Up @@ -162,7 +162,7 @@ protected override void AddToFileSystem(MockFileSystem fileSystem)
:::{include} test.md
:::
""";
fileSystem.AddFile(@"docs/source/_snippets/test.md", inclusion);
fileSystem.AddFile(@"docs/_snippets/test.md", inclusion);
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ protected override void AddToFileSystem(MockFileSystem fileSystem)
{
// language=markdown
var inclusion = "*Hello world*";
fileSystem.AddFile(@"docs/source/_snippets/test.txt", inclusion);
fileSystem.AddFile(@"docs/_snippets/test.txt", inclusion);
}

[Fact]
Expand All @@ -48,7 +48,7 @@ protected override void AddToFileSystem(MockFileSystem fileSystem)
{
// language=markdown
var inclusion = "*Hello world*";
fileSystem.AddFile(@"docs/source/_snippets/test.md", inclusion);
fileSystem.AddFile(@"docs/_snippets/test.md", inclusion);
}

[Fact]
Expand Down
4 changes: 2 additions & 2 deletions tests/Elastic.Markdown.Tests/Inline/AnchorLinkTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ protected override void AddToFileSystem(MockFileSystem fileSystem)
These are new requirements
""";
fileSystem.AddFile(@"docs/source/testing/req.md", inclusion);
fileSystem.AddFile(@"docs/source/_static/img/observability.png", new MockFileData(""));
fileSystem.AddFile(@"docs/testing/req.md", inclusion);
fileSystem.AddFile(@"docs/_static/img/observability.png", new MockFileData(""));
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ protected override void AddToFileSystem(MockFileSystem fileSystem)
This is a 'important' admonition
:::
""";
fileSystem.AddFile(@"docs/source/testing/req.md", inclusion);
fileSystem.AddFile(@"docs/source/_static/img/observability.png", new MockFileData(""));
fileSystem.AddFile(@"docs/testing/req.md", inclusion);
fileSystem.AddFile(@"docs/_static/img/observability.png", new MockFileData(""));
}

}
Expand Down
4 changes: 2 additions & 2 deletions tests/Elastic.Markdown.Tests/Inline/InlineLinkTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ protected override void AddToFileSystem(MockFileSystem fileSystem)
To follow this tutorial you will need to install the following components:
""";
fileSystem.AddFile(@"docs/source/testing/req.md", inclusion);
fileSystem.AddFile(@"docs/source/_static/img/observability.png", new MockFileData(""));
fileSystem.AddFile(@"docs/testing/req.md", inclusion);
fileSystem.AddFile(@"docs/_static/img/observability.png", new MockFileData(""));
}

}
Expand Down
6 changes: 3 additions & 3 deletions tests/Elastic.Markdown.Tests/Inline/InlneBaseTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ protected InlineTest(

FileSystem = new MockFileSystem(new Dictionary<string, MockFileData>
{
{ "docs/source/index.md", new MockFileData(documentContents) }
{ "docs/index.md", new MockFileData(documentContents) }
}, new MockFileSystemOptions
{
CurrentDirectory = Paths.Root.FullName
Expand All @@ -106,7 +106,7 @@ protected InlineTest(
// nasty but sub implementations won't use class state.
AddToFileSystem(FileSystem);

var root = FileSystem.DirectoryInfo.New(Path.Combine(Paths.Root.FullName, "docs/source"));
var root = FileSystem.DirectoryInfo.New(Path.Combine(Paths.Root.FullName, "docs/"));
FileSystem.GenerateDocSetYaml(root, globalVariables);

Collector = new TestDiagnosticsCollector(output);
Expand All @@ -115,7 +115,7 @@ protected InlineTest(
Collector = Collector
};
Set = new DocumentationSet(context);
File = Set.GetMarkdownFile(FileSystem.FileInfo.New("docs/source/index.md")) ?? throw new NullReferenceException();
File = Set.GetMarkdownFile(FileSystem.FileInfo.New("docs/index.md")) ?? throw new NullReferenceException();
Html = default!; //assigned later
Document = default!;
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Elastic.Markdown.Tests/OutputDirectoryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ public async Task CreatesDefaultOutputDirectory()
var logger = new TestLoggerFactory(output);
var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData>
{
{ "docs/source/docset.yml", new MockFileData("") },
{ "docs/source/index.md", new MockFileData("test") }
{ "docs/docset.yml", new MockFileData("") },
{ "docs/index.md", new MockFileData("test") }
}, new MockFileSystemOptions
{
CurrentDirectory = Paths.Root.FullName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ namespace Elastic.Markdown.Tests.SettingsInclusion;

public class IncludeTests(ITestOutputHelper output) : DirectiveTest<SettingsBlock>(output,
$$"""
:::{settings} /{{SettingsPath.Replace("docs/source/", "")}}
:::{settings} /{{SettingsPath.Replace("docs/", "")}}
:::
"""
)
{
private static readonly string SettingsPath =
"docs/source/syntax/kibana-alerting-action-settings.yml";
"docs/syntax/kibana-alerting-action-settings.yml";

protected override void AddToFileSystem(MockFileSystem fileSystem)
{
Expand Down Expand Up @@ -52,7 +52,7 @@ protected override void AddToFileSystem(MockFileSystem fileSystem)
{
// language=markdown
var inclusion = "*Hello world*";
fileSystem.AddFile(@"docs/source/_snippets/test.md", inclusion);
fileSystem.AddFile(@"docs/_snippets/test.md", inclusion);
}

[Fact]
Expand Down

0 comments on commit 4ae4f03

Please sign in to comment.