Repository navigation
Add support for llms.txt - #903
Open
thokra-nav wants to merge 2 commits into
Open
thokra-nav wants to merge 2 commits into
thokra-nav wants to merge 2 commits into
Conversation
Add a `.md` endpoint to all pages, and a `llms-full.txt` with full doc
There was a problem hiding this comment.
🔵 Needs a closer look
One or more issues must be addressed before approval.
Pull request overview
Adds Markdown representations for documentation pages and generates llms.txt and llms-full.txt endpoints for AI tooling.
Changes:
- Adds Markdown routes and alternate links.
- Implements Markdown serialization and LLM index/full-document generation.
- Adds curation metadata and improves template processing.
File summaries
| File | Description |
|---|---|
| svdoc/src/routes/llms.txt/+server.ts | Updated as part of this pull request. |
| svdoc/src/routes/llms-full.txt/+server.ts | Updated as part of this pull request. |
| svdoc/src/routes/[...path]/+page.svelte | Updated as part of this pull request. |
| svdoc/src/routes/[...path].md/+server.ts | Updated as part of this pull request. |
| svdoc/src/lib/types/tokens.ts | Updated as part of this pull request. |
| svdoc/src/lib/markdown.ts | Updated as part of this pull request. |
| svdoc/src/lib/llms.ts | Updated as part of this pull request. |
| svdoc/src/lib/llms.test.ts | Updated as part of this pull request. |
| svdoc/src/lib/helpers/urls.ts | Updated as part of this pull request. |
| svdoc/src/lib/helpers/templates.ts | Updated as part of this pull request. |
| svdoc/src/lib/helpers/templates.test.ts | Updated as part of this pull request. |
| svdoc/src/lib/content-store.ts | Updated as part of this pull request. |
| README.md | Updated as part of this pull request. |
| docs/workloads/README.md | Updated as part of this pull request. |
| docs/workloads/job/README.md | Updated as part of this pull request. |
| docs/workloads/application/README.md | Updated as part of this pull request. |
| docs/workloads/application/how-to/create.md | Updated as part of this pull request. |
| docs/tutorials/hello-nais.md | Updated as part of this pull request. |
| docs/services/secrets/README.md | Updated as part of this pull request. |
| docs/services/README.md | Updated as part of this pull request. |
| docs/README.md | Updated as part of this pull request. |
| docs/persistence/valkey/README.md | Updated as part of this pull request. |
| docs/persistence/README.md | Updated as part of this pull request. |
| docs/persistence/opensearch/README.md | Updated as part of this pull request. |
| docs/persistence/kafka/README.md | Updated as part of this pull request. |
| docs/persistence/cloudsql/README.md | Updated as part of this pull request. |
| docs/operate/README.md | Updated as part of this pull request. |
| docs/observability/tracing/README.md | Updated as part of this pull request. |
| docs/observability/README.md | Updated as part of this pull request. |
| docs/observability/metrics/README.md | Updated as part of this pull request. |
| docs/observability/logging/README.md | Updated as part of this pull request. |
| docs/explanations/nais.md | Updated as part of this pull request. |
| docs/build/README.md | Updated as part of this pull request. |
| docs/build/how-to/build-and-deploy.md | Updated as part of this pull request. |
| docs/auth/README.md | Updated as part of this pull request. |
| docs/auth/idporten/README.md | Updated as part of this pull request. |
| docs/auth/entra-id/README.md | Updated as part of this pull request. |
Review details
Suppressed comments (3)
svdoc/src/lib/helpers/templates.ts:482
- Raw protection happens before includes are expanded, so a
{% raw %}...{% endraw %}block coming from an included file is inserted after the placeholder pass and then still goes throughprocessVariables/processConditionals. For example,<<tenant()>>inside an included raw block will be expanded, unlike the same block in the parent file. Apply the raw-block protection recursively while expanding includes (or protect included content before the subsequent processing passes), and add a regression test for an included raw block.
let result = content.replace(
/\{%-?\s*raw\s*-?%\}([\s\S]*?)\{%-?\s*endraw\s*-?%\}/g,
(_, body: string) => {
const index = rawBlocks.push(body) - 1;
return `@@SVDOCRAW${index}@@`;
},
);
svdoc/src/lib/helpers/urls.ts:179
- When
BASE_PATHis configured (for example/docs),stripBaseremoves any string prefix, not just the path-segment prefix. A valid page such as/docs-otheris therefore converted to-other.mdhere, breaking its alternate link (and the same helper is used for generated llms links). Strip the base only when the path equals it or starts with${BASE_PATH}/.
const rawPath = stripBase(pathPart || "/");
const normalizedPath = collapseSlashes(rawPath || "/");
svdoc/src/lib/llms.ts:425
- Protocol-relative links such as
[service](//status.example.com)are treated as internal here becauseisExternalHrefdoes not recognize the//scheme. The serializer then turns them into a malformed Markdown link like[/status.example.com.md](/status.example.com.md), so external links lose their destination in the new representations. Treat protocol-relative URLs as external before applying the.mdconversion.
- Files reviewed: 37/37 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
thokra-nav
marked this pull request as draft
September 18, 2026 12:42
thokra-nav
marked this pull request as ready for review
September 29, 2026 07:15
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Add a
.mdendpoint to all pages, and allms-full.txtwith full doc