Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 0 additions & 48 deletions docs/source/_ext/rejoin.py

This file was deleted.

8 changes: 0 additions & 8 deletions docs/source/_templates/header.html

This file was deleted.

59 changes: 0 additions & 59 deletions docs/source/_templates/partials/globaltoc-above.html

This file was deleted.

8 changes: 0 additions & 8 deletions docs/source/_templates/versioning.html

This file was deleted.

22 changes: 22 additions & 0 deletions src/Elastic.Markdown/DocumentationGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
using System.IO.Abstractions;
using System.Reflection;
using System.Text.Json;
using System.Text.Json.Serialization;
using Elastic.Markdown.IO;
Expand Down Expand Up @@ -110,6 +111,27 @@ await Parallel.ForEachAsync(DocumentationSet.Files, ctx, async (file, token) =>
if (item % 1_000 == 0)
_logger.LogInformation($"Handled {handledItems} files");
});

var embeddedStaticFiles = Assembly.GetExecutingAssembly()
.GetManifestResourceNames()
.ToList();
foreach (var a in embeddedStaticFiles)
{
await using var resourceStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(a);
if (resourceStream == null)
continue;

var path = a.Replace("Elastic.Markdown.", "").Replace("_static.", "_static/");

var outputFile = OutputFile(path);
if (outputFile.Directory is { Exists: false })
outputFile.Directory.Create();
await using var stream = outputFile.OpenWrite();
await resourceStream.CopyToAsync(stream, ctx);
_logger.LogInformation($"Copied static embedded resource {path}");
}


Context.Collector.Channel.TryComplete();

await GenerateDocumentationState(ctx);
Expand Down
5 changes: 4 additions & 1 deletion src/Elastic.Markdown/Elastic.Markdown.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,8 @@
<PackageReference Include="YamlDotNet" Version="16.1.3" />
<PackageReference Include="System.IO.Abstractions" Version="21.0.29" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="_static/*.js" />
<EmbeddedResource Include="_static/*.css" />
</ItemGroup>
</Project>
1 change: 0 additions & 1 deletion src/Elastic.Markdown/IO/DocumentationSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ public DocumentationSet(BuildContext context)
".md" => CreateMarkDownFile(file, context),
_ => new StaticFile(file, SourcePath)
})

.ToList();

LastWrite = Files.Max(f => f.SourceFile.LastWriteTimeUtc);
Expand Down
1 change: 0 additions & 1 deletion src/docs-builder/Cli/Commands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using Documentation.Builder.Diagnostics;
using Documentation.Builder.Http;
using Elastic.Markdown;
using Elastic.Markdown.Diagnostics;
using Elastic.Markdown.IO;
using Microsoft.Extensions.Logging;

Expand Down
2 changes: 2 additions & 0 deletions src/docs-builder/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

using Actions.Core.Extensions;
using ConsoleAppFramework;
using Documentation.Builder;
using Documentation.Builder.Cli;
using Elastic.Markdown.Diagnostics;
using Microsoft.Extensions.DependencyInjection;
Expand All @@ -28,6 +29,7 @@
services.AddSingleton<DiagnosticsChannel>();
services.AddSingleton<DiagnosticsCollector>();


await using var serviceProvider = services.BuildServiceProvider();
var logger = serviceProvider.GetRequiredService<ILogger<Program>>();
ConsoleApp.ServiceProvider = serviceProvider;
Expand Down
2 changes: 2 additions & 0 deletions src/docs-builder/docs-builder.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0"/>
<PackageReference Include="Github.Actions.Core" Version="8.1.1"/>
<PackageReference Include="Westwind.AspNetCore.LiveReload" Version="0.5.0" />
<PackageReference Include="Chorn.EmbeddedResourceAccessGenerator" Version="1.1.5" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Elastic.Markdown\Elastic.Markdown.csproj" />
</ItemGroup>

</Project>
Loading