Skip to content

Commit 41660dd

Browse files
committed
Move to dedicated LlmMarkdown folder
1 parent 74e7ebb commit 41660dd

File tree

5 files changed

+7
-19
lines changed

5 files changed

+7
-19
lines changed

src/Elastic.Markdown/Exporters/LlmMarkdownExporter.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
using Elastic.Markdown.Helpers;
1313
using Elastic.Markdown.Myst;
1414
using Elastic.Markdown.Myst.Renderers;
15+
using Elastic.Markdown.Myst.Renderers.LlmMarkdown;
1516
using Markdig.Syntax;
1617

1718
namespace Elastic.Markdown.Exporters;

src/Elastic.Markdown/Myst/Renderers/LlmBlockRenderers.cs renamed to src/Elastic.Markdown/Myst/Renderers/LlmMarkdown/LlmBlockRenderers.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
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.CodeDom.Compiler;
6-
using System.IO;
7-
using System.Linq;
8-
using System.Text;
9-
using System.Text.RegularExpressions;
105
using Elastic.Markdown.Helpers;
116
using Elastic.Markdown.Myst.CodeBlocks;
127
using Elastic.Markdown.Myst.Directives;
@@ -19,10 +14,9 @@
1914
using Markdig.Extensions.Yaml;
2015
using Markdig.Renderers;
2116
using Markdig.Syntax;
22-
using Markdig.Syntax.Inlines;
2317
using CodeBlock = Markdig.Syntax.CodeBlock;
2418

25-
namespace Elastic.Markdown.Myst.Renderers;
19+
namespace Elastic.Markdown.Myst.Renderers.LlmMarkdown;
2620

2721
/// <summary>
2822
/// Helper methods for common rendering patterns in LLM renderers

src/Elastic.Markdown/Myst/Renderers/LlmInlineRenderers.cs renamed to src/Elastic.Markdown/Myst/Renderers/LlmMarkdown/LlmInlineRenderers.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
using Markdig.Renderers;
99
using Markdig.Syntax.Inlines;
1010

11-
namespace Elastic.Markdown.Myst.Renderers;
11+
namespace Elastic.Markdown.Myst.Renderers.LlmMarkdown;
1212

1313
public class LlmLinkInlineRenderer : MarkdownObjectRenderer<LlmMarkdownRenderer, LinkInline>
1414
{

src/Elastic.Markdown/Myst/Renderers/LlmMarkdownRenderer.cs renamed to src/Elastic.Markdown/Myst/Renderers/LlmMarkdown/LlmMarkdownRenderer.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@
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;
65
using Elastic.Documentation.Configuration;
7-
using Elastic.Markdown.Exporters;
86
using Markdig.Renderers;
97
using Markdig.Syntax;
108

11-
namespace Elastic.Markdown.Myst.Renderers;
9+
namespace Elastic.Markdown.Myst.Renderers.LlmMarkdown;
1210

1311
/// <summary>
1412
/// Base renderer that outputs CommonMark-compliant markdown optimized for LLM consumption
@@ -86,7 +84,7 @@ public LlmMarkdownRenderer(TextWriter writer) : base(writer)
8684

8785
// Add custom renderers for your MyST extensions
8886
ObjectRenderers.Add(new LlmDirectiveRenderer());
89-
ObjectRenderers.Add(new LlmEnhancedCodeBlockRenderer());
87+
ObjectRenderers.Add(new LlmMarkdown.LlmEnhancedCodeBlockRenderer());
9088

9189
// Add default object renderers for CommonMark elements
9290
ObjectRenderers.Add(new LlmHeadingRenderer());

tests/authoring/Framework/HtmlAssertions.fs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ open AngleSharp.Diffing
1111
open AngleSharp.Diffing.Core
1212
open AngleSharp.Html
1313
open AngleSharp.Html.Parser
14-
open Elastic.Markdown.Exporters
15-
open Elastic.Markdown.Myst
16-
open Elastic.Markdown.Myst.Renderers
14+
open Elastic.Markdown.Myst.Renderers.LlmMarkdown
1715
open JetBrains.Annotations
1816
open Xunit.Sdk
1917

@@ -150,14 +148,11 @@ actual: {actual}
150148
let toLLM ([<LanguageInjection("markdown")>]expected: string) (actual: MarkdownResult) =
151149
let actualLLM =
152150
let buildContext = actual.Context.Generator.Context
153-
let resolvers = actual.Context.Set.MarkdownParser.Resolvers
154-
let yamlFrontMatter = actual.File.YamlFrontMatter
155-
156151
let writer = new StringWriter()
157152
let renderer = LlmMarkdownRenderer(writer, BuildContext = buildContext)
158153
renderer.Render(actual.Document) |> ignore
159154
writer.ToString()
160-
// LLMTextExporter.ToLLMText(buildContext, yamlFrontMatter, resolvers, actual.File.SourceFile)
155+
161156
let difference = diff expected actualLLM
162157
match difference with
163158
| s when String.IsNullOrEmpty s -> ()

0 commit comments

Comments
 (0)