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
1 change: 1 addition & 0 deletions _quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ website:
- docs/websites/website-drafts.qmd
- docs/websites/website-search.qmd
- docs/websites/website-tools.qmd
- docs/websites/website-llms.qmd
- docs/websites/website-about.qmd
- section: "Listing Pages"
href: docs/websites/website-listings.qmd
Expand Down
2 changes: 2 additions & 0 deletions docs/prerelease/1.9/_highlights.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ Quarto 1.9 includes the following new features:

- [Posit Connect Cloud Publishing](/docs/publishing/posit-connect-cloud.qmd): Publish documents and websites to Posit Connect Cloud using `quarto publish posit-connect-cloud`.

- [Output for LLMs](/docs/websites/website-llms.qmd): Generate `llms.txt` and `.llms.md` files for websites, making your content more accessible to large language models and AI-powered tools.

- [Privacy-first cookie consent](/docs/websites/website-tools.qmd#cookie-consent): The default for cookie consent has changed to `type: express`, providing opt-in consent that blocks cookies until users explicitly agree. This privacy-conscious default is designed with modern privacy regulations in mind.

- [`aria-label` for videos](/docs/authoring/videos.qmd#accessibility-label): Improve accessibility of embedded videos by providing custom descriptive labels for screen readers instead of the default "Video Player" label.
Expand Down
61 changes: 61 additions & 0 deletions docs/websites/website-llms.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
title: Output for LLMs
---

## Overview

Quarto can generate [llms.txt](https://llmstxt.org/) format output for your website, making your content more accessible to large language models and AI-powered tools. When enabled, Quarto creates an `llms.txt` index file and `.llms.md` markdown files for each page.

## Enabling `llms.txt`

To enable `llms.txt` output, add `llms-txt: true` to your website configuration:

```{.yaml filename="_quarto.yml"}
website:
title: "My Documentation"
llms-txt: true
```

## Generated Output

When you render your site, Quarto creates files in the output directory (typically `_site/`).

### `llms.txt` Index

An `llms.txt` file is created at the root of your site. This index lists all pages with their titles, using your site's title and description from the website configuration in `_quarto.yml`.

### Markdown Files

For each HTML page, a corresponding `.llms.md` file is created alongside it (e.g., `guide.html` gets `guide.llms.md`). These contain clean markdown versions of your content.

## Content Conversion

HTML content is converted to markdown using Pandoc. Navigation elements, sidebars, breadcrumbs, footers, and scripts are removed. Tables, code blocks, callouts, tabsets, and images are converted to standard markdown formats. Internal links are automatically rewritten from `.html` to `.llms.md` extensions, including links with anchors.

## Conditional Content

To include content only in the `.llms.md` output, use the `llms-txt` format with [conditional content](/docs/authoring/conditional.qmd) classes.

For example, to include content only in `document.llms.md`:

```{.markdown filename="document.qmd"}
::: {.content-visible when-format="llms-txt"}
This content appears only in the `.llms.md` output.
:::
```

To exclude content from `document.llms.md`:

```{.markdown filename="document.qmd"}
::: {.content-hidden when-format="llms-txt"}
This content appears in HTML but not in `.llms.md` output.
:::
```

## Draft Handling

Draft pages are automatically excluded from both `.llms.md` generation and the `llms.txt` index. The 404 page is also excluded from the index.

## Build Behavior

On full builds, all `.llms.md` files and the `llms.txt` index are regenerated. On incremental builds, individual `.llms.md` files are updated but `llms.txt` is preserved, matching the behavior of sitemap generation.