Repository navigation
Enhance LLM readable markdown rendering - #1569
Conversation
…placing subs in the LLM markdown output
4ae0f36 to
89e9732
Compare
Mpdreamz
left a comment
There was a problem hiding this comment.
LGTM! One nit around object pooling.
Did not go into output too much, we can update that as we continue to work closer with other teams.
| { | ||
| await DocumentationSet.Tree.Resolve(ctx); | ||
| var document = await markdown.ParseFullAsync(ctx); | ||
| await using var writer = new StringWriter(); |
There was a problem hiding this comment.
We have an object pool for stringwriters and stringbuilders and htmlrenderes which can drastically help reduce allocation e.g:
See:
For a usage example see:
There was a problem hiding this comment.
I tried to create a LlmMarkdownRenderer object pool based on the existing HtmlRenderSubscription.
Unfortunately, I don't think it will work because I have the BuildContext as property on the LlmMarkdownRenderer.
But I guess I can still use it for StringWriter or StringBuilder.
WIP.
There was a problem hiding this comment.
Ok. I just noticed, what I did is not enough. I need to return the object.
There was a problem hiding this comment.
OK. I think I got it right now.
Otherwise it would serve the markdown file
7b51b3e to
b6d8419
Compare
Closes #1504
Closes https://github.com/elastic/docs-eng-team/issues/161
Changes
This adds a new LlmMarkdownRenderer that extends Markdig's TextRendererBase.
Hence, we can take an existing MarkdownDocument and render it with our new custom renderer.
Notes
The markdown is accessible in local serve, on previews as well as assembler builds.
You just need to append
.mdto the current URL.Preview
https://docs-v3-preview.elastic.dev/elastic/docs-builder/pull/1569/syntax/quick-ref.md