Skip to content

Extend llms-txt to book projects #14276

Description

@mcanouil

llms-txt is provided in the schema which imply it is available to book project, unfortunately that's currently not true.

The feature appears to be available because:

  1. The schema includes llms-txt as a valid boolean option for both website and book configs.
  2. The book config imports website config functions.
  3. The changelog mentions it as a website feature.

But without the formatExtras hook being inherited or implemented for books, the actual processing never occurs.

  • // Add llms.txt finalizer if enabled
    if (websiteConfigBoolean(kLlmsTxt, false, project.config)) {
    extras[kFilterParams] = extras[kFilterParams] || {};
    extras[kFilterParams]["llms-txt"] = true;
    extras.html[kHtmlFinalizers]?.push(
    llmsHtmlFinalizer(source, project, format),
    );
    }

  • // inherit a bunch of behavior from website projects
    preRender: bookPreRender,
    postRender: bookPostRender,
    formatLibDirs: websiteProjectType.formatLibDirs,
    metadataFields: () => [...websiteProjectType.metadataFields!(), "book"],
    resourceIgnoreFields: () => [
    ...websiteProjectType.resourceIgnoreFields!(),
    kBook,
    ],

There are also no book-specific tests for this feature; only website tests exist which is expected in some regards.

Discussed in https://github.com/orgs/quarto-dev/discussions/14275

Originally posted by meierluk March 27, 2026

Description

Is the new feature about llms-txt also available for Quarto books (where the HTML output is basically of type website)?

Using the default template for books (see below), I cannot get it running.

project:
  type: book


book:
  title: "test-book"
  author: "Norah Jones"
  llms-txt: true
  date: "27.3.2026"
  chapters:
    - index.qmd
    - intro.qmd
    - summary.qmd
    - references.qmd

bibliography: references.bib

format:
  html:
    theme:
      - cosmo
      - brand
  pdf:
    documentclass: scrreprt
```</div>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions